-
1. Re: Programatically EJB Deploy
adrian.brock Sep 2, 2003 10:55 AM (in response to joaocm)http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jboss/contrib/varia/src/main/org/jboss/ant/JMX.java?annotate=1.5
Just invoke the MainDeployer mbean deploy(URL) operation
Regards,
Adrian -
2. Re: Programatically EJB Deploy
aaronlippold Dec 1, 2003 2:09 PM (in response to joaocm)Hi,
Once I deploy via the MainDeployer is there a way I can have the MainDeployer tell me when the deployment is finished so that I can 'pause' my build process till it is completed? -
3. Re: Programatically EJB Deploy
genman Dec 1, 2003 6:57 PM (in response to joaocm)
Through JMX you can receive MBeanServer notifications. You should be able to see if your EJBs have been registered and started. Find the ObjectName of the EJBs you are installing. Get the MBeanServer and then register a notification listener.
http://java.sun.com/j2ee/1.4/docs/api/javax/management/MBeanServer.html
See addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback). One of the notification messages should indicate the EJBs were STARTED. -
4. Re: Programatically EJB Deploy
genman Dec 1, 2003 7:08 PM (in response to joaocm)
By the way, it appears the Ant JMX task doesn't support waiting for notifications, so you'll have to write that yourself. As an alternative you can always poll the state in some sort of loop until the service is up. This sort of thing will have to be written by you.. :-)
Actually, a state polling loop might be preferable, as the MBean must exist before you can register a notification listener, and the notification itself could happen AFTER you get the notification listener registered. -
5. Re: Programatically EJB Deploy
aaronlippold Dec 2, 2003 11:22 AM (in response to joaocm)Hi,
When you say, you'll have to write that yourself, my own inclanation would have been to write a loop that uses the boolean isDeployed() function from the MainDeployer. However, your responce seems to suggest that you may have another approach. If so what would that be?
Thanks for the help.
Aaron -
6. Re: Programatically EJB Deploy
rameshs Dec 3, 2003 3:31 AM (in response to joaocm)Hi,
I have deployed my ejbs using the MainDeployer MBean and providing a remote URL. But how do I persist these ejbs in the server side?
Regards,
Ramesh. -
7. Re: Programatically EJB Deploy
aaronlippold Dec 9, 2003 10:35 AM (in response to joaocm)When you deployed your ejbs using the MainDeployer with a remote URL what port did you specify for the connection and did you have to have a special account setup for the file transfer from machine A to machine B since the mainDeployer is copping your ejb to the remote machine.
Can you be a bit more specific on what you mean by, "persist these ejbs in the server side..."
Thanks
Aaron -
8. Re: Programatically EJB Deploy
rameshs Dec 11, 2003 1:43 AM (in response to joaocm)Hi,
I actually provided an HTTP URL such as http://rameshs:8080/myejb.jar
This ejb gets deployed when the JBoss is running. But when I restart the JBoss Server, this ejb doesn't get deployed. So, there are 2 choices for me:
1. There is some Scanner MBean in JBoss, where you can provide URLs / directories to be scanned for deployment. I can add my URL to this MBean. But I need to have my web server running constantly at 8080. This would not be feasible as I have started the web server temporarily for deployment alone.
2. The MainDeployer can have additional options of persisting the ejb (Saving the EJB jar locally) so that the ejb would automatically deploy even while restarting.
I was looking for the 2nd option. Any help would be appreciated.
Regards,
Ramesh