java.lang.Object | ||
↳ | org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory | |
↳ | org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor |
Known Direct Subclasses |
This class is deprecated.
in favor of JAX-WS support in org.springframework.remoting.jaxws
org.aopalliance.intercept.MethodInterceptor for accessing a specific port
of a JAX-RPC service. Uses either LocalJaxRpcServiceFactory
's facilities
underneath or takes an explicit reference to an existing JAX-RPC Service instance
(e.g. obtained via a JndiObjectFactoryBean
).
Allows to set JAX-RPC's standard stub properties directly, via the "username", "password", "endpointAddress" and "maintainSession" properties. For typical usage, it is not necessary to specify those.
In standard JAX-RPC style, this invoker is used with an RMI service interface. Alternatively, this invoker can also proxy a JAX-RPC service with a matching non-RMI business interface, that is, an interface that declares the service methods without RemoteExceptions. In the latter case, RemoteExceptions thrown by JAX-RPC will automatically get converted to Spring's unchecked RemoteAccessException.
Setting "serviceInterface" is usually sufficient: The invoker will automatically use JAX-RPC "dynamic invocations" via the Call API in this case, no matter whether the specified interface is an RMI or non-RMI interface. Alternatively, a corresponding JAX-RPC port interface can be specified as "portInterface", which will turn this invoker into "static invocation" mode (operating on a standard JAX-RPC port stub).
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Add a custom property to this JAX-RPC Stub/Call.
| |||||||||||
Prepares the JAX-RPC service and port if the "lookupServiceOnStartup"
is turned on (which it is by default).
| |||||||||||
Allow Map access to the custom properties to be set on the stub
or call, with the option to add or override specific entries.
| |||||||||||
Return the endpoint address to specify on the stub or call.
| |||||||||||
Return a reference to an existing JAX-RPC Service instance, if any.
| |||||||||||
Return the password to specify on the stub or call.
| |||||||||||
Return the JAX-RPC port interface to use.
| |||||||||||
Return the name of the port.
| |||||||||||
Return the interface of the service that this factory should create a proxy for.
| |||||||||||
Return the username to specify on the stub or call.
| |||||||||||
Translates the method invocation into a JAX-RPC service invocation.
| |||||||||||
Return the maintain session flag to specify on the stub or call.
| |||||||||||
Create and initialize the JAX-RPC service for the specified port.
| |||||||||||
Set custom properties to be set on the stub or call.
| |||||||||||
Set custom properties to be set on the stub or call.
| |||||||||||
Set the endpoint address to specify on the stub or call.
| |||||||||||
Set a reference to an existing JAX-RPC Service instance,
for example obtained via
JndiObjectFactoryBean . | |||||||||||
Set whether to look up the JAX-RPC service on startup.
| |||||||||||
Set the maintain session flag to specify on the stub or call.
| |||||||||||
Set the password to specify on the stub or call.
| |||||||||||
Set the JAX-RPC port interface to use.
| |||||||||||
Set the name of the port.
| |||||||||||
Set whether to refresh the JAX-RPC service on connect failure,
that is, whenever a JAX-RPC invocation throws a RemoteException.
| |||||||||||
Set the interface of the service that this factory should create a proxy for.
| |||||||||||
Set the username to specify on the stub or call.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return whether to always use JAX-RPC dynamic calls.
| |||||||||||
Perform a JAX-RPC service invocation on the given port stub.
| |||||||||||
Perform a JAX-RPC service invocation based on the given method invocation.
| |||||||||||
Return the prepared QName for the port.
| |||||||||||
Return the underlying JAX-RPC port stub that this interceptor delegates to
for each method invocation on the proxy.
| |||||||||||
Handle the given RemoteException that was thrown from a JAX-RPC port stub
or JAX-RPC call invocation.
| |||||||||||
Determine whether the given RMI exception indicates a connect failure.
| |||||||||||
Return whether this client interceptor has already been prepared,
i.e.
| |||||||||||
Perform a JAX-RPC dynamic call for the given AOP method invocation.
| |||||||||||
Post-process the given JAX-RPC call.
| |||||||||||
Post-process the given JAX-RPC port stub.
| |||||||||||
Prepare the given JAX-RPC call, applying properties to it.
| |||||||||||
Prepare the given JAX-RPC port stub, applying properties to it.
| |||||||||||
Reset the prepared service of this interceptor,
allowing for reinitialization on next access.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.beans.factory.InitializingBean
|
Add a custom property to this JAX-RPC Stub/Call.
name | the name of the attribute to expose |
---|---|
value | the attribute value to expose |
Prepares the JAX-RPC service and port if the "lookupServiceOnStartup" is turned on (which it is by default).
Allow Map access to the custom properties to be set on the stub or call, with the option to add or override specific entries.
Useful for specifying entries directly, for example via "customPropertyMap[myKey]". This is particularly useful for adding or overriding entries in child bean definitions.
Return a reference to an existing JAX-RPC Service instance, if any.
Return the interface of the service that this factory should create a proxy for.
Translates the method invocation into a JAX-RPC service invocation.
Prepares the service on the fly, if necessary, in case of lazy lookup or a connect failure having happened.
Throwable |
---|
Return the maintain session flag to specify on the stub or call.
Create and initialize the JAX-RPC service for the specified port.
Prepares a JAX-RPC stub if possible (if an RMI interface is available);
falls back to JAX-RPC dynamic calls else. Using dynamic calls can be enforced
through overriding alwaysUseJaxRpcCall()
to return true
.
postProcessJaxRpcService(Service)
and postProcessPortStub(Stub)
hooks are available for customization in subclasses. When using dynamic calls,
each can be post-processed via postProcessJaxRpcCall(Call, MethodInvocation)
.
RemoteLookupFailureException | if service initialization or port stub creation failed |
---|
Set custom properties to be set on the stub or call.
Can be populated with a String "value" (parsed via PropertiesEditor) or a "props" element in XML bean definitions.
Set custom properties to be set on the stub or call.
Can be populated with a "map" or "props" element in XML bean definitions.
Set the endpoint address to specify on the stub or call.
Set a reference to an existing JAX-RPC Service instance,
for example obtained via JndiObjectFactoryBean
.
If not set, LocalJaxRpcServiceFactory
's properties have to be specified.
Set whether to look up the JAX-RPC service on startup.
Default is "true". Turn this flag off to allow for late start of the target server. In this case, the JAX-RPC service will be lazily fetched on first access.
Set the maintain session flag to specify on the stub or call.
Set the JAX-RPC port interface to use. Only needs to be set if a JAX-RPC port stub should be used instead of the dynamic call mechanism. See the javadoc of the "serviceInterface" property for more details.
The interface must be suitable for a JAX-RPC port, that is, it must be
an RMI service interface (that extends java.rmi.Remote
).
NOTE: Check whether your JAX-RPC provider returns thread-safe port stubs. If not, use the dynamic call mechanism instead, which will always be thread-safe. In particular, do not use JAX-RPC port stubs with Apache Axis, whose port stubs are known to be non-thread-safe.
getPort(Class)
setServiceInterface(Class)
Set the name of the port. Corresponds to the "wsdl:port" name.
Set whether to refresh the JAX-RPC service on connect failure, that is, whenever a JAX-RPC invocation throws a RemoteException.
Default is "false", keeping a reference to the JAX-RPC service in any case, retrying the next invocation on the same service even in case of failure. Turn this flag on to reinitialize the entire service in case of connect failures.
Set the interface of the service that this factory should create a proxy for. This will typically be a non-RMI business interface, although you can also use an RMI port interface as recommended by JAX-RPC here.
Calls on the specified service interface will either be translated to the underlying RMI port interface (in case of a "portInterface" being specified) or to dynamic calls (using the JAX-RPC Dynamic Invocation Interface).
The dynamic call mechanism has the advantage that you don't need to maintain an RMI port interface in addition to an existing non-RMI business interface. In terms of configuration, specifying the business interface as "serviceInterface" will be enough; this interceptor will automatically use dynamic calls in such a scenario.
Return whether to always use JAX-RPC dynamic calls.
Called by afterPropertiesSet
.
Default is "false"; if an RMI interface is specified as "portInterface" or "serviceInterface", it will be used to create a JAX-RPC port stub.
Can be overridden to enforce the use of the JAX-RPC Call API, for example if there is a need to customize at the Call level. This just necessary if you you want to use an RMI interface as "serviceInterface", though; in case of only a non-RMI interface being available, this interceptor will fall back to the Call API anyway.
Perform a JAX-RPC service invocation on the given port stub.
invocation | the AOP method invocation |
---|---|
portStub | the RMI port stub to invoke |
Throwable | in case of invocation failure |
---|
getPortStub()
performJaxRpcCall(MethodInvocation, Service)
Perform a JAX-RPC service invocation based on the given method invocation.
Uses traditional RMI stub invocation if a JAX-RPC port stub is available; falls back to JAX-RPC dynamic calls else.
invocation | the AOP method invocation |
---|
Throwable | in case of invocation failure |
---|
getPortStub()
Return the underlying JAX-RPC port stub that this interceptor delegates to for each method invocation on the proxy.
Handle the given RemoteException that was thrown from a JAX-RPC port stub or JAX-RPC call invocation.
method | the service interface method that we invoked |
---|---|
ex | the original RemoteException |
null
)
Determine whether the given RMI exception indicates a connect failure.
The default implementation returns true
unless the
exception class name (or exception superclass name) contains the term
"Fault" (e.g. "AxisFault"), assuming that the JAX-RPC provider only
throws RemoteException in case of WSDL faults and connect failures.
ex | the RMI exception to check |
---|
Return whether this client interceptor has already been prepared, i.e. has already looked up the JAX-RPC service and port.
Perform a JAX-RPC dynamic call for the given AOP method invocation.
Delegates to prepareJaxRpcCall(Call)
and
postProcessJaxRpcCall(Call, MethodInvocation)
for setting up the call object.
The default implementation uses method name as JAX-RPC operation name and method arguments as arguments for the JAX-RPC call. Can be overridden in subclasses for custom operation names and/or arguments.
invocation | the current AOP MethodInvocation that should be converted to a JAX-RPC call |
---|---|
service | the JAX-RPC Service to use for the call |
Throwable | the exception thrown by the invocation, if any |
---|
Post-process the given JAX-RPC call. Called by invoke(MethodInvocation)
.
The default implementation is empty.
Just applied when actually using JAX-RPC dynamic calls, i.e. if no compliant port interface was specified. Else, a JAX-RPC port stub will be used.
call | the current JAX-RPC call object (can be cast to an implementation-specific class if necessary) |
---|---|
invocation | the current AOP MethodInvocation that the call was created for (can be used to check method name, method parameters and/or passed-in arguments) |
Post-process the given JAX-RPC port stub. Called by prepare()
.
The default implementation is empty.
Just applied when actually creating a JAX-RPC port stub, in case of a compliant port interface. Else, JAX-RPC dynamic calls will be used.
stub | the current JAX-RPC port stub (can be cast to an implementation-specific class if necessary) |
---|
Prepare the given JAX-RPC call, applying properties to it. Called by invoke(MethodInvocation)
.
Just applied when actually using JAX-RPC dynamic calls, i.e. if no compliant port interface was specified. Else, a JAX-RPC port stub will be used.
call | the current JAX-RPC call object |
---|
Prepare the given JAX-RPC port stub, applying properties to it.
Called by prepare()
.
Just applied when actually creating a JAX-RPC port stub, in case of a compliant port interface. Else, JAX-RPC dynamic calls will be used.
stub | the current JAX-RPC port stub |
---|
Reset the prepared service of this interceptor, allowing for reinitialization on next access.