User: d_jencks
  Date: 01/11/10 13:38:04

  Modified:    src/main/org/jboss/mq/il ServerILJMXService.java
                        ServerILJMXServiceMBean.java
  Log:
  Changed mbean dependencies to work directly by mbean-references: eliminated depends 
tag from *service.xml files
  
  Revision  Changes    Path
  1.7       +37 -8     jbossmq/src/main/org/jboss/mq/il/ServerILJMXService.java
  
  Index: ServerILJMXService.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/il/ServerILJMXService.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ServerILJMXService.java   2001/10/21 05:38:13     1.6
  +++ ServerILJMXService.java   2001/11/10 21:38:04     1.7
  @@ -7,17 +7,12 @@
   package org.jboss.mq.il;
   
   import java.util.Properties;
  -import javax.management.*;
  +import javax.management.ObjectName;
   import javax.naming.InitialContext;
   import org.jboss.mq.GenericConnectionFactory;
   import org.jboss.mq.SpyConnectionFactory;
   import org.jboss.mq.SpyXAConnectionFactory;
   import org.jboss.mq.server.JMSServer;
  -
  -
  -
  -
  -
   import org.jboss.system.ServiceMBeanSupport;
   
   /**
  @@ -25,14 +20,48 @@
    *  extended to provide a full implementation.
    *
    * @author     Hiram Chirino ([EMAIL PROTECTED])
  - * @version    $Revision: 1.6 $
  + * @author <a href="mailto:[EMAIL PROTECTED]";>David Jencks</a>
  + * @version    $Revision: 1.7 $
    */
   public abstract class ServerILJMXService extends ServiceMBeanSupport implements 
ServerILJMXServiceMBean
   {
  +
  +   private ObjectName jbossMQService;
  +   private JMSServer jmsServer;
  +
      protected String connectionFactoryJNDIRef;
      protected String xaConnectionFactoryJNDIRef;
      protected long pingPeriod = 60000L;
      
  +
  +
  +   /**
  +    * Get the value of JBossMQService.
  +    * @return value of JBossMQService.
  +    */
  +   public ObjectName getJBossMQService() 
  +   {
  +      return jbossMQService;
  +   }
  +   
  +   /**
  +    * Set the value of JBossMQService.
  +    * @param v  Value to assign to JBossMQService.
  +    */
  +   public void setJBossMQService(ObjectName  jbossMQService) 
  +   {
  +      this.jbossMQService = jbossMQService;
  +   }
  +
  +   public void startService() throws Exception
  +   {
  +      jmsServer = (JMSServer)getServer().invoke(jbossMQService, "getJMSServer", new 
Object[]{}, new String[]{});
  +      if (jmsServer == null) 
  +      {
  +         throw new IllegalStateException("Cannot find JBossMQService!");
  +      } // end of if ()
  +   }
  +   
      /**
       * @param  newConnectionFactoryJNDIRef  the JNDI reference where the
       *      connection factory should be bound to
  @@ -126,7 +155,7 @@
       */
      public JMSServer lookupJMSServer() throws Exception
      {
  -      return (JMSServer)getServer().invoke(new 
ObjectName(org.jboss.mq.server.JBossMQServiceMBean.OBJECT_NAME), "getJMSServer", new 
Object[]{}, new String[]{});
  +      return jmsServer;
      }
      
      /**
  
  
  
  1.6       +23 -7     jbossmq/src/main/org/jboss/mq/il/ServerILJMXServiceMBean.java
  
  Index: ServerILJMXServiceMBean.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jbossmq/src/main/org/jboss/mq/il/ServerILJMXServiceMBean.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ServerILJMXServiceMBean.java      2001/09/27 03:27:43     1.5
  +++ ServerILJMXServiceMBean.java      2001/11/10 21:38:04     1.6
  @@ -6,13 +6,15 @@
    */
   package org.jboss.mq.il;
   
  +import javax.management.ObjectName;
   import org.jboss.system.ServiceMBean;
   
   /**
    *  This interface is used to define which methods will be exposed via JMX.
    *
    * @author     Hiram Chirino ([EMAIL PROTECTED])
  - * @version    $Revision: 1.5 $
  + * @author <a href="mailto:[EMAIL PROTECTED]";>david jencks</a>
  + * @version    $Revision: 1.6 $
    */
   public interface ServerILJMXServiceMBean extends ServiceMBean
   {
  @@ -21,35 +23,49 @@
       * @return    java.lang.String the JNDI reference where the connection
       *      factory should be bound to
       */
  -   public java.lang.String getConnectionFactoryJNDIRef();
  +   String getConnectionFactoryJNDIRef();
   
      /**
       * @param  newConnectionFactoryJNDIRef  the JNDI reference where the
       *      connection factory should be bound to
       */
  -   public void setConnectionFactoryJNDIRef(java.lang.String 
newConnectionFactoryJNDIRef);
  +   void setConnectionFactoryJNDIRef(java.lang.String newConnectionFactoryJNDIRef);
   
      /**
       * @param  newXaConnectionFactoryJNDIRef  java.lang.String the JNDI reference
       *      where the xa connection factory should be bound to
       */
  -   public void setXAConnectionFactoryJNDIRef(java.lang.String 
newXaConnectionFactoryJNDIRef);
  +   void setXAConnectionFactoryJNDIRef(java.lang.String 
newXaConnectionFactoryJNDIRef);
   
      /**
       * @return    java.lang.String the JNDI reference where the xa connection
       *      factory should be bound to
       */
  -   public java.lang.String getXAConnectionFactoryJNDIRef();
  +   String getXAConnectionFactoryJNDIRef();
   
   
      /**
       * @return    long the period of time in ms to wait between connection pings
       *      factory should be bound to
       */
  -   public long getPingPeriod();
  +   long getPingPeriod();
      
      /**
       * @param  period long the period of time in ms to wait between connection pings
       */
  -   public void setPingPeriod(long period);
  +   void setPingPeriod(long period);
  +
  +
  +   /**
  +    * Get the value of JBossMQService.
  +    * @return value of JBossMQService.
  +    */
  +   ObjectName getJBossMQService(); 
  +   
  +   /**
  +    * Set the value of JBossMQService.
  +    * @param v  Value to assign to JBossMQService.
  +    */
  +   void setJBossMQService(ObjectName  jbossMQService); 
  +
   }
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to