Beruflich Dokumente
Kultur Dokumente
/**
* Set the RemoteInvocationFactory to use for this accessor.
* Default is a {@link DefaultRemoteInvocationFactory}.
* <p>A custom invocation factory can add further context information
* to the invocation, for example user credentials.
*/
public void setRemoteInvocationFactory(RemoteInvocationFactory remoteInv
ocationFactory) {
this.remoteInvocationFactory =
(remoteInvocationFactory != null ? remoteInvocat
ionFactory : new DefaultRemoteInvocationFactory());
}
/**
* Return the RemoteInvocationFactory used by this accessor.
*/
public RemoteInvocationFactory getRemoteInvocationFactory() {
return this.remoteInvocationFactory;
}
/**
* Create a new RemoteInvocation object for the given AOP method invocat
ion.
* <p>The default implementation delegates to the configured
* {@link #setRemoteInvocationFactory RemoteInvocationFactory}.
* This can be overridden in subclasses in order to provide custom Remot
eInvocation
* subclasses, containing additional invocation parameters (e.g. user cr
edentials).
* <p>Note that it is preferable to build a custom RemoteInvocationFacto
ry
* as a reusable strategy, instead of overriding this method.
* @param methodInvocation the current AOP method invocation
* @return the RemoteInvocation object
* @see RemoteInvocationFactory#createRemoteInvocation
*/
protected RemoteInvocation createRemoteInvocation(MethodInvocation metho
dInvocation) {
return getRemoteInvocationFactory().createRemoteInvocation(metho
dInvocation);
}
/**
* Recreate the invocation result contained in the given RemoteInvocatio
nResult object.
* <p>The default implementation calls the default <code>recreate()</cod
e> method.
* This can be overridden in subclass to provide custom recreation, pote
ntially
* processing the returned result object.
* @param result the RemoteInvocationResult to recreate
* @return a return value if the invocation result is a successful retur
n
* @throws Throwable if the invocation result is an exception
* @see RemoteInvocationResult#recreate()
*/
protected Object recreateRemoteInvocationResult(RemoteInvocationResult r
esult) throws Throwable {
return result.recreate();
}
}