User: user57  
  Date: 02/04/03 00:25:18

  Modified:    src/main/org/jboss/ejb EJBDeployer.java
                        EJBDeployerMBean.java
  Log:
   o DeployerMBean -> SubDeployer
   o Extending SubDeployerSupport
  
  Revision  Changes    Path
  1.17      +55 -81    jboss/src/main/org/jboss/ejb/EJBDeployer.java
  
  Index: EJBDeployer.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/EJBDeployer.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- EJBDeployer.java  23 Feb 2002 05:00:46 -0000      1.16
  +++ EJBDeployer.java  3 Apr 2002 08:25:18 -0000       1.17
  @@ -1,9 +1,10 @@
   /*
  -* JBoss, the OpenSource J2EE webOS
  -*
  -* Distributable under LGPL license.
  -* See terms of license at gnu.org.
  -*/
  + * JBoss, the OpenSource J2EE webOS
  + *
  + * Distributable under LGPL license.
  + * See terms of license at gnu.org.
  + */
  +
   package org.jboss.ejb;
   
   import java.io.File;
  @@ -28,8 +29,9 @@
   import org.apache.log4j.NDC;
   
   import org.jboss.deployment.DeploymentInfo;
  -import org.jboss.deployment.DeployerMBean;
  +import org.jboss.deployment.SubDeployerSupport;
   import org.jboss.deployment.DeploymentException;
  +
   import org.jboss.management.j2ee.J2EEDeployedObject;
   import org.jboss.logging.Logger;
   import org.jboss.metadata.ApplicationMetaData;
  @@ -50,30 +52,27 @@
   //import org.jboss.management.j2ee.EjbModule;
   
   /**
  -* A EJBDeployer is used to deploy EJB applications. It can be given a
  -* URL to an EJB-jar or EJB-JAR XML file, which will be used to instantiate
  -* containers and make them available for invocation.
  -*
  -* <p>Now also works with message driven beans.
  -*
  -* @see Container
  -*
  -* @author <a href="mailto:[EMAIL PROTECTED]";>Rickard �berg</a>
  -* @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
  -* @author <a href="mailto:[EMAIL PROTECTED]";>Juha Lindfors</a>
  -* @author <a href="mailto:[EMAIL PROTECTED]";>Sebastien Alborini</a>
  -* @author <a href="mailto:[EMAIL PROTECTED]";>Peter Antman</a>.
  -* @author <a href="mailto:[EMAIL PROTECTED]";>Scott Stark</a>
  -* @author <a href="mailto:[EMAIL PROTECTED]";>Sacha Labourey</a>
  -* @version $Revision: 1.16 $ 
  -*/
  + * A EJBDeployer is used to deploy EJB applications. It can be given a
  + * URL to an EJB-jar or EJB-JAR XML file, which will be used to instantiate
  + * containers and make them available for invocation.
  + *
  + * <p>Now also works with message driven beans.
  + *
  + * @see Container
  + *
  + * @author <a href="mailto:[EMAIL PROTECTED]";>Rickard �berg</a>
  + * @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
  + * @author <a href="mailto:[EMAIL PROTECTED]";>Juha Lindfors</a>
  + * @author <a href="mailto:[EMAIL PROTECTED]";>Sebastien Alborini</a>
  + * @author <a href="mailto:[EMAIL PROTECTED]";>Peter Antman</a>.
  + * @author <a href="mailto:[EMAIL PROTECTED]";>Scott Stark</a>
  + * @author <a href="mailto:[EMAIL PROTECTED]";>Sacha Labourey</a>
  + * @version $Revision: 1.17 $ 
  + */
   public class EJBDeployer
  -extends ServiceMBeanSupport
  -implements EJBDeployerMBean
  +   extends SubDeployerSupport
  +   implements EJBDeployerMBean
   {
  -   // Constants -----------------------------------------------------
  -   //private static final String SERVICE_CONTROLLER_NAME = 
"jboss.system:spine=ServiceController";
  -   
      // Attributes ----------------------------------------------------
      
      private ServiceControllerMBean serviceController;
  @@ -100,62 +99,48 @@
      // Public --------------------------------------------------------
      
      /**
  -   * Returns the deployed applications.
  -   */
  +    * Returns the deployed applications.
  +    */
      public Iterator getDeployedApplications()
      {
         return deployments.values().iterator();
      }
      
      /**
  -   * Implements the abstract <code>getObjectName()</code> method in superclass
  -   * to return this service's name.
  -   *
  -   * @param server
  -   * @param name
  -   * @return
  -   *
  -   * @throws MalformedObjectNameException
  -   */
  +    * Implements the abstract <code>getObjectName()</code> method in superclass
  +    * to return this service's name.
  +    *
  +    * @param server
  +    * @param name
  +    * @return
  +    *
  +    * @throws MalformedObjectNameException
  +    */
      public ObjectName getObjectName( MBeanServer server, ObjectName name )
  -   throws MalformedObjectNameException
  +      throws MalformedObjectNameException
      {
         return OBJECT_NAME;
      }
      
      /**
  -   * Implements the abstract <code>getName()</code> method in superclass to
  -   * return the name of this object.
  -   *
  -   * @return <tt>'Container factory'</code>
  -   */
  -   public String getName()
  -   {
  -      return "Container factory";
  -   }
  -   
  -   public void startService()
  +    * Get a reference to the ServiceController
  +    */
  +   public void startService() throws Exception
      {
         serviceController = (ServiceControllerMBean)
         MBeanProxy.create(ServiceControllerMBean.class,
                           ServiceControllerMBean.OBJECT_NAME,
                           server);
  -      try
  -      {
  -         // Register with the main deployer
  -         server.invoke(
  -            org.jboss.deployment.MainDeployerMBean.OBJECT_NAME,
  -            "addDeployer",
  -            new Object[] {this},
  -            new String[] {"org.jboss.deployment.DeployerMBean"});
  -      }
  -      catch (Exception e) {log.error("Could not register with MainDeployer", e);}
  +
  +      // register with MainDeployer
  +      super.startService();
      }
  +
      /**
  -   * Implements the template method in superclass. This method stops all the
  -   * applications in this server.
  -   */
  -   public void stopService() throws DeploymentException
  +    * Implements the template method in superclass. This method stops all the
  +    * applications in this server.
  +    */
  +   public void stopService() throws Exception
      {
         for (Iterator modules = deployments.values().iterator(); modules.hasNext(); )
         {
  @@ -163,7 +148,8 @@
            
            stop(di);
         }
  -      //avoid concurrent modification exception
  +
  +      // avoid concurrent modification exception
         for (Iterator modules = new ArrayList(deployments.values()).iterator(); 
modules.hasNext(); )
         {
            DeploymentInfo di = (DeploymentInfo) modules.next();
  @@ -171,21 +157,10 @@
            destroy(di);
         }
         deployments.clear();
  -    
  -      try
  -      {
  -         // Unregister with the main deployer
  -         server.invoke(
  -            org.jboss.deployment.MainDeployerMBean.OBJECT_NAME,
  -            "removeDeployer",
  -            new Object[] {this},
  -            new String[] {"org.jboss.deployment.DeployerMBean"});
  -      }
  -      catch (Exception e) {log.error("Could not register with MainDeployer", e);}
  -  
  +
  +      // deregister with MainDeployer
  +      super.stopService();
      }
  -   
  -    
   
      /**
      * Enables/disables the application bean verification upon deployment.
  @@ -436,7 +411,6 @@
      {
         try 
         {
  -         
            serviceController.stop(di.deployedObject);
         }
         catch (Exception e)
  
  
  
  1.6       +3 -4      jboss/src/main/org/jboss/ejb/EJBDeployerMBean.java
  
  Index: EJBDeployerMBean.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/EJBDeployerMBean.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- EJBDeployerMBean.java     22 Feb 2002 04:24:54 -0000      1.5
  +++ EJBDeployerMBean.java     3 Apr 2002 08:25:18 -0000       1.6
  @@ -13,9 +13,8 @@
   import javax.management.ObjectName;
   import org.jboss.util.jmx.ObjectNameFactory;
   
  -import org.jboss.deployment.DeployerMBean;
  +import org.jboss.deployment.SubDeployerMBean;
   import org.jboss.deployment.DeploymentException;
  -import org.jboss.system.ServiceMBean;
   
   /**
    * This is the interface of the EJBDeployer that is exposed
  @@ -26,7 +25,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Rickard �berg</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Juha Lindfors</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
  - * @version $Revision: 1.5 $
  + * @version $Revision: 1.6 $
    * 
    * <p><b>20011227 marc fleury:</b>
    * <ul>
  @@ -34,7 +33,7 @@
    * </ul>
    */
   public interface EJBDeployerMBean
  -   extends DeployerMBean
  +   extends SubDeployerMBean
   {
      /** The default object name. */
      ObjectName OBJECT_NAME = 
ObjectNameFactory.create("jboss.ejb:service=EJBDeployer");
  
  
  

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

Reply via email to