public Object[] getArguments() { Object[] args = super.getArguments(); if (args != null) { return args; } return NO_ARGS; }
public Object[] getArguments() { return delegate.getArguments(); }
public Object[] getArguments() { return wrapped.getArguments(); }
public void writeExternal(ObjectOutput out) throws IOException { out.writeLong(methodHash); if (getArguments() == null) { out.writeObject(null); } else { MarshalledObject mo = new MarshalledObject(getArguments()); out.writeObject(mo); } out.writeObject(metadata); }
public InvocationContextAdapter(MethodInvocation delegate) { super(delegate.getMethod(), delegate.getArguments()); this.delegate = delegate; }
/** * Creates a new instance * * @param invokedBusinessInterface * @param delegate * @param asyncExecutor Used to dispatch asynchronous invocations; required */ public SessionInvocationContextAdapter(Class<?> invokedBusinessInterface, MethodInvocation delegate, final ExecutorService asyncExecutor,final AsyncCancellableContext container) { super(invokedBusinessInterface, delegate.getMethod(), delegate.getArguments()); this.delegate = delegate; // Set Async Executor and Container this.asyncExecutor = asyncExecutor; this.container = container; }
public Object invoke(Invocation invocation) throws Throwable { MethodInvocation mi = (MethodInvocation) invocation; Method m = mi.getActualMethod(); Object[] args = mi.getArguments(); Object value = null; try { m.invoke(target, args); } catch(InvocationTargetException ite) { throw ite.getCause(); } return value; }
private void logMethod(boolean beforeAfter, Invocation invocation, Object result, Throwable t) { MethodInvocation mi = (MethodInvocation) invocation; StringBuilder builder = new StringBuilder(); Object target = mi.getTargetObject(); builder.append(target.getClass().getSimpleName()); builder.append('@'); builder.append(System.identityHashCode(target)); if (beforeAfter == false) builder.append(" before "); else builder.append(" after "); builder.append(mi.getActualMethod().getName()); if (beforeAfter == false) { builder.append(" params="); builder.append(Arrays.asList(mi.getArguments())); } else if (t == null) { builder.append(" result="); builder.append(result); } if (t != null) builder.append(" ended in error:"); log.trace(builder.toString(), t); } }
public Object invoke(org.jboss.aop.joinpoint.Invocation invocation) throws Throwable { if (invocation instanceof MethodInvocation) { // 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); } catch (InvocationTargetException ex) { throw ex.getTargetException(); } } else { throw new RuntimeException("field invocations not implemented"); } } }
MethodPersistentReference ref = (MethodPersistentReference)methodMap.get(new Long(methodHash)); Method method = (Method)ref.get(); Object[] args = methodInvocation.getArguments(); try
/** * */ public Object invoke(org.jboss.aop.joinpoint.Invocation invocation) throws Throwable { if (invocation instanceof MethodInvocation) { org.jboss.aop.joinpoint.MethodInvocation methodInvocation = (org.jboss.aop.joinpoint.MethodInvocation)invocation; long methodHash = methodInvocation.getMethodHash(); Method managerMethod = manager.isManagerMethod(methodHash); if (managerMethod != null) { Object[] args = methodInvocation.getArguments(); return managerMethod.invoke(manager, args); } 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(); }
/** * Copies complete state of Invocation object. * * @return a copy of this instance */ public Invocation copy() { MethodInvocation wrapper = new MethodInvocation(interceptors, methodHash, advisedMethod, unadvisedMethod, advisor); wrapper.metadata = this.metadata; wrapper.currentInterceptor = this.currentInterceptor; wrapper.instanceResolver = this.instanceResolver; wrapper.setTargetObject(this.getTargetObject()); wrapper.setArguments(this.getArguments()); return wrapper; }
methodInvocation.getArguments()); try
return invokeWithoutAdvisement(methodInvocation.getTargetObject(), methodInvocation.getMethodHash(), methodInvocation.getArguments());
MethodPersistentReference ref = methodMap.get(new Long(methodHash)); Method method = (Method)ref.get(); Object[] args = methodInvocation.getArguments(); try
public InvocationResponse dynamicInvoke(Invocation invocation) throws Throwable { ClassLoader oldLoader = Thread.currentThread().getContextClassLoader(); EJBContainerInvocation newSi = null; pushEnc(); try { Thread.currentThread().setContextClassLoader(classloader); MethodInvocation si = (MethodInvocation) invocation; MethodInfo info = getAdvisor().getMethodInfo(si.getMethodHash()); if (info == null) { throw new RuntimeException("Could not resolve beanClass method from proxy call"); } newSi = new MessageContainerInvocation(info); newSi.setArguments(si.getArguments()); newSi.setMetaData(si.getMetaData()); newSi.setAdvisor(getAdvisor()); InvocationResponse response = new InvocationResponse(newSi.invokeNext()); response.setContextInfo(newSi.getResponseContextInfo()); return response; } finally { Thread.currentThread().setContextClassLoader(oldLoader); popEnc(); } }
newSi.setArguments(si.getArguments()); newSi.setMetaData(si.getMetaData()); newSi.setAdvisor(getAdvisor());
if (methodName.equals("create")) Object[] arguments = invocation.getArguments();
newSi.setArguments(si.getArguments()); newSi.setMetaData(si.getMetaData());
nextInvocation.setMetaData(invocation.getMetaData()); nextInvocation.setTargetObject(target); nextInvocation.setArguments(methodInvocation.getArguments()); nextInvocation.setAdvisor(this); InvocationResponse response = new InvocationResponse(nextInvocation.invokeNext());