Package org.jboss.aop.util.reference

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


         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

            // (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

/*     */     {
/* 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

/* 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

/* 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

/* 49 */     if ((invocation instanceof MethodInvocation))
/*    */     {
/* 52 */       MethodInvocation methodInvocation = (MethodInvocation)invocation;
/* 53 */       long methodHash = methodInvocation.getMethodHash();
/* 54 */       HashMap methodMap = ClassProxyFactory.getMethodMap(this.obj.getClass());
/* 55 */       MethodPersistentReference ref = (MethodPersistentReference)methodMap.get(new Long(methodHash));
/* 56 */       Method method = (Method)ref.get();
/* 57 */       Object[] args = methodInvocation.getArguments();
/*    */       try
/*    */       {
/* 60 */         return method.invoke(this.obj, args);
/*    */       }
View Full Code Here

/*    */   {
/*    */   }
/*    */
/*    */   public Method getMethod()
/*    */   {
/* 62 */     MethodPersistentReference ref = (MethodPersistentReference)this.proxy.getMethodMap().get(new Long(this.methodHash));
/* 63 */     return (Method)ref.get();
/*    */   }
View Full Code Here

/*     */
/* 335 */       if (!java.lang.reflect.Modifier.isVolatile(declaredMethods[i].getModifiers()))
/*     */       {
/* 337 */         long hash = MethodHashing.methodHash(declaredMethods[i]);
/* 338 */         if (!ignoredHash.contains(new Long(hash)))
/* 339 */           advised.put(new Long(hash), new MethodPersistentReference(declaredMethods[i], 2));
/*     */       }
/*     */       else
/*     */       {
/* 343 */         long hash = MethodHashing.methodHash(declaredMethods[i]);
/* 344 */         ignoredHash.add(new Long(hash));
View Full Code Here

/*     */   }
/*     */
/*     */   public static Method findMethodByHash(Class clazz, Long hash) throws Exception
/*     */   {
/*  61 */     Map hashes = getMethodHashes(clazz);
/*  62 */     MethodPersistentReference ref = (MethodPersistentReference)hashes.get(hash);
/*  63 */     if (ref != null)
/*     */     {
/*  65 */       return ref.getMethod();
/*     */     }
/*     */
/*  68 */     if (clazz.isInterface())
/*     */     {
/*  70 */       Class[] interfaces = clazz.getInterfaces();
View Full Code Here

TOP

Related Classes of org.jboss.aop.util.reference.MethodPersistentReference

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.