Package org.jboss.dependency.spi

Examples of org.jboss.dependency.spi.ControllerState


      if (isAttributePresent(annotation.bean()))
         injection.setValue(annotation.bean());
      if (isAttributePresent(annotation.property()))
         injection.setProperty(annotation.property());
      if (isAttributePresent(annotation.dependentState()))
         injection.setDependentState(new ControllerState(annotation.dependentState()));
      if (isAttributePresent(annotation.whenRequired()))
         injection.setWhenRequiredState(new ControllerState(annotation.whenRequired()));
      if (isAttributePresent(annotation.search()))
         injection.setSearch(org.jboss.dependency.plugins.graph.Search.getInstance(annotation.search()));
      injection.setInjectionOption(annotation.option());
      injection.setInjectionType(annotation.type());
      if (FromContext.NOOP.equals(annotation.fromContext()) == false)
View Full Code Here


               apmd.setType(parameter.type().getName());
            parameters.add(apmd);
         }
      }
      factory.setParameters(parameters);
      factory.setDependentState(new ControllerState(annotation.dependantState()));
      factory.setWhenRequiredState(new ControllerState(annotation.whenRequiredState()));
      return factory;
   }
View Full Code Here

   @SuppressWarnings("deprecation")
   static ValueMetaData createValueMetaData(Search annotation)
   {
      String searchType = annotation.type();
      SearchInfo type = org.jboss.dependency.plugins.graph.Search.getInstance(searchType);
      ControllerState state = null;
      if (isAttributePresent(annotation.dependentState()))
         state = new ControllerState(annotation.dependentState());
      String property = null;
      if (isAttributePresent(annotation.property()))
         property = annotation.property();

      return new AbstractSearchValueMetaData(
View Full Code Here

                  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;
                    
                     ControllerState otherState = null;
                     ControllerContext other = null;
                     Object iDependOn = item.getIDependOn();

                     if (name.equals(iDependOn) == false)
                     {
                        if (iDependOn != null)
                        {
                           other = controller.getContext(iDependOn, null);
                           if (other != null)
                              otherState = other.getState();
                        }

                        boolean print = true;
                        if (otherState != null && otherState.equals(ControllerState.ERROR) == false)
                        {
                           ControllerStateModel states = controller.getStates();
                           if (states.isBeforeState(otherState, dependentState) == false)
                              print = false;
                        }

                        if (print)
                        {
                           buffer.append(String.format("    Dependency \"%s\" (should be in state \"%s\", but is actually %s)\n",
                                   iDependOn,
                                   dependentState.getStateString(),
                                   iDependOn == null ?
                                           String.format("unresolved (%s)",
                                           item.toHumanReadableString()) :
                                           other == null ?
                                                   "not found" :
                                                   String.format("in state \"%s\"", otherState.getStateString())));
                        }
                     }
                  }
               }
            }
View Full Code Here

      context = visitor.getControllerContext();
      Object name = context.getName();
      Object iDependOn = getUnderlyingValue();

      ControllerState whenRequired = whenRequiredState;
      if (whenRequired == null)
      {
         whenRequired = visitor.getContextState();
      }
      ControllerState state = dependentState;
      if (state == null)
      {
         state = ControllerState.INSTALLED;
      }
View Full Code Here

      return null;
   }

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

   public void initialVisit(MetaDataVisitor visitor)
   {
      context = visitor.getControllerContext();
      setValue(context.getName());
      ControllerState whenRequired = visitor.getContextState();

      DependencyItem item = new AbstractDependencyItem(getUnderlyingValue(), getUnderlyingValue(), whenRequired, ControllerState.INSTANTIATED);
      visitor.addDependency(item);

      super.initialVisit(visitor);
View Full Code Here

   }

   protected AbstractCallbackMetaData createCallback(T info, Install annotation)
   {
      InstallCallbackMetaData callback = new InstallCallbackMetaData();
      callback.setState(new ControllerState(annotation.whenRequired()));
      callback.setDependentState(new ControllerState(annotation.dependentState()));
      if (isAttributePresent(annotation.cardinality()))
         callback.setCardinality(Cardinality.fromString(annotation.cardinality()));
      applyInfo(callback, info);
      return callback;
   }
View Full Code Here

   {
      AbstractInstallMetaData installMetaData = new AbstractInstallMetaData();
      installMetaData.setBean(install.bean());
      installMetaData.setMethodName(install.method());
      if (isAttributePresent(install.whenRequired()))
         installMetaData.setState(new ControllerState(install.whenRequired()));
      if (isAttributePresent(install.dependantState()))
         installMetaData.setDependentState(new ControllerState(install.dependantState()));
      for (Value value : install.parameters())
      {
         List<ParameterMetaData> parameters = installMetaData.getParameters();
         if (parameters == null)
         {
View Full Code Here

   }

   protected AbstractCallbackMetaData createCallback(T info, Uninstall annotation)
   {
      UninstallCallbackMetaData callback = new UninstallCallbackMetaData();
      callback.setState(new ControllerState(annotation.whenRequired()));
      callback.setDependentState(new ControllerState(annotation.dependentState()));
      if (isAttributePresent(annotation.cardinality()))
         callback.setCardinality(Cardinality.fromString(annotation.cardinality()));
      applyInfo(callback, info);
      return callback;
   }
View Full Code Here

TOP

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

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.