User: simone  
  Date: 00/12/18 02:22:59

  Modified:    src/main/org/jboss/ejb ContainerFactoryMBean.java
                        ContainerFactory.java
  Log:
  Updated to support JMS bean cache monitoring.
  
  Revision  Changes    Path
  1.9       +10 -2     jboss/src/main/org/jboss/ejb/ContainerFactoryMBean.java
  
  Index: ContainerFactoryMBean.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/ContainerFactoryMBean.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ContainerFactoryMBean.java        2000/12/07 15:44:09     1.8
  +++ ContainerFactoryMBean.java        2000/12/18 10:22:59     1.9
  @@ -15,7 +15,7 @@
    *   @author Rickard �berg ([EMAIL PROTECTED])
    *   @author Juha Lindfors ([EMAIL PROTECTED])
    *
  - *   @version $Revision: 1.8 $
  + *   @version $Revision: 1.9 $
    */
   public interface ContainerFactoryMBean
        extends org.jboss.util.ServiceMBean
  @@ -25,7 +25,11 @@
       
      // Public --------------------------------------------------------
   
  -     /**
  +   /**
  +    * Returns the applications deployed by the container factory
  +    */
  +   public java.util.Iterator getDeployedApplications();
  +   /**
         *      Deploy an application
         *
         * @param   url  
  @@ -97,5 +101,9 @@
      public boolean isDeployed(String url)
         throws MalformedURLException;
   
  +   /**
  +    * Set the JMS monitoring of the bean cache.
  +    */
  +   public void setBeanCacheJMSMonitoringEnabled(boolean enable);
   }
   
  
  
  
  1.61      +67 -26    jboss/src/main/org/jboss/ejb/ContainerFactory.java
  
  Index: ContainerFactory.java
  ===================================================================
  RCS file: /products/cvs/ejboss/jboss/src/main/org/jboss/ejb/ContainerFactory.java,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- ContainerFactory.java     2000/12/07 18:16:09     1.60
  +++ ContainerFactory.java     2000/12/18 10:22:59     1.61
  @@ -79,7 +79,7 @@
   *   @author <a href="mailto:[EMAIL PROTECTED]">Sebastien Alborini</a>
   *   @author Peter Antman ([EMAIL PROTECTED])
   *
  -*   @version $Revision: 1.60 $
  +*   @version $Revision: 1.61 $
   */
   public class ContainerFactory
       extends org.jboss.util.ServiceMBeanSupport
  @@ -108,10 +108,18 @@
   
      // Enable metrics interceptor
      boolean metricsEnabled    = false;
  +   
  +   /* Enable JMS monitoring of the bean cache */
  +   private boolean m_beanCacheJMSMonitoring;
   
      // Public --------------------------------------------------------
   
      /**
  +    * Returns the deployed applications.
  +    */
  +   public java.util.Iterator getDeployedApplications() {return 
deployments.values().iterator();}
  +
  +   /**
      * Implements the abstract <code>getObjectName()</code> method in superclass
      * to return this service's name.
      *
  @@ -227,6 +235,14 @@
      {
         return metricsEnabled;
      }
  +   
  +   /**
  +    * Set JMS monitoring of the bean cache.
  +    */
  +   public void setBeanCacheJMSMonitoringEnabled(boolean enable)
  +   {
  +        m_beanCacheJMSMonitoring = enable;
  +   }
   
      /**
      *   Deploy the file at this URL. This method is typically called from remote 
administration
  @@ -623,27 +639,37 @@
   
                     // Set container invoker
                     ContainerInvoker ci = null;
  -                 try {
  +                 try 
  +                              {
                       ci = 
(ContainerInvoker)cl.loadClass(conf.getContainerInvoker()).newInstance();
  -                     } catch(Exception e) {
  +                 } catch(Exception e) {
                       throw new DeploymentException("Missing or invalid Container 
Invoker (in jboss.xml or standardjboss.xml)");
  -                     }
  -                 if (ci instanceof XmlLoadable) {
  +                 }
  +                 if (ci instanceof XmlLoadable) 
  +                              {
                      // the container invoker can load its configuration from the 
jboss.xml element
                      ((XmlLoadable)ci).importXml(conf.getContainerInvokerConf());
  -                     }
  +                 }
                    container.setContainerInvoker(ci);
   
                     // Set instance cache
                     InstanceCache ic = null;
  -                 try {
  +                 try 
  +                              {
                       ic = 
(InstanceCache)cl.loadClass(conf.getInstanceCache()).newInstance();
  -                     } catch(Exception e) {
  +                                     if (ic instanceof AbstractInstanceCache) 
  +                                     {
  +                                             
((AbstractInstanceCache)ic).setJMSMonitoringEnabled(m_beanCacheJMSMonitoring);
  +                                     }
  +                 } 
  +                              catch(Exception e) 
  +                              {
                       throw new DeploymentException("Missing or invalid Instance 
Cache (in jboss.xml or standardjboss.xml)");
  -                     }
  -                 if (ic instanceof XmlLoadable) {
  +                 }
  +                 if (ic instanceof XmlLoadable) 
  +                              {
                      ((XmlLoadable)ic).importXml(conf.getContainerCacheConf());
  -                     }
  +                 }
                    container.setInstanceCache(ic);
   
                     // No real instance pool, use the shadow class
  @@ -731,39 +757,54 @@
   
                  // Set container invoker
                  ContainerInvoker ci = null;
  -              try {
  +              try 
  +                       {
                    ci = 
(ContainerInvoker)cl.loadClass(conf.getContainerInvoker()).newInstance();
  -                  } catch(Exception e) {
  +              } 
  +                       catch(Exception e) 
  +                       {
                    throw new DeploymentException("Missing or invalid Container 
Invoker (in jboss.xml or standardjboss.xml)");
  -                  }
  -              if (ci instanceof XmlLoadable) {
  +              }
  +              if (ci instanceof XmlLoadable) 
  +                       {
                   // the container invoker can load its configuration from the 
jboss.xml element
                   ((XmlLoadable)ci).importXml(conf.getContainerInvokerConf());
  -                  }
  +              }
                 container.setContainerInvoker(ci);
   
                  // Set instance cache
                  InstanceCache ic = null;
  -              try {
  +              try 
  +                       {
                    ic = 
(InstanceCache)cl.loadClass(conf.getInstanceCache()).newInstance();
  -                  } catch(Exception e) {
  +                              if (ic instanceof AbstractInstanceCache) 
  +                              {
  +                                     
((AbstractInstanceCache)ic).setJMSMonitoringEnabled(m_beanCacheJMSMonitoring);
  +                              }
  +              } 
  +                       catch(Exception e) {
                    throw new DeploymentException("Missing or invalid Instance Cache 
(in jboss.xml or standardjboss.xml)");
  -                  }
  -              if (ic instanceof XmlLoadable) {
  +              }
  +              if (ic instanceof XmlLoadable) 
  +                       {
                   ((XmlLoadable)ic).importXml(conf.getContainerCacheConf());
  -                  }
  +              }
                 container.setInstanceCache(ic);
   
                  // Set instance pool
                  InstancePool ip = null;
  -              try {
  +              try 
  +                       {
                    ip = 
(InstancePool)cl.loadClass(conf.getInstancePool()).newInstance();
  -                  } catch(Exception e) {
  +              } 
  +                       catch(Exception e) 
  +                       {
                    throw new DeploymentException("Missing or invalid Instance Pool 
(in jboss.xml or standardjboss.xml)");
  -                  }
  -               if (ip instanceof XmlLoadable) {
  +              }
  +              if (ip instanceof XmlLoadable) 
  +                       {
                   ((XmlLoadable)ip).importXml(conf.getContainerPoolConf());
  -                  }
  +              }
                 container.setInstancePool(ip);
   
                  // Set persistence manager
  
  
  

Reply via email to