Examples of appendInterceptor()


Examples of org.jboss.aop.InstanceAdvisor.appendInterceptor()

         }
         // Insert interceptor at runtime
         InstanceAdvisor advisor = ((Advised) obj)._getInstanceAdvisor();
         CacheInterceptor interceptor = new CacheInterceptor(cache_, fqn, type);
         interceptor.setAopInstance(aopInstance);
         advisor.appendInterceptor(interceptor);
         cache_.addUndoInterceptor(advisor, interceptor, ModificationEntry.INTERCEPTOR_ADD);

      } else { // Must be Collection classes. We will use aop.ClassProxy instance instead.
         try {
            if( (obj = collectionHandler_.collectionObjectGet(fqn, clazz)) != null ) {
View Full Code Here

Examples of org.jboss.aop.InstanceAdvisor.appendInterceptor()

            if(interceptor == null)
            {
               throw new IllegalStateException("TreeCacheAopDelegate.undoInterceptorDetach(): null interceptor");
            }

            advisor.appendInterceptor(interceptor);
         } else
         {
            BaseInterceptor interceptor = (BaseInterceptor)undoMap.get(obj);
            boolean copyToCache = false;
            ((AbstractCollectionInterceptor)interceptor).attach(null, copyToCache);
View Full Code Here

Examples of org.jboss.aop.InstanceAdvisor.appendInterceptor()

   private static ClassProxy createProxy(Class clazz, AbstractCollectionInterceptor interceptor)
           throws Exception
   {
      ClassProxy result = ClassProxyFactory.newInstance(clazz);
      InstanceAdvisor advisor = result._getInstanceAdvisor();
      advisor.appendInterceptor(interceptor);

      // Also take care of just toString()
      try
      {
         String bindName = clazz.getName() + ".toString";
View Full Code Here

Examples of org.jboss.aop.InstanceAdvisor.appendInterceptor()

            if (interceptor == null)
            {
               throw new IllegalStateException("PojoCacheDelegate.undoInterceptorDetach(): null interceptor");
            }

            advisor.appendInterceptor(interceptor);
         }
         else
         {
            BaseInterceptor interceptor = (BaseInterceptor) undoMap.get(obj);
            boolean copyToCache = false;
View Full Code Here

Examples of org.jboss.aop.InstanceAdvisor.appendInterceptor()

         }
         // Insert interceptor at runtime
         InstanceAdvisor advisor = ((Advised) obj)._getInstanceAdvisor();
         CacheInterceptor interceptor = new CacheInterceptor(cache_, fqn, type);
         interceptor.setAopInstance(aopInstance);
         advisor.appendInterceptor(interceptor);
         cache_.addUndoInterceptor(advisor, interceptor, ModificationEntry.INTERCEPTOR_ADD);

      } else { // Must be Collection classes. We will use aop.ClassProxy instance instead.
         try {
            if( (obj = collectionHandler_.collectionObjectGet(fqn, clazz)) != null ) {
View Full Code Here

Examples of org.jboss.aop.InstanceAdvisor.appendInterceptor()

            if(interceptor == null)
            {
               throw new IllegalStateException("TreeCacheAopDelegate.undoInterceptorDetach(): null interceptor");
            }

            advisor.appendInterceptor(interceptor);
         } else
         {
            BaseInterceptor interceptor = (BaseInterceptor)undoMap.get(obj);
            boolean copyToCache = false;
            ((AbstractCollectionInterceptor)interceptor).attach(null, copyToCache);
View Full Code Here

Examples of org.jboss.aop.InstanceAdvisor.appendInterceptor()

            switch (ent.getOpType()) {
               case ModificationEntry.INTERCEPTOR_ADD:
                  advisor.removeInterceptor(interceptor.getName());
                  break;
               case ModificationEntry.INTERCEPTOR_REMOVE:
                  advisor.appendInterceptor(interceptor);
                  break;
               case ModificationEntry.COLLECTION_REPLACE:
                  Field field = ent.getField();
                  Object key = ent.getKey();
                  Object value = ent.getOldValue();
View Full Code Here

Examples of org.jboss.aop.InstanceAdvisor.appendInterceptor()

   public static ClassProxy createProxy(Class clazz, AbstractCollectionInterceptor interceptor)
         throws Exception
   {
      ClassProxy result = ClassProxyFactory.newInstance(clazz);
      InstanceAdvisor advisor = result._getInstanceAdvisor();
      advisor.appendInterceptor(interceptor);
      return result;
   }

   public static ClassProxy createMapProxy(PojoCache cache, Fqn fqn, Class clazz, Map obj) throws Exception {
      return CollectionInterceptorUtil.createProxy(clazz, new CachedMapInterceptor(cache, fqn, clazz, obj));
View Full Code Here

Examples of org.jboss.aop.InstanceAdvisor.appendInterceptor()

         pojo1.someMethod(123);
         assertEquals(2, Interceptions.size());
         assertEquals(Interceptions.getMethodName("MyInterceptor", "POJO", "someMethod"), Interceptions.get(0));
         assertEquals(Interceptions.getMethodName("MyAspect", "POJO", "someMethod"), Interceptions.get(1));

         pojoIa1.appendInterceptor(new YourInterceptor());

         Interceptions.clear();
         pojo1.someMethod(123);
         assertEquals(Interceptions.getMethodName("MyInterceptor", "POJO", "someMethod"), Interceptions.get(0));
         assertEquals(Interceptions.getMethodName("MyAspect", "POJO", "someMethod"), Interceptions.get(1));
View Full Code Here

Examples of org.jboss.aop.InstanceAdvisor.appendInterceptor()

         assertEquals(1, Interceptions.size());
         assertEquals(Interceptions.getMethodName("MyAspect", "POJO", "someMethod"), Interceptions.get(0));

         InstanceAdvisor subPojoIa1 = ((Advised)sub1)._getInstanceAdvisor();
         subPojoIa1.insertInterceptor(new MyInterceptor());
         subPojoIa1.appendInterceptor(new YourInterceptor());

         Interceptions.clear();
         sub1.someMethod(123);
         assertEquals(3, Interceptions.size());
         assertEquals(Interceptions.getMethodName("MyInterceptor", "POJO", "someMethod"), Interceptions.get(0));
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.