[jboss-cvs] system2/src/main/org/jboss/deployers/plugins/bean ...

Scott Stark scott.stark at jboss.com
Tue Jul 11 09:34:38 EDT 2006


  User: starksm 
  Date: 06/07/11 09:34:38

  Modified:    src/main/org/jboss/deployers/plugins/bean  BeanDeployer.java
  Log:
  Add the beans deployment type to recognized DeploymentContexts
  
  Revision  Changes    Path
  1.5       +38 -12    system2/src/main/org/jboss/deployers/plugins/bean/BeanDeployer.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BeanDeployer.java
  ===================================================================
  RCS file: /cvsroot/jboss/system2/src/main/org/jboss/deployers/plugins/bean/BeanDeployer.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- BeanDeployer.java	30 Jun 2006 21:02:47 -0000	1.4
  +++ BeanDeployer.java	11 Jul 2006 13:34:38 -0000	1.5
  @@ -21,17 +21,21 @@
    */
   package org.jboss.deployers.plugins.bean;
   
  +import java.io.IOException;
  +
   import org.jboss.deployers.plugins.AbstractAspectDeployer;
   import org.jboss.deployers.plugins.DeployerConstants;
   import org.jboss.deployers.spi.DeploymentContext;
   import org.jboss.deployers.spi.DeploymentException;
  -import org.jboss.deployers.vdf.spi.VDFComponent;
  -import org.jboss.vfs.spi.ReadOnlyVFS;
  +import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer;
  +import org.jboss.vfs.spi.VirtualFile;
  +
   /**
    * MC Bean deployer
    * 
    * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
  - * @version $Revision: 1.4 $
  + * @author Scott.Stark at jboss.org
  + * @version $Revision: 1.5 $
    */
   public class BeanDeployer extends AbstractAspectDeployer
   {
  @@ -40,8 +44,11 @@
      /** The suffixes this deployer handles */
      public static String[] ENHANCED_SUFFIXES =
         { DeployerConstants.BEAN_ENHANCED_SUFFIX, DeployerConstants.BEAN_XML_ENHANCED_SUFFIX };
  +   public static String JAR_DESCRIPTOR = "META-INF/jboss-beans.xml";
      
      // Private -------------------------------------------------------
  +   /** The kernel deployer used to process the beans descriptor */
  +   protected BasicXMLDeployer kernelDeployer;
      
      // Constructors --------------------------------------------------
      
  @@ -61,24 +68,35 @@
      }
   
      /**
  -    * Analyze .bean, -bean.xml deployments
  +    * Analyze .beans, -beans.xml deployments
       */
      public boolean analyze(DeploymentContext ctx) throws DeploymentException
      {
  +      boolean isBeanDeployment = false;
         String basename = ctx.getFile().getName();
  +      VirtualFile vf = ctx.getFile();
   
         if (endsWithOneOfTheSuffixes(basename))
         {
  -         if (basename.endsWith(".bean"))
  +         isBeanDeployment = true;
  +         try
            {
  +            // If the context contains a META-INF/jboss-beans.xml its a beans archive
  +            VirtualFile descriptor = vf.findChild(JAR_DESCRIPTOR);
  +            ctx.getContextData().put(JAR_DESCRIPTOR, Boolean.TRUE);
               // add deployment base to the classpath
               ctx.addClasspathEntry("");
            }
  -         // we analyzed this deployment
  -         return true;
  +         catch(IOException ignore)
  +         {
  +            // The deployment context has no beans descriptor
         }
  +      }
  +
  +      if( isBeanDeployment )
  +         ctx.addDeploymentType(getType());
         // not a .bean, -bean.xml deployment
  -      return false;
  +      return isBeanDeployment;
      }
   
      public Object getManagedObject(DeploymentContext ctx)
  @@ -86,10 +104,18 @@
         return null;
      }
   
  -   public void deploy(DeploymentContext comp) throws DeploymentException
  +   public void deploy(DeploymentContext ctx) throws DeploymentException
  +   {
  +      Boolean jarType = (Boolean) ctx.getContextData().get(JAR_DESCRIPTOR);
  +      if( jarType == Boolean.TRUE )
      {
         
      }
  +      else
  +      {
  +         
  +      }
  +   }
   
      public void redeploy(DeploymentContext comp) throws DeploymentException
      {
  
  
  



More information about the jboss-cvs-commits mailing list