Package org.jboss.dependency.spi

Examples of org.jboss.dependency.spi.Controller


            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


      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

    * @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", "deprecation"})
   public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable
   {
      if (context == null)
         throw new IllegalStateException("Context has not been set: " + this);
      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

      if (contextName.equals(context.getName()) == false)
      {
         Set<Object> aliases = context.getAliases();
         if (aliases == null || (aliases.contains(contextName) == false))
         {
            Controller controller = context.getController();
            if (addAlias)
            {
               try
               {
                  controller.addAlias(contextName, context.getName());
               }
               catch (Throwable t)
               {
                  throw new RuntimeException("Error adding deployment alias " + contextName + " to " + context, t);
               }
            }
            else
            {
               controller.removeAlias(contextName);
            }
         }
      }
     
      return contextName;
View Full Code Here

    * @param ctx the context
    */
   private void safelyRemoveAnyRegisteredContext(ServiceControllerContext ctx)
   {
      // First the context must have a controller
      Controller controller = ctx.getController();
      if (controller != null)
      {
         // The name must be registered and it must be our context
         Object name = ctx.getName();
         ControllerContext registered = controller.getContext(name, null);
         if (registered == ctx)
            controller.uninstall(name);
      }
   }
View Full Code Here

      jbossInternalDestroy();
   }

   protected void pojoChange(ControllerState state)
   {
      Controller controller = controllerContext.getController();
      try
      {
         controller.change(controllerContext, state);
      }
      catch (RuntimeException e)
      {
         throw e;
      }
View Full Code Here

   {
      String id = createId(context, info, jmx);
      if (log.isTraceEnabled())
         log.trace("Removing " + context.getName() + "." + getName(info) + " via id: " + id);

      Controller controller = context.getController();
      controller.uninstall(id);
   }
View Full Code Here

   public void install(ControllerContext ctx) throws Exception
   {
      log.trace("Invoking install callback '" + installMethod + "' on " + bean + " for target " + bean + " at " + whenRequired);
      installed = true;
      Controller controller = ctx.getController();
      ControllerContext callbackContext = controller.getContext(bean, dependentState);
      if (callbackContext instanceof InvokeDispatchContext)
      {
         try
         {
            ((InvokeDispatchContext)callbackContext).invoke(installMethod, new Object[]{ctx}, new String[]{ControllerContext.class.getName()});
View Full Code Here

   {
      if (installed)
      {
         log.trace("Invoking uninstall callback '" + installMethod + "' on " + bean + " for target " + bean + " at " + whenRequired);
         installed = false;
         Controller controller = ctx.getController();
         ControllerContext callbackContext = controller.getContext(bean, dependentState);
         if (callbackContext instanceof InvokeDispatchContext)
         {
            try
            {
               ((InvokeDispatchContext)callbackContext).invoke(uninstallMethod, new Object[]{ctx}, new String[]{ControllerContext.class.getName()});
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.