Package org.jboss.dependency.spi

Examples of org.jboss.dependency.spi.ControllerMode


               if ("name".equals(localName))
                  bean.setName(attrs.getValue(i));
               else if ("class".equals(localName))
                  bean.setBean(attrs.getValue(i));
               else if ("mode".equals(localName))
                  bean.setMode(new ControllerMode(attrs.getValue(i)));
            }
         }
      });

      // beanfactory binding
      TypeBinding beanFactoryType = schemaBinding.getType(beanFactoryTypeQName);
      beanFactoryType.setHandler(new DefaultElementHandler()
      {
         public Object startElement(Object parent, QName name, ElementBinding element)
         {
            return new GenericBeanFactoryMetaData();
         }

         public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx)
         {
            GenericBeanFactoryMetaData bean = (GenericBeanFactoryMetaData) o;
            for (int i = 0; i < attrs.getLength(); ++i)
            {
               String localName = attrs.getLocalName(i);
               if ("name".equals(localName))
                  bean.setName(attrs.getValue(i));
               else if ("class".equals(localName))
                  bean.setBeanClass(attrs.getValue(i));
               else if ("mode".equals(localName))
                  bean.setMode(new ControllerMode(attrs.getValue(i)));
            }
         }
      });

      // bean has a classloader
View Full Code Here


   public AbstractKernelControllerContext(BeanInfo info, BeanMetaData metaData, Object target)
   {
      super(metaData.getName(), KernelControllerContextActions.getInstance(), new AbstractDependencyInfo(), target);
      this.info = info;
      this.metaData = metaData;
      ControllerMode mode = metaData.getMode();
      if (mode != null)
         setMode(mode);
      if (System.getSecurityManager() != null)
         accessContext = AccessController.getContext();
   }
View Full Code Here

    * @param context the context
    * @return true when we should advance the context
    */
   protected boolean advance(ControllerContext context)
   {
      ControllerMode mode = context.getMode();
     
      // Never advance for disabled
      if (ControllerMode.DISABLED.equals(mode))
         return false;
     
View Full Code Here

    * @param context the context
    * @return true when we should advance the context
    */
   protected boolean advance(ControllerContext context)
   {
      ControllerMode mode = context.getMode();

      // Never advance for disabled
      if (ControllerMode.DISABLED.equals(mode))
         return false;

View Full Code Here

   public AbstractKernelControllerContext(BeanInfo info, BeanMetaData metaData, Object target)
   {
      super(metaData.getName(), determineAliases(metaData), target == null ? actions : noInstantiate, new AbstractDependencyInfo(), target);
      this.info = info;
      this.metaData = metaData;
      ControllerMode mode = metaData.getMode();
      if (mode != null)
         setMode(mode);
      ErrorHandlingMode errorHandlingMode = metaData.getErrorHandlingMode();
      if (errorHandlingMode != null)
         setErrorHandlingMode(errorHandlingMode);
View Full Code Here

                  throw new IllegalStateException(alias + " an alias of " + name + " is already installed.");
            }
         }

         // set the required state
         ControllerMode mode = context.getMode();
         context.setRequiredState(mode.getRequiredState());

         if (trace)
            log.trace("Installing " + context.toShortString());

         context.setController(this);
View Full Code Here

    * @param context the context
    * @return true when we should advance the context
    */
   protected boolean advance(ControllerContext context)
   {
      ControllerMode mode = context.getMode();

      // Never advance for disabled
      if (ControllerMode.DISABLED.equals(mode))
         return false;

View Full Code Here

            if (context == null)
               throw new IllegalArgumentException("No such context: " + bean);

            if (ControllerState.INSTALLED.equals(context.getState()) == false)
            {
               ControllerMode mode = context.getMode();
               if (ControllerMode.ON_DEMAND.equals(mode) || ControllerMode.MANUAL.equals(mode))
               {
                  controller.change(context, ControllerState.INSTALLED);
               }
            }
View Full Code Here

   public AbstractKernelControllerContext(BeanInfo info, BeanMetaData metaData, Object target)
   {
      super(metaData.getName(), determineAliases(metaData), target == null ? actions : noInstantiate, new AbstractDependencyInfo(), target);
      this.info = info;
      this.metaData = metaData;
      ControllerMode mode = metaData.getMode();
      if (mode != null)
         setMode(mode);
      ErrorHandlingMode errorHandlingMode = metaData.getErrorHandlingMode();
      if (errorHandlingMode != null)
         setErrorHandlingMode(errorHandlingMode);
View Full Code Here

   public void testDeploymentWithMode() throws Exception
   {
      AbstractKernelDeployment deployment = unmarshalDeployment("DeploymentWithMode.xml");

      ControllerMode mode = deployment.getMode();
      assertNotNull(mode);
      assertEquals(ControllerMode.ON_DEMAND, mode);

      List<BeanMetaData> beans = deployment.getBeans();
      assertNotNull(beans);
View Full Code Here

TOP

Related Classes of org.jboss.dependency.spi.ControllerMode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.