Package org.jboss.dependency.spi

Examples of org.jboss.dependency.spi.Controller


   protected void checkDemander(ControllerState state)
   {
      try
      {
         Controller controller = getController();
         ControllerContext context = controller.getContext("demander", state);
         assertNotNull(context);
      }
      catch (Throwable t)
      {
         throw new RuntimeException(t);
View Full Code Here


   protected void afterSetUp() throws Exception
   {
      try
      {
         Controller controller = ((ScopingTestAPIDelegate)getDelegate()).getController();

         ScopeKey sk1 = new ScopeKey(new Scope[]{new Scope(CommonLevels.DEPLOYMENT, "deployment1"), new Scope(CommonLevels.APPLICATION, "testApp")});
         ScopedAliasControllerContext.addAlias("simple", "simple1", sk1, controller);

         ScopeKey sk3 = new ScopeKey(new Scope[]{new Scope(CommonLevels.DEPLOYMENT, "deployment3"), new Scope(CommonLevels.APPLICATION, "testApp")});
         ScopedAliasControllerContext.addAlias("simple", "simple3", sk3, controller);

         controller.addAlias("simple", "simple-main");
      }
      catch (Throwable t)
      {
         throw new Exception(t);
      }
View Full Code Here

   }

   @Override
   protected void tearDown() throws Exception
   {
      Controller controller = ((ScopingTestAPIDelegate)getDelegate()).getController();

      controller.removeAlias("simple");

      ScopeKey sk1 = new ScopeKey(new Scope[]{new Scope(CommonLevels.DEPLOYMENT, "deployment1"), new Scope(CommonLevels.APPLICATION, "testApp")});
      ScopedAliasControllerContext.removeAlias("simple", sk1, controller);

      ScopeKey sk3 = new ScopeKey(new Scope[]{new Scope(CommonLevels.DEPLOYMENT, "deployment3"), new Scope(CommonLevels.APPLICATION, "testApp")});
View Full Code Here

      return getUtil().getContext(name);
   }

   protected String getControllerId()
   {
      Controller controller = getUtil().getKernel().getController();
      StringBuffer buffer = new StringBuffer();
      buffer.append(controller.getClass().getSimpleName());
      buffer.append("[").append(System.identityHashCode(controller)).append("]");
      return buffer.toString();
   }
View Full Code Here

      setBeanMetaDatas(new BeanMetaData[]{metaData1});
   }

   protected void installAlias() throws Throwable
   {
      Controller controller = getUtil().getKernel().getController();
      controller.addAlias("MyAlias", "OriginalBean");
   }
View Full Code Here

   public DelegateLoader createLazyDelegateLoader(Domain domain, RequirementDependencyItem item)
   {
      ControllerContext context = getControllerContext();
      if (context == null)
         throw new IllegalStateException("No controller context");
      Controller controller = context.getController();
        
      DynamicClassLoaderPolicyFactory factory = new DynamicClassLoaderPolicyFactory(controller, domain, item);
      return new LazyFilteredDelegateLoader(factory);
   }
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

   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

      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

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.