User: user57 Date: 02/01/02 20:00:54 Modified: src/main/org/jboss/mq/server JBossMQService.java JBossMQServiceMBean.java StateManager.java Log: o migrated all components to a new JMX domain name model. jboss.system is now where to core/spine components live. moved all components that were in JBOSS-SYSTEM that did not move into a jboss.* domain into jboss (where the server is now registered). The point was to limit the members of jboss.system to core bits only. o Created org.jboss.system.Server, which does the work of initialization that org.jboss.Main used to do. Main now only parses the command line, sets up basic legecy properties and creates a Server instance. o Moved functionality of Shutdown (component not cl tool) into Server ( which is bound as jboss.system:service=Server) o Moved more Runtime access from Info into Server. Exposed memory info as attributes. o Logging a WARN everywhere that uses System.getProperty("jboss.system.home") as that should go away soon/eventually. o Initialized the invokerMap in the harmi impl to avoid NPE o Made getopt.jar a member of the lib/* dir instead of adding it to the run.jar and shutdown.jars each time. o Minor cosmetic changes along the way. Revision Changes Path 1.11 +63 -72 jbossmq/src/main/org/jboss/mq/server/JBossMQService.java Index: JBossMQService.java =================================================================== RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/server/JBossMQService.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- JBossMQService.java 2001/12/19 19:52:57 1.10 +++ JBossMQService.java 2002/01/03 04:00:54 1.11 @@ -1,11 +1,11 @@ /* -* JBoss, the OpenSource J2EE webOS -* -* Distributable under LGPL license. -* See terms of license at gnu.org. -*/ -package org.jboss.mq.server; + * JBoss, the OpenSource J2EE webOS + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package org.jboss.mq.server; import javax.jms.JMSException; import javax.management.Attribute; @@ -19,18 +19,23 @@ import org.jboss.system.ServiceMBeanSupport; /** -* JMX MBean implementation for JBossMQ. -* -* @author Vincent Sheffer ([EMAIL PROTECTED]) -* @author <a href="mailto:[EMAIL PROTECTED]">Juha Lindfors</a> -* @author <a href="[EMAIL PROTECTED]">Hiram Chirino</a> -* @see JBossMQ subproject -* @version $Revision: 1.10 $ -*/ -public class JBossMQService extends ServiceMBeanSupport implements JBossMQServiceMBean + * JMX MBean implementation for JBossMQ. + * + * @author Vincent Sheffer ([EMAIL PROTECTED]) + * @author <a href="mailto:[EMAIL PROTECTED]">Juha Lindfors</a> + * @author <a href="[EMAIL PROTECTED]">Hiram Chirino</a> + * @see JBossMQ subproject + * @version $Revision: 1.11 $ + */ +public class JBossMQService + extends ServiceMBeanSupport + implements JBossMQServiceMBean { - private static final String SERVICE_CONTROLLER_NAME = "JBOSS-SYSTEM:spine=ServiceController"; + private static final String SERVICE_CONTROLLER_NAME = + "jboss.system:service=ServiceController"; + public String jndiBindLocation = "java:/JBossMQServer"; + // Attributes ---------------------------------------------------- private ObjectName mqService; @@ -47,7 +52,7 @@ } public ObjectName preRegister(MBeanServer server, ObjectName name) - throws Exception + throws Exception { mqService = super.preRegister(server, name); return mqService; @@ -55,20 +60,20 @@ /** - * Gets the Name attribute of the JBossMQService object - * - * @return The Name value - */ + * Gets the Name attribute of the JBossMQService object + * + * @return The Name value + */ public String getName() { return "JBossMQ"; } /** - * Gets the JMSServer attribute of the JBossMQService object - * - * @return The JMSServer value - */ + * Gets the JMSServer attribute of the JBossMQService object + * + * @return The JMSServer value + */ public JMSServer getJMSServer() { return jmsServer; @@ -76,54 +81,51 @@ /** - * Get the value of PersistenceManager. - * @return value of PersistenceManager. - */ + * Get the value of PersistenceManager. + * @return value of PersistenceManager. + */ public ObjectName getPersistenceManager() { return persistenceManager; } /** - * Set the value of PersistenceManager. - * @param v Value to assign to PersistenceManager. - */ + * Set the value of PersistenceManager. + * @param v Value to assign to PersistenceManager. + */ public void setPersistenceManager(ObjectName objectName) { this.persistenceManager = objectName; } - /** - * Get the value of StateManager. - * @return value of StateManager. - */ + * Get the value of StateManager. + * @return value of StateManager. + */ public ObjectName getStateManager() { return stateManager; } /** - * Set the value of StateManager. - * @param v Value to assign to StateManager. - */ + * Set the value of StateManager. + * @param v Value to assign to StateManager. + */ public void setStateManager(ObjectName objectName) { this.stateManager = objectName; } /** - * #Description of the Method - * - * @param name Description of Parameter - * @exception Exception Description of Exception - */ + * #Description of the Method + * + * @param name Description of Parameter + * @exception Exception Description of Exception + */ public void createQueue(String name) throws Exception - { - + { try - { - + { ObjectName queue = getQueueObjectName(name); getServer().createMBean("org.jboss.mq.server.QueueManager", queue); getServer().setAttribute(queue, new Attribute("JBossMQService", mqService)); @@ -147,16 +149,16 @@ log.warn("Could not create the destination: ", e); throw e; } - } // Administration calls + /** - * #Description of the Method - * - * @param name Description of Parameter - * @exception Exception Description of Exception - */ + * #Description of the Method + * + * @param name Description of Parameter + * @exception Exception Description of Exception + */ public void createTopic(String name) throws Exception { try @@ -178,30 +180,26 @@ getServer().invoke(getServiceControllerName(), "start", new Object[] {topic}, - new String[] {"javax.management.ObjectName"}); - - + new String[] {"javax.management.ObjectName"}); } catch (Exception e) { log.warn("Could not create the destination: ", e); throw e; } - - } /** - * #Description of the Method - * - * @param name Description of Parameter - * @exception Exception Description of Exception - */ + * #Description of the Method + * + * @param name Description of Parameter + * @exception Exception Description of Exception + */ public void destroyQueue(String name) throws Exception { try { - + ObjectName queue = getQueueObjectName(name); getServer().invoke(getServiceControllerName(), "undeploy", @@ -230,8 +228,7 @@ public void destroyTopic(String name) throws Exception { try - { - + { ObjectName topic = getTopicObjectName(name); //getServer().invoke(topic, "stop", new Object[]{}, new String[]{}); //getServer().unregisterMBean(topic); @@ -239,23 +236,18 @@ "undeploy", new Object[] {topic}, new String[] {"javax.management.ObjectName"}); - } catch (Exception e) { log.warn("Could not destroy the destination: ", e); throw e; } - - } - protected void startService() throws Exception { try { - PersistenceManager pm = (PersistenceManager) getServer().invoke(persistenceManager, "getInstance", new Object[] {}, @@ -300,5 +292,4 @@ { return new ObjectName(SERVICE_CONTROLLER_NAME); } - } 1.6 +7 -10 jbossmq/src/main/org/jboss/mq/server/JBossMQServiceMBean.java Index: JBossMQServiceMBean.java =================================================================== RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/server/JBossMQServiceMBean.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- JBossMQServiceMBean.java 2001/11/10 21:38:05 1.5 +++ JBossMQServiceMBean.java 2002/01/03 04:00:54 1.6 @@ -10,20 +10,18 @@ import org.jboss.system.ServiceMBean; /** - * <description>MBean interface for the JBossMQ JMX service. + * MBean interface for the JBossMQ JMX service. * * @author <a href="[EMAIL PROTECTED]">Hiram Chirino</a> * @see <related> - * @version $Revision: 1.5 $ + * @version $Revision: 1.6 $ */ public interface JBossMQServiceMBean extends ServiceMBean { - public final static String OBJECT_NAME = "JBossMQ:service=Server"; + String OBJECT_NAME = "jboss.mq:service=Server"; JMSServer getJMSServer(); - - /** * <code>setPersistenceManager</code> sets the ObjectName @@ -45,7 +43,7 @@ * @param name Description of Parameter * @exception Exception Description of Exception */ - public void createQueue(String name) throws Exception; + void createQueue(String name) throws Exception; /** * #Description of the Method @@ -53,7 +51,7 @@ * @param name Description of Parameter * @exception Exception Description of Exception */ - public void createTopic(String name) throws Exception; + void createTopic(String name) throws Exception; /** * #Description of the Method @@ -61,7 +59,7 @@ * @param name Description of Parameter * @exception Exception Description of Exception */ - public void destroyQueue(String name) throws Exception; + void destroyQueue(String name) throws Exception; /** * #Description of the Method @@ -69,6 +67,5 @@ * @param name Description of Parameter * @exception Exception Description of Exception */ - public void destroyTopic(String name) throws Exception; - + void destroyTopic(String name) throws Exception; } 1.10 +2 -1 jbossmq/src/main/org/jboss/mq/server/StateManager.java Index: StateManager.java =================================================================== RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/server/StateManager.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- StateManager.java 2001/11/10 21:38:05 1.9 +++ StateManager.java 2002/01/03 04:00:54 1.10 @@ -35,7 +35,7 @@ * * @author Norbert Lataille ([EMAIL PROTECTED]) * @author <a href="[EMAIL PROTECTED]">Hiram Chirino</a> - * @version $Revision: 1.9 $ + * @version $Revision: 1.10 $ */ public class StateManager extends ServiceMBeanSupport implements StateManagerMBean { @@ -428,6 +428,7 @@ */ public void loadConfig() throws java.io.IOException, org.jboss.mq.xml.XElementException { + log.warn("using jboss.system.home property"); java.io.File jbossHome = new java.io.File(System.getProperty("jboss.system.home")); if (!jbossHome.exists()) {
_______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development