Package org.jboss.dependency.spi

Examples of org.jboss.dependency.spi.DependencyInfo


   protected void removeDependsOnMe(RequirementDependencyItem item)
   {
      if (context == null)
         return;
     
      DependencyInfo dependencyInfo = context.getDependencyInfo();
      dependencyInfo.removeDependsOnMe(item);
   }
View Full Code Here


   private void enableLazyShutdown()
   {
      ControllerContext ctx = getControllerContext();
      if (ctx != null)
      {
         DependencyInfo info = ctx.getDependencyInfo();
         if (info != null)
         {
            Set<DependencyItem> items = info.getDependsOnMe(RequirementDependencyItem.class);
            if (items != null && items.isEmpty() == false)
            {
               for (DependencyItem item : items)
                  info.removeDependsOnMe(item);
            }
         }
      }
   }
View Full Code Here

      }
      catch(Throwable t)
      {
         assertUnsupported(t);
      }
      DependencyInfo dependencyInfo = realCtx.getDependencyInfo();
      assertNotNull(dependencyInfo);
      try
      {
         dependencyInfo.addIDependOn(new AbstractDependencyItem());
      }
      catch(Throwable t)
      {
         assertUnsupported(t);
      }
View Full Code Here

      super(SuperDemand.class);
   }

   protected List<? extends MetaDataVisitorNode> internalApplyAnnotation(ClassInfo info, MetaData retrieval, SuperDemand annotation, KernelControllerContext context) throws Throwable
   {
      DependencyInfo di = context.getDependencyInfo();
      DependencyItem item = new AbstractDependencyItem(context.getName(), annotation.demand(), new ControllerState(annotation.whenRequired()), new ControllerState(annotation.dependentState()));
      di.addIDependOn(item);
      return null;
   }
View Full Code Here

   {
      Dependency dependency = annotation.annotationType().getAnnotation(Dependency.class);
      if (dependency == null)
         throw new IllegalArgumentException("Null @Dependency.");

      DependencyInfo dependencies = context.getDependencyInfo();

      SecurityDomainDependencyFactory factory = null;
      // try to find existing security domain dependency factory
      // or what ever kind of lookup
      KernelController controller = context.getKernel().getController();
      ControllerContext smCC = controller.getInstalledContext(annotation.securityManagerName());
      if (smCC != null)
      {
         Object target = smCC.getTarget();
         if (target != null && target instanceof SecurityDomainDependencyFactory)
            factory = SecurityDomainDependencyFactory.class.cast(target);
      }

      if (factory == null)
         factory = (SecurityDomainDependencyFactory)dependency.factory().newInstance();

      DependencyItem item = factory.createDependencyItem(annotation, dependency);
      dependencies.addIDependOn(item);

      return null;
   }
View Full Code Here

   {
      ControllerContext context = controller.getContext(name, null);
      if (context == null)
         throw new IllegalArgumentException("Cannot find context: " + name);
     
      DependencyInfo di = context.getDependencyInfo();
      DependencyItem item = new AbstractDependencyItem(context.getName(), demand, new ControllerState(whenRequired), new ControllerState(dependentState));
      di.addIDependOn(item);
   }
View Full Code Here

      ControllerState dependent = null;
      if (dependentState != null)
         dependent = new ControllerState(dependentState);
     
      DependencyInfo di = targetControllerContext.getDependencyInfo();
      for (Object dependency : dependencies)
      {
         DependencyItem item = new AbstractDependencyItem(targetName, dependency, whenRequired, dependent);
         di.addIDependOn(item);
      }
   }
View Full Code Here

      {
         Object object = context.getTarget();
         if (object != null)
         {
            KernelController controller = (KernelController) context.getController();
            DependencyInfo dependencyInfo = context.getDependencyInfo();
            if (dependencyInfo != null && dependencyInfo.isAutowireCandidate())
               controller.removeInstantiatedContext(context);
         }
      }
      catch (Throwable ignored)
      {
View Full Code Here

      return accessContext;
   }

   private void removeClassContextReference()
   {
      DependencyInfo dependencyInfo = getDependencyInfo();
      if (dependencyInfo != null)
      {
         // remove all dependency items that hold class ref
         Set<DependencyItem> dependencys = dependencyInfo.getIDependOn(ClassContextDependencyItem.class);
         dependencys.addAll(dependencyInfo.getIDependOn(CallbackDependencyItem.class));
         for (DependencyItem di : dependencys)
         {
            // can cast because of getIDepend method impl
            ClassDependencyItem cdi = (ClassDependencyItem)di;
            cdi.clear(getController());
View Full Code Here

            // handle custom annotations
            applyAnnotations(context);
         }

         DependencyInfo dependencyInfo = context.getDependencyInfo();
         if (dependencyInfo != null && dependencyInfo.isAutowireCandidate())
            controller.addInstantiatedContext(context);
      }
      catch (Throwable t)
      {
         uninstall(context);
View Full Code Here

TOP

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

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.