public abstract class RemoteExporter extends RemotingSupport
Note that the service interface being used will show some signs of remotability, like the granularity of method calls that it offers. Furthermore, it has to have serializable arguments etc.
logger
Constructor and Description |
---|
RemoteExporter() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkService()
Check whether the service reference has been set.
|
protected void |
checkServiceInterface()
Check whether a service reference has been set,
and whether it matches the specified service.
|
protected String |
getExporterName()
Return a short name for this exporter.
|
protected Object |
getProxyForService()
Get a proxy for the given service object, implementing the specified
service interface.
|
Object |
getService()
Return the service to export.
|
Class<?> |
getServiceInterface()
Return the interface of the service to export.
|
void |
setInterceptors(Object[] interceptors)
Set additional interceptors (or advisors) to be applied before the
remote endpoint, e.g.
|
void |
setRegisterTraceInterceptor(boolean registerTraceInterceptor)
Set whether to register a RemoteInvocationTraceInterceptor for exported
services.
|
void |
setService(Object service)
Set the service to export.
|
void |
setServiceInterface(Class<?> serviceInterface)
Set the interface of the service to export.
|
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
public void setService(Object service)
public Object getService()
public void setServiceInterface(Class<?> serviceInterface)
public Class<?> getServiceInterface()
public void setRegisterTraceInterceptor(boolean registerTraceInterceptor)
getProxyForService
for creating the proxy to expose.
Default is "true". RemoteInvocationTraceInterceptor's most important value is that it logs exception stacktraces on the server, before propagating an exception to the client. Note that RemoteInvocationTraceInterceptor will not be registered by default if the "interceptors" property has been specified.
public void setInterceptors(Object[] interceptors)
You may specify any AOP Alliance MethodInterceptors or other Spring AOP Advices, as well as Spring AOP Advisors.
protected void checkService() throws IllegalArgumentException
IllegalArgumentException
setService(java.lang.Object)
protected void checkServiceInterface() throws IllegalArgumentException
protected Object getProxyForService()
Used to export a proxy that does not expose any internals but just
a specific interface intended for remote access. Furthermore, a
RemoteInvocationTraceInterceptor
will be registered (by default).
setServiceInterface(java.lang.Class<?>)
,
setRegisterTraceInterceptor(boolean)
,
RemoteInvocationTraceInterceptor
protected String getExporterName()
Default is the unqualified class name (without package). Can be overridden in subclasses.