Examples of Interceptor


Examples of org.jboss.aop.advice.Interceptor

      try
      {
         // Do lifecycle callbacks
         List<Class<?>> lifecycleInterceptorClasses = beanContainer.getInterceptorRegistry().getLifecycleInterceptorClasses();
         Advisor advisor = getAdvisor();
         Interceptor interceptors[] = LifecycleCallbacks.createLifecycleCallbackInterceptors(advisor, lifecycleInterceptorClasses, beanContext, callbackAnnotationClass);
        
         Constructor<?> constructor = beanClass.getConstructor();
         Object initargs[] = null;
         ConstructionInvocation invocation = new ConstructionInvocation(interceptors, constructor, initargs);
         invocation.setAdvisor(advisor);
View Full Code Here

Examples of org.jboss.aop.advice.Interceptor

      {
         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
View Full Code Here

Examples of org.jboss.aop.advice.Interceptor

   {
      // normally we would invoke through the BeanContainer, however we want a different stack and
      // we want to be able to use tx2 interceptors.
      try
      {
         Interceptor interceptors[] = this.getLifecycleInterceptors(callbackAnnotationClass);
         LifecycleMethodInterceptorsInvocation invocation = new SingletonLifecycleMethodInterceptorsInvocation((LegacySingletonBeanContext) beanContext, interceptors);
         invocation.setAdvisor(this.getAdvisor());
         invocation.invokeNext();
      }
      catch (Throwable t)
View Full Code Here

Examples of org.jboss.aop.advice.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)
View Full Code Here

Examples of org.jboss.arquillian.graphene.proxy.Interceptor

        Assert.assertEquals(1, counter2.get());
        Assert.assertEquals(1, counterDefault.get());
    }

    protected Interceptor createInterceptor(final AtomicInteger counter) {
        return new Interceptor() {
            @Override
            public Object intercept(InvocationContext context) throws Throwable {
                counter.incrementAndGet();
                return context.invoke();
            }
View Full Code Here

Examples of org.jboss.cache.interceptors.Interceptor

    public void testTransactionValidateRollbackMethod() throws Exception
    {

        TreeCache cache = createCacheWithListener();
        Interceptor validateInterceptor = new OptimisticValidatorInterceptor();
        validateInterceptor.setCache(cache);
        Interceptor interceptor = new OptimisticCreateIfNotExistsInterceptor();
        interceptor.setCache(cache);
        Interceptor nodeInterceptor = new OptimisticNodeInterceptor();
        nodeInterceptor.setCache(cache);
        MockInterceptor dummy = new MockInterceptor();
        dummy.setCache(cache);
        validateInterceptor.setNext(interceptor);
        interceptor.setNext(nodeInterceptor);
        nodeInterceptor.setNext(dummy);

        cache.setInterceptorChain(validateInterceptor);

//     first set up a node with a pojo
        DummyTransactionManager mgr = DummyTransactionManager.getInstance();
View Full Code Here

Examples of org.jboss.ejb.Interceptor

      try
      {
         final EjbModule ejbModule = (EjbModule) this.server.getAttribute(objectName, "EjbModule");
         final StatelessSessionContainer container = (StatelessSessionContainer) ejbModule.getContainer(ejbName);

         Interceptor currentInterceptor = container.getInterceptor();
         while (currentInterceptor != null && currentInterceptor.getNext() != null)
         {
            final Interceptor nextInterceptor = currentInterceptor.getNext();

            if (nextInterceptor.getNext() == null)
            {
               final ServiceEndpointInterceptorEJB21 sepInterceptor = new ServiceEndpointInterceptorEJB21();
               currentInterceptor.setNext(sepInterceptor);
               sepInterceptor.setNext(nextInterceptor);
               this.log.debug("Injecting EJB 21 service endpoint interceptor after: "
View Full Code Here

Examples of org.jboss.ejb3.sis.Interceptor

         public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
         {
            return invokeEndpoint(proxy, method, args);
         }
      };
      final Interceptor asyncInterceptor = new AsyncClientInterceptor((AsyncEndpoint) endpointContext.getTarget(),
            asyncMethods, session);
      Interceptor chain = new InterceptorAssembly(new Interceptor[]
      {new ObjectMethodsInterceptor(this), asyncInterceptor});
      this.delegate = new InterceptorInvocationHandler(endpointInvocationHandler, chain);
   }
View Full Code Here

Examples of org.jboss.invocation.Interceptor

    private final Object KEY = new Object();

    @Override
    public final Interceptor create(InterceptorFactoryContext context) {
        final Map<Object, Object> contextData = context.getContextData();
        Interceptor interceptor = (Interceptor) contextData.get(KEY);
        if (interceptor == null) {
            final Component component = (Component) context.getContextData().get(Component.class);
            contextData.put(KEY, interceptor = create(component, context));
        }
        return interceptor;
View Full Code Here

Examples of org.jboss.mx.interceptor.Interceptor

               }
            }
         }
      }

      Interceptor i = invocation.nextInterceptor();
      return i.invoke(invocation);
   }
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.