0 Replies Latest reply on Feb 5, 2004 6:48 AM by Frederic Perez Ordeig

    Nukes Virtual Host done!

    Frederic Perez Ordeig Newbie

      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"?>
      
      <datasources>
       <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>
       <password>nukes</password>
       </local-tx-datasource>
      </datasources>
      
      


      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)