Package org.jboss.dependency.spi

Examples of org.jboss.dependency.spi.Controller


      {
         return null;
      }
      else if (isOptional())
      {
         Controller controller = context.getController();
         addOptionalDependency(controller, lookup);
      }

      Object result;
      if (property != null && property.length() > 0)
View Full Code Here


    * @param state the state
    * @return the controller context
    */
   protected ControllerContext getControllerContext(Object name, ControllerState state)
   {
      Controller controller = context.getController();
      LookupStrategy strategy = search.getStrategy();
      return strategy.getContext(controller, name, state);
   }
View Full Code Here

      {
         return null;
      }
      else if (isOptional())
      {
         Controller controller = context.getController();
         addOptionalDependency(controller, lookup);
      }

      Object result;
      if (property != null && property.length() > 0)
View Full Code Here

      if (propertyName != null && beanName != null)
      {
         Object result = null;
         try
         {
            Controller controller = context.getController();
            ControllerContext context = controller.getContext(beanName, ControllerState.INSTANTIATED);
            if (context != null && context instanceof AttributeDispatchContext)
            {
               Object target = context.getTarget();
               if (target != null)
               {
View Full Code Here

      if (fromContext != null)
      {
         ControllerState state = dependentState;
         if (state == null)
            state = ControllerState.INSTANTIATED;
         Controller controller = context.getController();
         ControllerContext lookup = controller.getContext(getUnderlyingValue(), state);
         if (lookup == null)
            throw new Error("Should not be here - dependency failed - " + this);
         return fromContext.executeLookup(lookup);
      }

      // by class type
      if (getUnderlyingValue() == null)
      {
         Controller controller = context.getController();
         ControllerContext lookup = controller.getInstalledContext(info.getType());
         if (lookup == null)
         {
            if (InjectionOption.STRICT.equals(injectionOption))
            {
               throw new IllegalArgumentException("Possible multiple matching beans, see log for info.");
View Full Code Here

            ControllerState when = whenRequiredState;
            if (when == null)
               when = visitor.getContextState();

            KernelControllerContext kcc = visitor.getControllerContext();
            Controller controller = kcc.getController();
            List<ControllerState> states = controller.getStates();
            int whenIndex = states.indexOf(when);

            if (dependentState == null)
            {
               dependentState = states.get(whenIndex - 1);
View Full Code Here

   {
   }
  
   public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable
   {
      Controller controller = context.getController();
      ControllerContext context = controller.getContext(getUnderlyingValue(), ControllerState.INSTANTIATED);
      if (context == null)
         throw new Error("Could not deference this " + this);
      // TODO - add progression, see BeanMetaData, InjectionMetaData
      return context.getTarget();
   }
View Full Code Here

   public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable
   {
      ControllerState state = dependentState;
      if (state == null)
         state = ControllerState.INSTALLED;
      Controller controller = context.getController();
      ControllerContext lookup = controller.getContext(getUnderlyingValue(), state);

      if (isLookupValid(lookup) == false)
         throw new Error("Should not be here - dependency failed - " + this);

      if (lookup == null)
View Full Code Here

    * @return  kernel controller context
    * @throws IllegalArgumentException if context not found or not KernelControllerContext
    */
   protected KernelControllerContext getKernelControllerContext(Kernel kernel, String bean)
   {
      Controller controller = kernel.getController();
      ControllerContext context = controller.getContext(bean, ControllerState.DESCRIBED);
      if (context == null)
         throw new IllegalArgumentException("Should not be here, dependency failed.");
      if (context instanceof KernelControllerContext == false)
         throw new IllegalArgumentException("Context not KernelControllerContext: " + context);
      return KernelControllerContext.class.cast(context);
View Full Code Here

   }

   @SuppressWarnings("unchecked")
   public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable
   {
      Controller controller = context.getController();
      ControllerContext lookup = controller.getInstalledContext(name);
      if (lookup == null || lookup.getTarget() == null)
      {
         // possible call for classloader
         if (info == null && classLoader != null && classLoader.getClassLoader() == this)
         {
View Full Code Here

TOP

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

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.