users@glassfish.java.net

Re: How to start/stop MDB in glassfish App Server

From: <glassfish_at_javadesktop.org>
Date: Wed, 12 May 2010 02:37:17 PDT

Once I did something similar. You can use JMX to control the status of your configured JMS destinations. It is possible to start (resume) or stop (pause) a destination for receiving/sending or in both directions. Also you can fetch a list of all destinations and some other things. Just use JMX!

See: com.sun.messaging.jms.management.server.DestinationPauseType

or the list of possible operations:
com.sun.messaging.jms.management.server.DestinationOperations

example:
// obj = ObjectName of the destination
MyUtil.invokeOperation(obj, DestinationOperations.PAUSE, new Object[] { DestinationPauseType.ALL }, new String[] { String.class.getName() });

This is an app server independent solution and fits for GF2.1/2.1.1/3
[Message sent by forum member 'openwms']

http://forums.java.net/jive/thread.jspa?messageID=469495