public Object invoke(Object proxy,
Method m,
Object[] args) throws Throwable {
// Normalize args to always be an array
// Isn't this a bug in the proxy call??
if (args == null)
args = EMPTY_ARGS;
// Create the invocation object
Invocation invocation = new Invocation();
// Contextual information for the interceptors
invocation.setInvocationContext(context);
invocation.setId(context.getCacheId());
invocation.setObjectName(context.getObjectName());
invocation.setMethod(m);
invocation.setArguments(args);
invocation.setValue(InvocationKey.INVOKER_PROXY_BINDING,
context.getInvokerProxyBinding(),
PayloadKey.AS_IS);
// send the invocation down the client interceptor chain
Object obj = next.invoke(invocation);
return obj;
}
|