Package org.jboss.aop.advice

Examples of org.jboss.aop.advice.Interceptor


   protected Interceptor[] createLifecycleInterceptors(Class<? extends Annotation> lifecycleCallbackAnnotation)
   {
      // Get the lifecycle interceptor classes of the bean
      List<Class<?>> lifecycleInterceptorClasses = this.getContainer().getLifecycleInterceptorClasses();
      Advisor advisor = this.getContainer().getAdvisor();
      Interceptor interceptors[];
      try
      {
         // Create a AOP interceptor chain out of the lifecycle interceptor classes
         interceptors = LifecycleCallbacks.createLifecycleCallbackInterceptors(advisor, lifecycleInterceptorClasses,
               this, lifecycleCallbackAnnotation);
View Full Code Here


      {
         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

      catch (NamingException e)
      {
         throw new RuntimeException(e);
      }
     
      Interceptor interceptor = new NullInterceptor();
      if (domain != null)
      {
         AuthenticationManager manager = (AuthenticationManager) domain;
         RealmMapping mapping = (RealmMapping) domain;
         //interceptor = new RunAsSecurityInterceptor(manager, mapping, getRunAsIdentity(container));
View Full Code Here

  
  
   private void verifyInterceptors() throws Exception
   {
      verifiedInterceptors = new ArrayList<Interceptor>(interceptors.size());
      Interceptor interceptor = null;
      ClassLoader tcl = getContextClassLoader();
     
      for (Object o : interceptors)
      {
         log.debug("processing interceptor: " + o);
View Full Code Here

      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

         {
            throw new RuntimeException("Before/After/Throwing is only supported for Generated Advisors");
         }
         if (factories[i].isDeployed())
         {
            Interceptor interceptor = factories[i].create(this, joinpoint);
            if (interceptor != null)
            {
               newinterceptors.add(interceptor);
            }
         }
View Full Code Here

      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

         InstanceAdvisor advisor = ((Advised) obj)._getInstanceAdvisor();
         if(advisor == null)
            throw new RuntimeException("_putObject(): InstanceAdvisor is null for: " +obj);

         // Step Check for cross references
         Interceptor interceptor = AopUtil.findCacheInterceptor(advisor);
         // Let's check for object graph, e.g., multiple and circular references first
         if (graphHandler_.objectGraphPut(fqn, interceptor, type, obj)) { // found cross references
            return oldValue;
         }
View Full Code Here

         }

         // Check for Collection field so we need to restore the original reference.
         if(value instanceof ClassProxy)
         {
            Interceptor interceptor = CollectionInterceptorUtil.getInterceptor((ClassProxy)value);
            value = ((AbstractCollectionInterceptor)interceptor).getOriginalInstance();
         }
        
         try {
            field.set(result, value);
         } catch (IllegalAccessException e) {
            throw new CacheException("field access failed", e);
         }
      }

      // batch remove
      cache_.removeData(fqn);

      // Determine if we want to keep the interceptor for later use.
      if(removeCacheInterceptor) {
         CacheInterceptor interceptor = (CacheInterceptor) AopUtil.findCacheInterceptor(advisor);
         // Remember to remove the interceptor from in-memory object but make sure it belongs to me first.
         if (interceptor != null)
         {
            if (log.isDebugEnabled()) {
               log.debug("regularRemoveObject(): removed cache interceptor fqn: " + fqn + " interceptor: "+interceptor);
            }
            advisor.removeInterceptor(interceptor.getName());
            cache_.addUndoInterceptor(advisor, interceptor, ModificationEntry.INTERCEPTOR_REMOVE);
         }
      }

   }
View Full Code Here

      {
         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

TOP

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

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.