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

  Modified:    src/main/org/jboss/deployment EARDeployer.java
                        EARDeployerMBean.java
  Log:
   o DeployerMBean -> SubDeployer
   o Extending SubDeployerSupport
  
  Revision  Changes    Path
  1.11      +25 -89    jboss/src/main/org/jboss/deployment/EARDeployer.java
  
  Index: EARDeployer.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/EARDeployer.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- EARDeployer.java  2 Mar 2002 23:22:10 -0000       1.10
  +++ EARDeployer.java  3 Apr 2002 08:25:18 -0000       1.11
  @@ -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.deployment;
   
   import java.io.File;
  @@ -19,7 +20,6 @@
   
   import org.w3c.dom.Element;
   
  -// /*
   import java.net.MalformedURLException;
   import java.net.URLClassLoader;
   import java.io.File;
  @@ -41,28 +41,22 @@
   import javax.management.RuntimeMBeanException;
   import javax.management.RuntimeErrorException;
   
  -
   import org.jboss.management.j2ee.J2EEApplication;
   
  -// */
  -
   /**
  -*
  -* @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
  -* @version $Revision: 1.10 $
  -*/
  + * Enterprise Archive Deployer.
  + *
  + * @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
  + * @version $Revision: 1.11 $
  + */
   public class EARDeployer
  -extends ServiceMBeanSupport
  -implements EARDeployerMBean
  +   extends SubDeployerSupport
  +   implements EARDeployerMBean
   {
      // Constants -----------------------------------------------------
      
      // Attributes ----------------------------------------------------
      
  -   // my server to lookup for the special deployers
  -   // <comment author="cgjung">better be protected for subclassing </comment>
  -   protected MBeanServer server;
  -   
      // <comment author="cgjung">better be protected for subclassing </comment>
      protected String name;
      
  @@ -70,11 +64,12 @@
      
      public EARDeployer()
      {
  +      super();
      }
      
      public void setDeployerName(final String name)
      {
  -      this.log = Logger.getLogger(getClass().getName() + "#" + name);
  +      this.log = Logger.getLogger(getClass().getName() + "." + name);
         this.name = name;
      }
      
  @@ -93,7 +88,7 @@
      
      
      public void init(DeploymentInfo di)
  -   throws DeploymentException
  +      throws DeploymentException
      {
         try
         {
  @@ -139,24 +134,6 @@
         );
      }
      
  -   
  -   public void create(DeploymentInfo di)
  -      throws DeploymentException
  -   {
  -      log.info("Deploying J2EE application, create step, a no-op: " + di.url);
  -   }
  -   
  -   public void start(DeploymentInfo di)
  -      throws DeploymentException
  -   {
  -      log.info("Deploying J2EE application, start step, a no-op: " + di.url);
  -   }
  -   
  -   public void stop(DeploymentInfo di) throws DeploymentException
  -   {
  -      log.info("Undeploying J2EE application, stop step, a no-op: " + di.url);
  -   }
  -   
      /**
       * Describe <code>destroy</code> method here.
       *
  @@ -166,63 +143,22 @@
      public void destroy(DeploymentInfo di) throws DeploymentException
      {
         log.info("Undeploying J2EE application, destroy step: " + di.url);
  +
         // Destroy the appropriate JSR-77 instance
  -      J2EEApplication.destroy(
  -         server,
  -         di.shortName
  -      );
  +      J2EEApplication.destroy(server, di.shortName);
      }
      
      
      // ServiceMBeanSupport overrides ---------------------------------
  -   public String getName()
  -   {
  -      return "J2EE Deployer " + name;
  -   }
  -   
  +
  +   /** 
  +    * @todo make this.name an attribute rather than appending 
  +    */
      protected ObjectName getObjectName(MBeanServer server, ObjectName name)
  -   throws javax.management.MalformedObjectNameException
  +      throws javax.management.MalformedObjectNameException
      {
  -      this.server = server;
  -      return name == null ? new ObjectName(OBJECT_NAME+this.name) : name;
  -   }
  -   
  -   protected void startService() throws Exception
  -   {
  -      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);}
  -  
  -      log.info("EARDeployer started");
  +      return name == null ? new ObjectName(OBJECT_NAME + this.name) : name;
      }
  -   
  -   
  -      
  -   
  -   /** undeploys all deployments */
  -   protected void stopService()
  -   {
  -      log.info("EARDeployer stopped");
  -      
  -      try
  -      {
  -         // Register 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);}
  -  
  -   }
  -   
  +
      // Private -------------------------------------------------------
   }
  
  
  
  1.5       +2 -2      jboss/src/main/org/jboss/deployment/EARDeployerMBean.java
  
  Index: EARDeployerMBean.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/EARDeployerMBean.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- EARDeployerMBean.java     8 Mar 2002 20:59:28 -0000       1.4
  +++ EARDeployerMBean.java     3 Apr 2002 08:25:18 -0000       1.5
  @@ -19,10 +19,10 @@
    * The JMX management interface for the {@link EARDeployer} MBean.
    * 
    * @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    */
   public interface EARDeployerMBean
  -   extends DeployerMBean
  +   extends SubDeployerMBean
   {
      ObjectName OBJECT_NAME = 
ObjectNameFactory.create("jboss.j2ee:service=EARDeployer");
   }
  
  
  

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

Reply via email to