Package org.jboss.aop.joinpoint

Examples of org.jboss.aop.joinpoint.MethodCalledByConstructorInvocation


   }

   public Object invokeConstructorCaller(MethodByConInfo info, Object callingObject, Object target, Object[] args)
   throws Throwable
   {
      MethodCalledByConstructorInvocation invocation = new MethodCalledByConstructorInvocation(info, callingObject, target, args, info.getInterceptors());
      invocation.setTargetObject(target);
      return invocation.invokeNext();
   }
View Full Code Here


         MethodCalledByMethodInvocation mi = (MethodCalledByMethodInvocation) invocation;
         return p.matchesCall(mi.getAdvisor(), mi.getCallingMethod(), mi.getCalledMethod().getDeclaringClass(), mi.getCalledMethod());
      }
      else if (invocation instanceof MethodCalledByConstructorInvocation)
      {
         MethodCalledByConstructorInvocation mi = (MethodCalledByConstructorInvocation) invocation;
         return p.matchesCall(mi.getAdvisor(), mi.getCalling(), mi.getCalledMethod().getDeclaringClass(), mi.getCalledMethod());
      }
      else if (invocation instanceof ConstructorCalledByConstructorInvocation)
      {
         ConstructorCalledByConstructorInvocation mi = (ConstructorCalledByConstructorInvocation) invocation;
         return p.matchesCall(mi.getAdvisor(), mi.getCallingConstructor(), mi.getCalledConstructor().getDeclaringClass(), mi.getCalledConstructor());
      }
      else if (invocation instanceof ConstructorCalledByMethodInvocation)
      {
         ConstructorCalledByMethodInvocation mi = (ConstructorCalledByMethodInvocation) invocation;
         return p.matchesCall(mi.getAdvisor(), mi.getCallingMethod(), mi.getCalledConstructor().getDeclaringClass(), mi.getCalledConstructor());
      }
      throw new RuntimeException("UNKNOWN JOINPOINT TYPE: " + invocation.getClass().getName());
   }
View Full Code Here

   }

   public Object invokeConstructorCaller(MethodByConInfo info, Object callingObject, Object target, Object[] args)
   throws Throwable
   {
      MethodCalledByConstructorInvocation invocation = new MethodCalledByConstructorInvocation(info, callingObject, target, args, info.getInterceptors());
      invocation.setTargetObject(target);
      return invocation.invokeNext();
   }
View Full Code Here

   }

   public Object invokeConstructorCaller(MethodByConInfo info, Object callingObject, Object target, Object[] args)
   throws Throwable
   {
      MethodCalledByConstructorInvocation invocation = new MethodCalledByConstructorInvocation(info, callingObject, target, args, info.getInterceptors());
      invocation.setTargetObject(target);
      return invocation.invokeNext();
   }
View Full Code Here

   }

   public Object invokeConstructorCaller(MethodByConInfo info, Object callingObject, Object target, Object[] args)
   throws Throwable
   {
      MethodCalledByConstructorInvocation invocation = new MethodCalledByConstructorInvocation(info, callingObject, target, args, info.getInterceptors());
      invocation.setTargetObject(target);
      return invocation.invokeNext();
   }
View Full Code Here

   }

   public Object invokeConstructorCaller(MethodByConInfo info, Object callingObject, Object target, Object[] args)
   throws Throwable
   {
      MethodCalledByConstructorInvocation invocation = new MethodCalledByConstructorInvocation(info, callingObject, target, args, info.getInterceptors());
      invocation.setTargetObject(target);
      return invocation.invokeNext();
   }
View Full Code Here

/*  83 */       MethodCalledByMethodInvocation mi = (MethodCalledByMethodInvocation)invocation;
/*  84 */       return this.p.matchesCall(mi.getAdvisor(), mi.getCallingMethod(), mi.getCalledMethod().getDeclaringClass(), mi.getCalledMethod());
/*     */     }
/*  86 */     if ((invocation instanceof MethodCalledByConstructorInvocation))
/*     */     {
/*  88 */       MethodCalledByConstructorInvocation mi = (MethodCalledByConstructorInvocation)invocation;
/*  89 */       return this.p.matchesCall(mi.getAdvisor(), mi.getCalling(), mi.getCalledMethod().getDeclaringClass(), mi.getCalledMethod());
/*     */     }
/*  91 */     if ((invocation instanceof ConstructorCalledByConstructorInvocation))
/*     */     {
/*  93 */       ConstructorCalledByConstructorInvocation mi = (ConstructorCalledByConstructorInvocation)invocation;
/*  94 */       return this.p.matchesCall(mi.getAdvisor(), mi.getCallingConstructor(), mi.getCalledConstructor().getDeclaringClass(), mi.getCalledConstructor());
/*     */     }
/*  96 */     if ((invocation instanceof ConstructorCalledByMethodInvocation))
/*     */     {
/*  98 */       ConstructorCalledByMethodInvocation mi = (ConstructorCalledByMethodInvocation)invocation;
/*  99 */       return this.p.matchesCall(mi.getAdvisor(), mi.getCallingMethod(), mi.getCalledConstructor().getDeclaringClass(), mi.getCalledConstructor());
/*     */     }
/* 101 */     throw new RuntimeException("UNKNOWN JOINPOINT TYPE: " + invocation.getClass().getName());
/*     */   }
View Full Code Here

/*      */   }
/*      */
/*      */   public Object invokeConstructorCaller(MethodByConInfo info, Object callingObject, Object target, Object[] args)
/*      */     throws Throwable
/*      */   {
/* 1532 */     MethodCalledByConstructorInvocation invocation = new MethodCalledByConstructorInvocation(info, callingObject, target, args, info.getInterceptors());
/* 1533 */     invocation.setTargetObject(target);
/* 1534 */     return invocation.invokeNext();
/*      */   }
View Full Code Here

/*      */   private Object invokeOriginalChainIfExists(Invocation invocation, Method method, Object targetObject, Object[] args)
/*      */     throws Throwable
/*      */   {
/* 1317 */     if ((invocation instanceof MethodCalledByConstructorInvocation))
/*      */     {
/* 1319 */       MethodCalledByConstructorInvocation inv = (MethodCalledByConstructorInvocation)invocation;
/* 1320 */       Constructor callingCon = inv.getCalling();
/* 1321 */       Class callingClass = callingCon.getDeclaringClass();
/* 1322 */       if (isAdvised(callingClass))
/*      */       {
/* 1324 */         ClassAdvisor advisor = AspectManager.instance().getAdvisor(callingClass);
/* 1325 */         if (advisor != null)
/*      */         {
/* 1327 */           int index = advisor.getConstructorIndex(callingCon);
/* 1328 */           if (index >= 0)
/*      */           {
/* 1330 */             HashMap calledClassesMap = advisor.getMethodCalledByConInterceptors()[index];
/* 1331 */             if (calledClassesMap != null)
/*      */             {
/* 1333 */               TLongObjectHashMap calledMethods = (TLongObjectHashMap)calledClassesMap.get(method.getDeclaringClass().getName());
/* 1334 */               if (calledMethods != null)
/*      */               {
/* 1336 */                 long calledHash = MethodHashing.calculateHash(method);
/*      */
/* 1338 */                 MethodByConInfo info = (MethodByConInfo)calledMethods.get(calledHash);
/*      */
/* 1340 */                 if ((info != null) && (info.hasAdvices()))
/*      */                 {
/* 1343 */                   return advisor.invokeConstructorCaller(info, inv.getCallingObject(), targetObject, args);
/*      */                 }
/*      */               }
/*      */             }
/*      */           }
/*      */         }
/*      */       }
/*      */     }
/* 1351 */     else if ((invocation instanceof MethodCalledByMethodInvocation))
/*      */     {
/* 1353 */       MethodCalledByMethodInvocation inv = (MethodCalledByMethodInvocation)invocation;
/* 1354 */       Method callingMethod = inv.getCallingMethod();
/* 1355 */       if (isAdvised(callingMethod.getDeclaringClass()))
/*      */       {
/* 1357 */         ClassAdvisor advisor = AspectManager.instance().getAdvisor(callingMethod.getDeclaringClass());
/* 1358 */         if (advisor != null)
/*      */         {
/* 1360 */           long callingMethodHash = MethodHashing.calculateHash(callingMethod);
/* 1361 */           long calledHash = MethodHashing.calculateHash(method);
/*      */
/* 1363 */           HashMap calledClassesMap = (HashMap)advisor.getMethodCalledByMethodInterceptors().get(callingMethodHash);
/* 1364 */           if (calledClassesMap != null)
/*      */           {
/* 1366 */             TLongObjectHashMap calledMethods = (TLongObjectHashMap)calledClassesMap.get(method.getDeclaringClass().getName());
/* 1367 */             if (calledMethods != null)
/*      */             {
/* 1370 */               MethodByMethodInfo info = (MethodByMethodInfo)calledMethods.get(calledHash);
/*      */
/* 1372 */               if ((info != null) && (info.hasAdvices()))
/*      */               {
/* 1375 */                 return advisor.invokeCaller(info, inv.getCallingObject(), targetObject, args);
/*      */               }
/*      */             }
/*      */           }
/*      */         }
/*      */
View Full Code Here

/*      */   private Object invokeOriginalChainIfExists(Invocation invocation, Constructor constructor, Object[] args)
/*      */     throws Throwable
/*      */   {
/* 1166 */     if ((invocation instanceof MethodCalledByConstructorInvocation))
/*      */     {
/* 1168 */       MethodCalledByConstructorInvocation inv = (MethodCalledByConstructorInvocation)invocation;
/* 1169 */       Constructor callingCon = inv.getCalling();
/* 1170 */       Class callingClass = callingCon.getDeclaringClass();
/* 1171 */       if (isAdvised(callingClass))
/*      */       {
/* 1173 */         ClassAdvisor advisor = AspectManager.instance().getAdvisor(callingClass);
/* 1174 */         if (advisor != null)
/*      */         {
/* 1176 */           int index = advisor.getConstructorIndex(callingCon);
/* 1177 */           if (index >= 0)
/*      */           {
/* 1179 */             HashMap calledClassesMap = advisor.getConCalledByConInterceptors()[index];
/* 1180 */             if (calledClassesMap != null)
/*      */             {
/* 1182 */               TLongObjectHashMap calledCons = (TLongObjectHashMap)calledClassesMap.get(constructor.getDeclaringClass().getName());
/* 1183 */               if (calledCons != null)
/*      */               {
/* 1185 */                 long calledHash = MethodHashing.constructorHash(constructor);
/* 1186 */                 ConByConInfo info = (ConByConInfo)calledCons.get(calledHash);
/*      */
/* 1188 */                 if ((info != null) && (info.hasAdvices()))
/*      */                 {
/* 1190 */                   return advisor.invokeConCalledByCon(info, inv.getCallingObject(), args);
/*      */                 }
/*      */               }
/*      */             }
/*      */           }
/*      */         }
/*      */       }
/*      */     }
/* 1198 */     else if ((invocation instanceof MethodCalledByMethodInvocation))
/*      */     {
/* 1200 */       MethodCalledByMethodInvocation inv = (MethodCalledByMethodInvocation)invocation;
/* 1201 */       Method callingMethod = inv.getCallingMethod();
/* 1202 */       if (isAdvised(callingMethod.getDeclaringClass()))
/*      */       {
/* 1204 */         ClassAdvisor advisor = AspectManager.instance().getAdvisor(callingMethod.getDeclaringClass());
/* 1205 */         if (advisor != null)
/*      */         {
/* 1207 */           long callingMethodHash = MethodHashing.calculateHash(callingMethod);
/* 1208 */           long calledHash = MethodHashing.constructorHash(constructor);
/*      */
/* 1210 */           HashMap calledClassesMap = (HashMap)advisor.getConCalledByMethodInterceptors().get(callingMethodHash);
/* 1211 */           if (calledClassesMap != null)
/*      */           {
/* 1213 */             TLongObjectHashMap calledCons = (TLongObjectHashMap)calledClassesMap.get(constructor.getDeclaringClass().getName());
/* 1214 */             if (calledCons != null)
/*      */             {
/* 1217 */               ConByMethodInfo info = (ConByMethodInfo)calledCons.get(calledHash);
/*      */
/* 1219 */               if ((info != null) && (info.hasAdvices()))
/*      */               {
/* 1222 */                 return advisor.invokeConCalledByMethod(info, inv.getCallingObject(), args);
/*      */               }
/*      */             }
/*      */           }
/*      */         }
/*      */       }
View Full Code Here

TOP

Related Classes of org.jboss.aop.joinpoint.MethodCalledByConstructorInvocation

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.