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

Scott Stark scott.stark at jboss.com
Wed Jul 12 05:11:28 EDT 2006


  User: starksm 
  Date: 06/07/12 05:11:28

  Modified:    src/main/org/jboss/deployers/plugins 
                        AbstractAspectDeployer.java
  Log:
  Implement KernelControllerContextAware to allow deployers access to the kernel context
  
  Revision  Changes    Path
  1.5       +44 -18    system2/src/main/org/jboss/deployers/plugins/AbstractAspectDeployer.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: AbstractAspectDeployer.java
  ===================================================================
  RCS file: /cvsroot/jboss/system2/src/main/org/jboss/deployers/plugins/AbstractAspectDeployer.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- AbstractAspectDeployer.java	30 Jun 2006 20:23:06 -0000	1.4
  +++ AbstractAspectDeployer.java	12 Jul 2006 09:11:28 -0000	1.5
  @@ -25,15 +25,21 @@
   import org.jboss.deployers.spi.DeploymentContext;
   import org.jboss.deployers.spi.DeploymentException;
   import org.jboss.deployers.spi.MainDeployer;
  +import org.jboss.kernel.spi.dependency.KernelControllerContext;
  +import org.jboss.kernel.spi.dependency.KernelControllerContextAware;
   import org.jboss.util.JBossObject;
   /**
  - * Abstract base for AspectDeployers
  + * Abstract base for AspectDeployers. This is KernelControllerContextAware to
  + * allow deployers to have access to the kernel and state info.
  + * 
  + * TODO: the suffix ordering notion seems obsolete with the deployer chain
    * 
    * @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 abstract class AbstractAspectDeployer extends JBossObject
  -   implements AspectDeployer
  +   implements AspectDeployer, KernelControllerContextAware
   {
      // Static --------------------------------------------------------
      
  @@ -56,6 +62,8 @@
      
      /** The relative processing order of the deployer, (relative to other deployers) */
      protected int relativeOrder = DeployerConstants.DEFAULT_DEPLOYER_ORDER;
  +   /** The MC kernel context */
  +   protected KernelControllerContext context;
      
      // Constructors --------------------------------------------------
      
  @@ -176,21 +184,23 @@
         return false;
      }
      
  -   // Protected -----------------------------------------------------
  -   
  -   /**
  -    * Check if the supplied string matches one of our suffixes
  -    */
  -   protected boolean endsWithOneOfTheSuffixes(String s)
  -   {
  -      for (int i = 0; i < suffixes.length; i++)
  +   // KernelControllerContextAware implements -----------------------------
  +   public void setKernelControllerContext(KernelControllerContext context)
  +      throws Exception
         {
  -         if (s.endsWith(suffixes[i]))
  -         {
  -            return true;
  +      log.debug("Setting kernel context " + context);
  +      this.context = context;
            }
  +   
  +   public void unsetKernelControllerContext(KernelControllerContext context) throws Exception
  +   {
  +      log.debug("Unsetting kernel context " + context);
  +      this.context = null;
         }
  -      return false;
  +
  +   public KernelControllerContext getKernelContext()
  +   {
  +      return context;
      }
      
      // Lifecycle overrides -------------------------------------------
  @@ -237,4 +247,20 @@
         return false;
      }
      
  +   // Protected -----------------------------------------------------
  +   
  +   /**
  +    * Check if the supplied string matches one of our suffixes
  +    */
  +   protected boolean endsWithOneOfTheSuffixes(String s)
  +   {
  +      for (int i = 0; i < suffixes.length; i++)
  +      {
  +         if (s.endsWith(suffixes[i]))
  +         {
  +            return true;
  +         }
  +      }
  +      return false;
  +   }
   }
  
  
  



More information about the jboss-cvs-commits mailing list