Examples of DependencyInfo


Examples of org.jboss.dependency.spi.DependencyInfo

      String alias = "test:name=ZName,attrib=Foo";
      ObjectName jmxName = ObjectName.getInstance(alias);
      String canonical = jmxName.getCanonicalName();
      // add original with dependency
      ControllerContext original = createControllerContext("Test1");
      DependencyInfo info = original.getDependencyInfo();
      info.addIDependOn(new AbstractDependencyItem("Test1", alias, ControllerState.CONFIGURED, null));
      assertInstall(original, ControllerState.INSTANTIATED);
      try
      {
         // create dependency resolver
         ControllerContext dependant = assertCreateInstall(canonical);
View Full Code Here

Examples of org.jboss.dependency.spi.DependencyInfo

   @Override
   public void addDependency(KernelControllerContext context)
   {
      AbstractLifecycleCallbackItem callback = new AbstractLifecycleCallbackItem(dependencyName, state, ControllerState.INSTALLED, installMethod, uninstallMethod);
      DependencyInfo di = context.getDependencyInfo();
      di.addLifecycleCallback(callback);

      super.addDependency(context);
   }
View Full Code Here

Examples of org.jboss.dependency.spi.DependencyInfo

   }
  
   @Override
   public void removeDependency(KernelControllerContext context)
   {
      DependencyInfo di = context.getDependencyInfo();
     
      List<LifecycleCallbackItem> items = di.getLifecycleCallbacks();
      for (int i = 0 ; i < items.size(); i++)
      {
         try
         {
            if (items.get(i).getBean().equals(dependencyName))
View Full Code Here

Examples of org.jboss.dependency.spi.DependencyInfo

  
   public void addDependency(KernelControllerContext context)
   {
      BeanMetaData metaData = context.getBeanMetaData();
      DependencyItem dependencyItem = new AbstractDependencyItem(metaData.getName(), dependencyName, ControllerState.INSTANTIATED, ControllerState.INSTALLED);
      DependencyInfo depends = context.getDependencyInfo();
      depends.addIDependOn(dependencyItem);
   }
View Full Code Here

Examples of org.jboss.dependency.spi.DependencyInfo

      depends.addIDependOn(dependencyItem);
   }
  
   public void removeDependency(KernelControllerContext context)
   {
      DependencyInfo depends = context.getDependencyInfo();

      Set<DependencyItem> items = depends.getIDependOn(null);
      if (items.size() > 0)
      {
         for (DependencyItem item : items)
         {
            try
            {
               Object iDependOn = item.getIDependOn();
               if (iDependOn != null && iDependOn.equals(dependencyName))
               {
                  depends.removeIDependOn(item);
               }
            }
            catch (RuntimeException e)
            {
               log.warn("Problem uninstalling dependency " + dependencyName + " for " + context, e);
View Full Code Here

Examples of org.jboss.dependency.spi.DependencyInfo

      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

Examples of org.jboss.dependency.spi.DependencyInfo

               buffer.append("\nDEPLOYMENTS MISSING DEPENDENCIES:\n");
               for (ControllerContext ctx : incomplete)
               {
                  Object name = ctx.getName();
                  buffer.append(String.format("  Deployment \"%s\" is missing the following dependencies:\n", name));
                  DependencyInfo dependsInfo = ctx.getDependencyInfo();
                  Set<DependencyItem> depends = dependsInfo.getIDependOn(null);
                  for (DependencyItem item : depends)
                  {
                     ControllerState dependentState = item.getDependentState();
                     if (dependentState == null)
                        dependentState = ControllerState.INSTALLED;
View Full Code Here

Examples of org.jboss.dependency.spi.DependencyInfo

      return ElementType.METHOD == type;
   }

   protected boolean isMetaDataAlreadyPresent(T info, C annotation, KernelControllerContext context)
   {
      DependencyInfo dependency = context.getDependencyInfo();
      Set<CallbackItem<?>> callbacks = getCallbacks(dependency);
      if (callbacks != null && callbacks.isEmpty() == false)
      {
         for(CallbackItem<?> ci : callbacks)
         {
View Full Code Here

Examples of org.jboss.dependency.spi.DependencyInfo

            // 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

Examples of org.jboss.dependency.spi.DependencyInfo

   protected void uninstallActionInternal(KernelControllerContext context)
   {
      try
      {
         KernelController controller = (KernelController)context.getController();
         DependencyInfo dependencyInfo = context.getDependencyInfo();
         if (dependencyInfo != null && dependencyInfo.isAutowireCandidate())
            controller.removeInstantiatedContext(context);
      }
      catch (Throwable ignored)
      {
         log.debug("Ignored error unsetting context ", ignored);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.