User: tobyallsopp
  Date: 01/04/14 22:41:21

  Modified:    src/main/org/jboss/deployment DeployerMBean.java
                        DeploymentException.java J2eeDeployer.java
                        J2eeDeployerMBean.java J2eeDeploymentException.java
  Log:
  Modified AutoDeployer so that it can be configured to deploy RARs (inspired
  by Patch #415321 from David Jencks).
  
   - added jboss-deployer target to build.xml that builds
     dist/external/jboss-deployer.jar which contains the classes required by
     deployers that implement org.jboss.deployment.DeployerMBean.
   - added a method to DeployerMBean: getDeployableFilter that returns a
     java.io.FilenameFilter that AutoDeployer uses to decide what it can deploy
     rather than using a hardcoded list of filename extensions.
   - made J2eeDeployerMBean extend DeployerMBean and added an implementation
     of getDeployableFilter to J2eeDeployer.
   - updated JBossCX jar so that RARDeployer implements getDeployableFilter.
   - added an AutoDeployer watching deploy/lib and using RARDeployer to
     jboss.jcml.
   - changed the JBossCX examples in jboss.jcml to use the Minerva resource
     adapters bundled with JBoss instead of the BlackBox adapters.
   - temporarily removed the Minerva XA resource adapter until Aaron fixes it.
   - some minor cosmetic changesto jboss.jcml.
  
  Revision  Changes    Path
  1.2       +13 -1     jboss/src/main/org/jboss/deployment/DeployerMBean.java
  
  Index: DeployerMBean.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/DeployerMBean.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DeployerMBean.java        2001/01/15 05:06:54     1.1
  +++ DeployerMBean.java        2001/04/15 05:41:21     1.2
  @@ -7,6 +7,7 @@
   package org.jboss.deployment;
   
   import java.io.IOException;
  +import java.io.FilenameFilter;
   import java.net.MalformedURLException;
   
   import org.jboss.util.ServiceMBean;
  @@ -16,7 +17,7 @@
    *   components.
    *
    *   @author Toby Allsopp ([EMAIL PROTECTED])
  - *   @version $Revision: 1.1 $
  + *   @version $Revision: 1.2 $
    */
   public interface DeployerMBean
      extends ServiceMBean
  @@ -24,6 +25,17 @@
      // Constants -----------------------------------------------------
       
      // Public --------------------------------------------------------
  +   
  +   /**
  +    * Provides a filter that decides whether a file can be deployed by
  +    * this deployer based on the filename.  This is for the benefit of
  +    * the {@link org.jboss.ejb.AutoDeployer} service.
  +    *
  +    * @return a <code>FilenameFilter</code> that only
  +    *         <code>accept</code>s files with names that can be
  +    *         deployed by this deployer
  +    */
  +   FilenameFilter getDeployableFilter();
      
      void deploy (String url)
         throws MalformedURLException, IOException, DeploymentException;
  
  
  
  1.2       +6 -7      jboss/src/main/org/jboss/deployment/DeploymentException.java
  
  Index: DeploymentException.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/deployment/DeploymentException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DeploymentException.java  2001/01/15 05:06:54     1.1
  +++ DeploymentException.java  2001/04/15 05:41:21     1.2
  @@ -11,9 +11,8 @@
    *   deployed.
    *
    *   @see DeployerMBean
  - *   @author Rickard Öberg ([EMAIL PROTECTED])
    *   @author Toby Allsopp ([EMAIL PROTECTED])
  - *   @version $Revision: 1.1 $
  + *   @version $Revision: 1.2 $
    */
   public class DeploymentException
      extends Exception
  @@ -21,7 +20,7 @@
      // Attributes ----------------------------------------------------
   
      /** The root cause of this exception */
  -   protected Exception cause;
  +   protected Throwable cause;
      
      // Static --------------------------------------------------------
   
  @@ -32,20 +31,20 @@
         super(message);
      }
      
  -   public DeploymentException(String message, Exception e)
  +   public DeploymentException(String message, Throwable cause)
      {
         super(message);
         
  -      cause = e;
  +      this.cause = cause;
      }
      
      // Public --------------------------------------------------------
   
  -   public Exception getCause() { return cause; }
  +   public Throwable getCause() { return cause; }
      
      public String toString()
      {
         return cause == null ? super.toString()
  -         : super.toString()+", Cause: "+cause;
  +         : super.toString() + ", Cause: " + cause;
      }
   }
  
  
  
  1.21      +20 -2     jboss/src/main/org/jboss/deployment/J2eeDeployer.java
  
  Index: J2eeDeployer.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/J2eeDeployer.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- J2eeDeployer.java 2001/02/27 21:13:22     1.20
  +++ J2eeDeployer.java 2001/04/15 05:41:21     1.21
  @@ -13,6 +13,7 @@
   import java.io.ObjectInputStream;
   import java.io.ObjectOutputStream;
   import java.io.FileInputStream;
  +import java.io.FilenameFilter;
   import java.io.InputStream;
   import java.io.OutputStream;
   import java.io.FileOutputStream;
  @@ -65,7 +66,8 @@
   *  (ContainerFactory for JBoss and EmbededTomcatService for Tomcat).
   *
   *   @author <a href="mailto:[EMAIL PROTECTED]">Daniel Schulze</a>
  -*   @version $Revision: 1.20 $
  +*   @author Toby Allsopp ([EMAIL PROTECTED])
  +*   @version $Revision: 1.21 $
   */
   public class J2eeDeployer 
   extends ServiceMBeanSupport
  @@ -146,8 +148,24 @@
      {
         return warDeployerName;
      }
  -   
  +
      // Public --------------------------------------------------------
  +
  +   public FilenameFilter getDeployableFilter()
  +   {
  +      return new FilenameFilter()
  +         {
  +            public boolean accept(File dir, String filename)
  +            {
  +               return
  +                  filename.endsWith(".jar") ||
  +                  filename.endsWith(".war") ||
  +                  filename.endsWith(".ear") ||
  +                  filename.endsWith(".zip");
  +            }
  +         };
  +   }
  +   
      /** Deploys the given URL independent if it is a EJB.jar, Web.war
      *   or Application.ear. In case of already deployed, it performes a
      *   redeploy.
  
  
  
  1.4       +3 -8      jboss/src/main/org/jboss/deployment/J2eeDeployerMBean.java
  
  Index: J2eeDeployerMBean.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/J2eeDeployerMBean.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- J2eeDeployerMBean.java    2000/12/07 15:44:07     1.3
  +++ J2eeDeployerMBean.java    2001/04/15 05:41:21     1.4
  @@ -14,10 +14,11 @@
   /**
    *   @see 
    *   @author Daniel Schulze ([EMAIL PROTECTED])
  - *   @version $Revision: 1.3 $
  + *   @author Toby Allsopp ([EMAIL PROTECTED])
  + *   @version $Revision: 1.4 $
    */
   public interface J2eeDeployerMBean
  -     extends ServiceMBean
  +   extends DeployerMBean
   {
      // Constants -----------------------------------------------------
      public static final String OBJECT_NAME = "J2EE:service=J2eeDeployer";
  @@ -31,10 +32,4 @@
      
      public void setWarDeployerName(String warDeployerName);
      public String getWarDeployerName();
  -   
  -   public void deploy (String url) throws MalformedURLException, IOException, 
J2eeDeploymentException;
  -
  -   public void undeploy (String url) throws MalformedURLException, IOException, 
J2eeDeploymentException;
  -
  -   public boolean isDeployed (String url) throws MalformedURLException, 
J2eeDeploymentException;
   }
  
  
  
  1.4       +7 -13     jboss/src/main/org/jboss/deployment/J2eeDeploymentException.java
  
  Index: J2eeDeploymentException.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/deployment/J2eeDeploymentException.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- J2eeDeploymentException.java      2001/02/08 22:18:44     1.3
  +++ J2eeDeploymentException.java      2001/04/15 05:41:21     1.4
  @@ -7,16 +7,16 @@
   package org.jboss.deployment;
   
   /**
  - *   <description> 
  + * Exception thrown by {@link org.jboss.deployment.J2eeDeployer} on
  + * deployment problems.
    *      
  - *   @author Daniel Schulze [EMAIL PROTECTED]
  - *   @version $Revision: 1.3 $
  + * @author Daniel Schulze [EMAIL PROTECTED]
  + * @author Toby Allsopp ([EMAIL PROTECTED])
  + * @version $Revision: 1.4 $
    */
   public class J2eeDeploymentException 
  -     extends Exception
  +   extends DeploymentException
   {
  -    Throwable exception;
  -
       // Constructors --------------------------------------------------
       public J2eeDeploymentException (String message)
       {
  @@ -24,14 +24,8 @@
       }
   
       public J2eeDeploymentException (String message, Throwable e)
  -    {
  -        super (message);
  -        this.exception = e;
  -    }
  -
  -    public Throwable getException()
       {
  -        return exception;
  +        super (message, e);
       }
   }
   
  
  
  

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

Reply via email to