View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3820296#3820296

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3820296

Well, I've done some work in nukes core to provide a rough multi-deployment capability 
to nukes. It's very very experimental!!!



As cooper said it's possible to do it by two ways: 

first by prefixing some unique identifier to all nukes jmx names 

and  second by providing a private jmx server. 

I chose the first option mainly because the fact that the second would be more 
difficult to manage as we might need a private jmx-console.

The main refactoring I've done to code is to add a Domain class containing an static 
vaule with the prefix and simply replacing all the occurences like 



"nukes.blocks:name=" + target

to

Domain.domainName + "nukes.blocks:name=" + target



Also in the xml descriptors of the applications like jboss-service.xml I've added the 
prefix to all the MBeans code.

But it's not enough to get it work. I had to change the EJB names, the datasource, the 
context-root, the internal deployment dir and the directory of the Index. It's also 
needed to modify jboss-app.xml to modify the jboss classloader to get it work.



I attached a zip with the modified code.  If you replace the cvs code with this and 
make a build you get another core prefixed with "domini2.". You can deploy (with 
another file name eg nukes2.ear) it if you create another nukes database (eg nukes1), 
create another datasource descriptor with jndi name NukedDS1 like: 



<?xml version="1.0" encoding="UTF-8"?>





  <local-tx-datasource>

    <jndi-name>NukesDS1</jndi-name>

    <connection-url>jdbc:mysql://localhost:3306/nukes1</connection-url>

    <driver-class>org.gjt.mm.mysql.Driver</driver-class>

    <user-name>nukes1</user-name>

    nukes

  </local-tx-datasource>









You also have to create the dir /server/default/nukesDeploy2. It runs in the 
localhost:8080/nukesRoot/



To get another core you have to do this:

-in /nukes/build change jndi-root property

-in org/jboss/nukes/utils/Domain.java change the prefix

-in /nukes/src/resources/nukes-ear/METAINF/jboss-app.xml change the line

 <loader-repository>domini2.com:loader=nukes.ear</loader-repository> 

to  something like 
<loader-repository>anyotherthing:loader=nukes.ear</loader-repository> 

-in jboss-service.xml search and replace all the domini2 occurences. 

-in the same file, replace nukesRoot

-in build/properties change the nukesDS and the context-Root

-in nukes/src/main/org/jboss/nukes/core/modules/index/Indexmodule search for 
/nukesData and chage for another thing.



make a build clean and build to get another core.



I've not made bigger changes to the code to respect the cooper's ideas and patterns 
(and because I don't have so much time! I have to study for the exams!!!). I know it's 
not easy and very ugly. 

I think it would be nice to do all the work described above by touching a single build 
property but it involves major refactoring to the build system.  In addition, It would 
be nice to turn the Domain class into a Mbean to configure it from xml descriptor. 
Keep in mind that the deployed modules must be refactored to follow the same rule.



Take it as a experimental nukes core. I've done it for personal use and I published it 
to share the experience. I hope this could be an inspiration to some better coder than 
me. 

I have no more time! to write!



Bye! And thank you all for the excellent work with nukes and jboss!



oops there is not attachement feature?  get the attachement: 
http://www.ceosona.com/nukes/nukesMultiDeploy.zip (It's provisinal I will remove this 
link, the server is not mine! please mirror it)


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to