Package org.jboss.kernel.spi.dependency

Examples of org.jboss.kernel.spi.dependency.KernelControllerContext


         getBean(name);
         fail("'" + name + "' should not be installed yet");
      }
      catch (IllegalStateException expected)
      {
         KernelControllerContext context = getControllerContext(name, ControllerState.DESCRIBED);
         assertNotNull(context);
      }
   }
View Full Code Here


    * the invocation has a JndiBinding annotation.
    */
   public Object invoke(Invocation invocation) throws Throwable
   {
      MethodInvocation mi = (MethodInvocation) invocation;
      KernelControllerContext context = (KernelControllerContext) mi.getArguments()[0];

      boolean trace = log.isTraceEnabled();
      JndiBinding bindingInfo = (JndiBinding) invocation.resolveClassAnnotation(JndiBinding.class);
      if( trace )
         log.trace("Checking method: "+mi.getMethod()+", bindingInfo: "+bindingInfo);
      // If this is the setKernelControllerContext callback, bind the target into jndi
      if ("setKernelControllerContext".equals(mi.getMethod().getName()) && bindingInfo != null)
      {
         InitialContext ctx = new InitialContext(env);
         Object target = context.getTarget();
         Util.bind(ctx, bindingInfo.name(), target);
         if( trace )
            log.trace("Bound to: "+bindingInfo.name());
         String[] aliases = bindingInfo.aliases();
         if( aliases != null )
View Full Code Here

         getBean(name);
         fail("'" + name + "' should not be installed yet");
      }
      catch (IllegalStateException expected)
      {
         KernelControllerContext context = getControllerContext(name, ControllerState.DESCRIBED);
         assertNotNull(context);
      }
   }
View Full Code Here

    * @throws Throwable for any error
    */
   public Object invoke(Invocation invocation) throws Throwable
   {
      MethodInvocation mi = (MethodInvocation) invocation;
      KernelControllerContext context = (KernelControllerContext) mi.getArguments()[0];

      boolean trace = log.isTraceEnabled();
      JndiBinding bindingInfo = (JndiBinding) invocation.resolveClassAnnotation(JndiBinding.class);
      if( trace )
         log.trace("Checking method: "+mi.getMethod()+", bindingInfo: "+bindingInfo);
      // If this is the setKernelControllerContext callback, bind the target into jndi
      if ("setKernelControllerContext".equals(mi.getMethod().getName()) && bindingInfo != null)
      {
         InitialContext ctx = new InitialContext(env);
         Object target = context.getTarget();
         Util.bind(ctx, bindingInfo.name(), target);
         if( trace )
            log.trace("Bound to: "+bindingInfo.name());
         String[] aliases = bindingInfo.aliases();
         if( aliases != null )
View Full Code Here

      else
      {
         checkConstructorFactoryClass(constructor);
      }

      KernelControllerContext ctx = visitor.getControllerContext();
      if (ctx.getBeanMetaData() == this)
         context = ctx;
      boolean isInnerBean = visitor.visitorNodeStack().isEmpty() == false;
      if (isInnerBean)
      {
         Object name = ctx.getName();
         Object iDependOn = getUnderlyingValue();
         ControllerState whenRequired = visitor.getContextState();
         DependencyItem di = new AbstractDependencyItem(name, iDependOn, whenRequired, ControllerState.INSTALLED);
         visitor.addDependency(di);
      }
View Full Code Here

         getBean(name);
         fail("'" + name + "' should not be installed yet");
      }
      catch (IllegalStateException expected)
      {
         KernelControllerContext context = getControllerContext(name, ControllerState.DESCRIBED);
         assertNotNull(context);
      }
   }
View Full Code Here

   public void check()
   {
      KernelController controller = kernel.getController();
      for(String key : checker.keySet())
      {
         KernelControllerContext context = (KernelControllerContext)controller.getInstalledContext(key);
         Set<String> annotations = checker.get(key);
         for(String annotation : annotations)
         {
            System.out.println(
                  "Annotation " + annotation + (check(context, annotation) ?
                  " exists " : " doesn't exist ") + " on " + context.getTarget().getClass().getSuperclass()
            );
         }
      }
   }
View Full Code Here

         getBean(name);
         fail("'" + name + "' should not be installed yet");
      }
      catch (IllegalStateException expected)
      {
         KernelControllerContext context = getControllerContext(name, ControllerState.DESCRIBED);
         assertNotNull(context);
      }
   }
View Full Code Here

            getBean("Intercepted");
            fail("Bean should not be installed until the dependency is");
         }
         catch (IllegalStateException expected)
         {
            KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED);
            assertNotNull(context);
         }
         checkPlainBean();

         deploy("IntroductionDependencyTestCaseNotAutomatic0.xml");
         try
         {
            validate();
            SimpleBean dependency = (SimpleBean) getBean("Dependency");
            checkInterceptedBean(dependency);
         }
         finally
         {
            undeploy("IntroductionDependencyTestCaseNotAutomatic0.xml");
         }
        
         try
         {
            getBean("Intercepted");
            fail("Bean should not be installed after the dependency is undeployed");
         }
         catch (IllegalStateException expected)
         {
            KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED);
            assertNotNull(context);
         }
         checkPlainBean();
        
         deploy("IntroductionDependencyTestCaseNotAutomatic0.xml");
View Full Code Here

            bean = (SimpleBean) getBean("Intercepted");
            fail("'Interceped' should not be installed yet");
         }
         catch (IllegalStateException expected)
         {
            KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED);
            assertNotNull(context);
         }

         itworked = false;
         LifecycleCallbackWithBeanDependency.interceptions.clear();
View Full Code Here

TOP

Related Classes of org.jboss.kernel.spi.dependency.KernelControllerContext

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.