Examples of MethodPersistentReference


Examples of org.jboss.aop.util.reference.MethodPersistentReference

      {
         try
         {
            long hash = methodHash(methods[i]);
            //Use Clebert's Persistent References so we don't get memory leaks
            map.put(new Long(hash), new MethodPersistentReference(methods[i], PersistentReference.REFERENCE_SOFT));
         }
         catch (Exception e)
         {
         }
      }
View Full Code Here

Examples of org.jboss.aop.util.reference.MethodPersistentReference

         {
            MethodInvocation methodInvocation = (MethodInvocation) invocation;
            // For non-advised methods, we can only do public method invocations
            long methodHash = methodInvocation.getMethodHash();
            HashMap<Long, MethodPersistentReference> methodMap = ClassProxyFactory.getMethodMap(target.getClass());
            MethodPersistentReference ref = methodMap.get(new Long(methodHash));
            Method method = (Method)ref.get();
            Object[] args = methodInvocation.getArguments();
            try
            {
               return new InvocationResponse(method.invoke(target, args));
            }
View Full Code Here

Examples of org.jboss.aop.util.reference.MethodPersistentReference

            // (in superclasses) are not added either.
            if(!java.lang.reflect.Modifier.isVolatile( declaredMethods[i].getModifiers()))
            {
               long hash = org.jboss.aop.util.MethodHashing.methodHash(declaredMethods[i]);
               if(!ignoredHash.contains(new Long(hash)))
                  advised.put(new Long(hash), new MethodPersistentReference(declaredMethods[i], PersistentReference.REFERENCE_WEAK));
            }
            else
            {
               long hash = org.jboss.aop.util.MethodHashing.methodHash(declaredMethods[i]);
               ignoredHash.add(new Long(hash));
View Full Code Here

Examples of org.jboss.aop.util.reference.MethodPersistentReference

      {
         // For non-advised methods, we can only do public method invocations
         org.jboss.aop.joinpoint.MethodInvocation methodInvocation = (org.jboss.aop.joinpoint.MethodInvocation)invocation;
         long methodHash = methodInvocation.getMethodHash();
         HashMap methodMap = ClassProxyFactory.getMethodMap(obj.getClass());
         MethodPersistentReference ref = (MethodPersistentReference)methodMap.get(new Long(methodHash));
         Method method = (Method)ref.get();
         Object[] args = methodInvocation.getArguments();
         try
         {
            return method.invoke(obj, args);
         }
View Full Code Here

Examples of org.jboss.aop.util.reference.MethodPersistentReference

         {
            // For non-advised methods, we can only do public method invocations
            org.jboss.aop.joinpoint.MethodInvocation methodInvocation = (org.jboss.aop.joinpoint.MethodInvocation)invocation;
            long methodHash = methodInvocation.getMethodHash();
            HashMap methodMap = ClassProxyFactory.getMethodMap(target.getClass());
            MethodPersistentReference ref = (MethodPersistentReference)methodMap.get(new Long(methodHash));
            Method method = (Method)ref.get();
            Object[] args = methodInvocation.getArguments();
            try
            {
               return method.invoke(target, args);
            }
View Full Code Here

Examples of org.jboss.aop.util.reference.MethodPersistentReference

         Object target = methodInvocation.getTargetObject();
         Method method = methodInvocation.getMethod();
         if (method == null)
         {
            HashMap methodMap = manager.getMethodMap();
            MethodPersistentReference ref = (MethodPersistentReference)methodMap.get(new Long(methodHash));
            method = (Method)ref.get();
         }
         return method.invoke(target, methodInvocation.getArguments());
      }
      return invocation.invokeNext();
   }
View Full Code Here

Examples of org.jboss.aop.util.reference.MethodPersistentReference

            // (in superclasses) are not added either.
            if(!java.lang.reflect.Modifier.isVolatile( declaredMethods[i].getModifiers()))
            {
               long hash = org.jboss.aop.util.MethodHashing.methodHash(declaredMethods[i]);
               if(!ignoredHash.contains(new Long(hash)))
                  advised.put(new Long(hash), new MethodPersistentReference(declaredMethods[i], PersistentReference.REFERENCE_WEAK));
            }
            else
            {
               long hash = org.jboss.aop.util.MethodHashing.methodHash(declaredMethods[i]);
               ignoredHash.add(new Long(hash));
View Full Code Here

Examples of org.jboss.aop.util.reference.MethodPersistentReference

/*     */     {
/* 112 */       MethodInvocation methodInvocation = (MethodInvocation)invocation;
/*     */
/* 114 */       long methodHash = methodInvocation.getMethodHash();
/* 115 */       HashMap methodMap = ClassProxyFactory.getMethodMap(target.getClass());
/* 116 */       MethodPersistentReference ref = (MethodPersistentReference)methodMap.get(new Long(methodHash));
/* 117 */       Method method = (Method)ref.get();
/* 118 */       Object[] args = methodInvocation.getArguments();
/*     */       try
/*     */       {
/* 121 */         return new InvocationResponse(method.invoke(target, args));
/*     */       }
View Full Code Here

Examples of org.jboss.aop.util.reference.MethodPersistentReference

/* 59 */     if ((invocation instanceof MethodInvocation))
/*    */     {
/* 62 */       MethodInvocation methodInvocation = (MethodInvocation)invocation;
/* 63 */       long methodHash = methodInvocation.getMethodHash();
/* 64 */       HashMap methodMap = ClassProxyFactory.getMethodMap(target.getClass());
/* 65 */       MethodPersistentReference ref = (MethodPersistentReference)methodMap.get(new Long(methodHash));
/* 66 */       Method method = (Method)ref.get();
/* 67 */       Object[] args = methodInvocation.getArguments();
/*    */       try
/*    */       {
/* 70 */         return method.invoke(target, args);
/*    */       }
View Full Code Here

Examples of org.jboss.aop.util.reference.MethodPersistentReference

/* 64 */       Object target = methodInvocation.getTargetObject();
/* 65 */       Method method = methodInvocation.getMethod();
/* 66 */       if (method == null)
/*    */       {
/* 68 */         HashMap methodMap = this.manager.getMethodMap();
/* 69 */         MethodPersistentReference ref = (MethodPersistentReference)methodMap.get(new Long(methodHash));
/* 70 */         method = (Method)ref.get();
/*    */       }
/* 72 */       return method.invoke(target, methodInvocation.getArguments());
/*    */     }
/* 74 */     return invocation.invokeNext();
/*    */   }
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.