Package org.jboss.aop.advice

Examples of org.jboss.aop.advice.AdviceStack


         }

      }

      Advisor advisor = getAdvisor();
      AdviceStack stack = advisor.getManager().getAdviceStack("InjectionCallbackStack");
      if(stack == null)
         throw new IllegalStateException("EJBTHREE-2020: No InjectionCallbackStack defined for domain " + domain + " of " + this);
      injectionCallbackStack = stack.createInterceptors(advisor, null);
     
   }
View Full Code Here


    * @param interceptorStackName
    * @return
    */
   protected Interceptor[] getInterceptors(Joinpoint joinPoint, String interceptorStackName)
   {
      AdviceStack stack = this.getAdvisor().getManager().getAdviceStack(interceptorStackName);
      if (stack == null)
      {
         log.debug("No AOP interceptor stack with name : " + interceptorStackName + " available for EJB container: " + this);
         return new Interceptor[0];
      }
      List<Interceptor> interceptors = new ArrayList<Interceptor>();
      interceptors.addAll(Arrays.asList(stack.createInterceptors(this.getAdvisor(), joinPoint)));
      return interceptors.toArray(new Interceptor[]{});
   }
View Full Code Here

         RemoteBinding binding = this.getBinding();
         if (binding.interceptorStack() != null && !binding.interceptorStack().trim().equals(""))
         {
            stackName = binding.interceptorStack();
         }
         AdviceStack stack = AspectManager.instance().getAdviceStack(stackName);
         if (stack == null) throw new RuntimeException("unable to find interceptor stack: " + stackName);
         StatefulHomeRemoteProxyInvocationHandler proxy = new StatefulHomeRemoteProxyInvocationHandler(getContainer(), stack.createInterceptors(
               getContainer().getAdvisor(), null), this.getLocator());

         setEjb21Objects(proxy);
         Class<?>[] intfs = {homeInterface};
         return java.lang.reflect.Proxy.newProxyInstance(getContainer().getBeanClass().getClassLoader(), intfs, proxy);
View Full Code Here

      RemoteBinding binding = this.getBinding();
      if (binding.interceptorStack() != null && !binding.interceptorStack().trim().equals(""))
      {
         stackName = binding.interceptorStack();
      }
      AdviceStack stack = AspectManager.instance().getAdviceStack(stackName);
      if (stack == null) throw new RuntimeException("unable to find interceptor stack: " + stackName);
      StatefulClusteredInvocationHandler handler = new StatefulClusteredInvocationHandler(getContainer(), stack.createInterceptors(getContainer()
            .getAdvisor(), null), this.wrapper, this.lbPolicy, partitionName, getLocator(), id, businessInterfaceType);
     
      if(type.equals(SpecificationInterfaceType.EJB21))
      {
         return this.constructEjb21Proxy(handler);
View Full Code Here

         // set the dependency policy
         this.dependencyPolicy = deployment.createDependencyPolicy(this);
      }
     
      Advisor advisor = getAdvisor();
      AdviceStack stack = advisor.getManager().getAdviceStack("InjectionCallbackStack");
      if(stack == null)
         throw new IllegalStateException("EJBTHREE-2020: No InjectionCallbackStack defined for domain " + domain + " of " + this);
      injectionCallbackStack = stack.createInterceptors(advisor, null);

      this.effigy = effigy(classloader, beanMetaData);
   }
View Full Code Here

    * @param interceptorStackName
    * @return
    */
   protected Interceptor[] getInterceptors(Joinpoint joinPoint, String interceptorStackName)
   {
      AdviceStack stack = this.getAdvisor().getManager().getAdviceStack(interceptorStackName);
      if (stack == null)
      {
         log.debug("No AOP interceptor stack with name : " + interceptorStackName + " available for EJB container: " + this);
         return new Interceptor[0];
      }
      List<Interceptor> interceptors = new ArrayList<Interceptor>();
      interceptors.addAll(Arrays.asList(stack.createInterceptors(this.getAdvisor(), joinPoint)));
      return interceptors.toArray(new Interceptor[]{});
   }
View Full Code Here

      else
      {
         initMethod.setAccessible(true);
      }

      AdviceStack stack = getAdvisor().getManager().getAdviceStack("HomeCallbackStack");
      Interceptor interceptors[];
      if(stack == null)
      {
         throw new IllegalStateException("EJBTHREE-1995: " + getAdvisor().getManager().getManagerFQN() + " does not define a HomeCallbackStack");
      }
      else
      {
         // we could do a joinpoint, but why bother
         interceptors = stack.createInterceptors(getAdvisor(), null);
      }

      StatefulContainerInvocation invocation = new StatefulContainerInvocation(interceptors, 0L, initMethod,
            initMethod, getAdvisor(), sessionId, null, this.getAsynchronousExecutor());
      invocation.setArguments(initParameterValues);
View Full Code Here

         {};
      }

      // Obtain interceptors by stack name via Aspect Manager
      AspectManager manager = AspectManager.instance();
      AdviceStack stack = manager.getAdviceStack(stackName);
      assert stack != null : "Could not find Advice Stack with name: " + stackName;
      Advisor advisor = this.getAdvisor();
      Interceptor[] interceptors = stack.createInterceptors(advisor, null);
      return interceptors;
   }
View Full Code Here

    */
   public static Interceptor[] createLifecycleCallbackInterceptors(Advisor advisor, List<Class<?>> lifecycleInterceptorClasses, Class<? extends Annotation> lifecycleAnnotationType, String stackName)
   {
      List<Interceptor> interceptors = new ArrayList<Interceptor>();

      AdviceStack stack = advisor.getManager().getAdviceStack(stackName);
      if(stack == null)
      {
         log.warn("EJBTHREE-1480: " + stackName + " has not been defined for " + toString(advisor.getManager()));
         interceptors.add(new CurrentInvocationInterceptor());
         Interceptor invocationContextInterceptor;
         try
         {
            invocationContextInterceptor = PerVmAdvice.generateInterceptor(null, new InvocationContextInterceptor(), "setup");
         }
         catch (Exception e)
         {
            throw new RuntimeException("Could not generate invocation context interceptor", e);
         }
         interceptors.add(invocationContextInterceptor);
      }
      else
      {
         interceptors.addAll(Arrays.asList(stack.createInterceptors(advisor, null)));
      }

      // 12.7 footnote 57: ignore method level interceptors
      // The lifecycle callbacks on the interceptors must be invoked in order
      for(Class<?> interceptorClass : lifecycleInterceptorClasses)
View Full Code Here

         // set the dependency policy
         this.dependencyPolicy = deployment.createDependencyPolicy(this);
      }
     
      Advisor advisor = getAdvisor();
      AdviceStack stack = advisor.getManager().getAdviceStack("InjectionCallbackStack");
      if(stack == null)
         throw new IllegalStateException("EJBTHREE-2020: No InjectionCallbackStack defined for domain " + domain + " of " + this);
      injectionCallbackStack = stack.createInterceptors(advisor, null);

      this.effigy = effigy(classloader, beanMetaData);
   }
View Full Code Here

TOP

Related Classes of org.jboss.aop.advice.AdviceStack

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.