/** * Creates a {@link AOPBasedContainerInvocation} * * @param method The AOP method * @param args The arguments to the method */ public AOPBasedContainerInvocation(MethodInfo aopMethodInfo, Object[] args) { this.aopMethodInfo = aopMethodInfo; this.args = args; // set the unadvised method this.unadvisedMethod = this.aopMethodInfo.getUnadvisedMethod(); }
public MethodJoinPointGenerator(GeneratedClassAdvisor advisor, MethodInfo info) { super(advisor, info, getParameters(info), info.getMethod().getParameterTypes().length, false); if (super.getJoinpointField() != null) { if (!info.getUnadvisedMethod().getReturnType().equals(Void.TYPE)) { returnType = new WeakReference<Class<?>>(info.getUnadvisedMethod().getReturnType()); } hasTargetObject = !Modifier.isStatic(info.getMethod().getModifiers()); } }
/** * If the target instance is advised, make sure that we set the unadvised method to the one stored by the class advisor * so that we don't get double invocations. */ @Override public MethodInfo getMethodInfo(long hash) { MethodInfo info = super.getMethodInfo(hash); if (classAdvisor instanceof ClassAdvisor && info.getMethod().equals(info.getUnadvisedMethod())) { MethodInfo superInfo = classAdvisor.getMethodInfo(hash); if (superInfo != null) { info.setUnadvisedMethod(superInfo.getUnadvisedMethod()); } } return info; }
public MethodInvocation(MethodInfo info, org.jboss.aop.advice.Interceptor[] interceptors) { this(interceptors, info.getHash(), info.getMethod(), info.getUnadvisedMethod(), info.getAdvisor()); }
protected Object invokeEJBObjectMethod(Object id, MethodInfo info, Object args[]) throws Exception Method unadvisedMethod = info.getUnadvisedMethod(); if(unadvisedMethod.getName().equals("getEJBHome"))
private Object invokeEJBLocalObjectMethod(Object id, MethodInfo info, Object[] args) throws Exception Method unadvisedMethod = info.getUnadvisedMethod(); if (unadvisedMethod.getName().equals("remove"))
Method unadvisedMethod = methodInfo.getUnadvisedMethod();
public MarshalledMethodInfo(MarshalledContainerProxy proxy, MethodInfo info) throws IOException { this.proxy = proxy; try { this.advisedHash = MethodHashing.methodHash(info.getMethod()); this.unadvisedHash = MethodHashing.methodHash(info.getUnadvisedMethod()); } catch (Exception e) { throw new MethodHashingException(e); } clazz = info.getMethod().getDeclaringClass(); populateInterceptors(info); }
Method unadvisedMethod = info.getUnadvisedMethod();
Method unadvisedMethod = info.getUnadvisedMethod();
Method unadvisedMethod = info.getUnadvisedMethod();
protected Object invokeEJBObjectMethod(MethodInfo info, MethodInvocation invocation) throws Throwable Method unadvisedMethod = info.getUnadvisedMethod(); if (unadvisedMethod.getName().equals("getHandle"))
Method method = info.getUnadvisedMethod(); try
Method originalMethod = info.getUnadvisedMethod(); name = originalMethod.getName();
Method unadvisedMethod = info.getUnadvisedMethod();
protected Object invokeHomeMethod(MethodInfo info, MethodInvocation invocation) throws Throwable Method unadvisedMethod = info.getUnadvisedMethod(); String methodName = unadvisedMethod.getName(); if (methodName.equals("create"))
protected InvocationResponse invokeHomeMethod(MethodInfo info, StatefulRemoteInvocation statefulInvocation) throws Throwable Method unadvisedMethod = info.getUnadvisedMethod(); if (unadvisedMethod.getName().startsWith("create"))
long hash = MethodHashing.calculateHash(actualMethod); MethodInfo info = this.getAdvisor().getMethodInfo(hash); Method unadvisedMethod = info.getUnadvisedMethod();
private StatefulSessionContainerMethodInvocation _buildNewInvocation(MethodInfo info, StatefulRemoteInvocation statefulInvocation, Class<?>[] initParameterTypes, Object[] initParameterValues) { StatefulSessionContainerMethodInvocation newStatefulInvocation = null; StatefulBeanContext ctx = null; // ENC is required in scope to create a session this.pushEnc(); try { ctx = getCache().create(initParameterTypes, initParameterValues); } finally { // Pop the ENC off the stack this.popEnc(); } Object newId = ctx.getId(); newStatefulInvocation = new StatefulSessionContainerMethodInvocation(info); newStatefulInvocation.setSessionId(newId); newStatefulInvocation.setArguments(statefulInvocation.getArguments()); newStatefulInvocation.setMetaData(statefulInvocation.getMetaData()); newStatefulInvocation.setAdvisor(getAdvisor()); SerializableMethod invokedMethod = new SerializableMethod(info.getUnadvisedMethod()); newStatefulInvocation.getMetaData().addMetaData(SessionSpecRemotingMetadata.TAG_SESSION_INVOCATION, SessionSpecRemotingMetadata.KEY_INVOKED_METHOD, invokedMethod, PayloadKey.AS_IS); return newStatefulInvocation; }
private StatefulContainerInvocation buildInvocation(MethodInfo info, StatefulRemoteInvocation statefulInvocation) { StatefulContainerInvocation newStatefulInvocation = null; Object newId = null; final ExecutorService asyncExecutor = this.getAsynchronousExecutor(); if (statefulInvocation.getId() == null) { StatefulBeanContext ctx = getCache().create(null, null); newId = ctx.getId(); newStatefulInvocation = new StatefulContainerInvocation(info, newId, null, asyncExecutor, this); } else { newStatefulInvocation = new StatefulContainerInvocation(info, statefulInvocation.getId(), null, asyncExecutor, this); } newStatefulInvocation.setArguments(statefulInvocation.getArguments()); newStatefulInvocation.setMetaData(statefulInvocation.getMetaData()); newStatefulInvocation.setAdvisor(getAdvisor()); SerializableMethod invokedMethod = new SerializableMethod(info.getUnadvisedMethod()); newStatefulInvocation.getMetaData().addMetaData(SessionSpecRemotingMetadata.TAG_SESSION_INVOCATION, SessionSpecRemotingMetadata.KEY_INVOKED_METHOD, invokedMethod, PayloadKey.AS_IS); return newStatefulInvocation; }