|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory
org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor
Interceptor 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 (for example looked up via 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, though.
This invoker is typically used with an RMI service interface. Alternatively, this invoker can also proxy a JAX-RPC service with a matching non-RMI business interface, i.e. an interface that mirrors the RMI service methods but does not declare RemoteExceptions. In the latter case, RemoteExceptions thrown by the JAX-RPC stub will automatically get converted to Spring's unchecked RemoteAccessException.
If exposing the JAX-RPC port interface (i.e. an RMI interface) directly, setting "serviceInterface" is sufficient. If exposing a non-RMI business interface, the business interface needs to be set as "serviceInterface", and the JAX-RPC port interface as "portInterface".
setPortName(java.lang.String)
,
setServiceInterface(java.lang.Class)
,
setPortInterface(java.lang.Class)
,
Service.getPort(javax.xml.namespace.QName, java.lang.Class)
,
Stub
,
RemoteAccessException
,
JndiObjectFactoryBean
Field Summary |
Fields inherited from class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory |
logger |
Constructor Summary | |
JaxRpcPortClientInterceptor()
|
Method Summary | |
void |
afterPropertiesSet()
Create and initialize the JAX-RPC stub for the specified port. |
Properties |
getCustomProperties()
Return custom properties to be set on the stub for the port. |
String |
getEndpointAddress()
Return the endpoint address to specify on the stub. |
Service |
getJaxRpcService()
Return a reference to an existing JAX-RPC Service instance, if any. |
String |
getPassword()
Return the password to specify on the stub. |
Class |
getPortInterface()
Return the JAX-RPC port interface to use. |
String |
getPortName()
Return the name of the port. |
protected Remote |
getPortStub()
Return the underlying JAX-RPC port stub that this interceptor delegates to for each method invocation on the proxy. |
Class |
getServiceInterface()
Return the interface of the service that this factory should create a proxy for. |
String |
getUsername()
Return the username to specify on the stub. |
Object |
invoke(MethodInvocation invocation)
|
boolean |
isMaintainSession()
Return the maintain session flag to specify on the stub. |
protected void |
postProcessJaxRpcService(Service service)
Post-process the given JAX-RPC Service. |
protected void |
postProcessPortStub(Stub portStub)
Post-process the given JAX-RPC port stub. |
void |
setCustomProperties(Properties customProperties)
Set custom properties to be set on the stub for the port. |
void |
setEndpointAddress(String endpointAddress)
Set the endpoint address to specify on the stub. |
void |
setJaxRpcService(Service jaxRpcService)
Set a reference to an existing JAX-RPC Service instance, for example looked up via JndiObjectFactoryBean. |
void |
setMaintainSession(boolean maintainSession)
Set the maintain session flag to specify on the stub. |
void |
setPassword(String password)
Set the password to specify on the stub. |
void |
setPortInterface(Class portInterface)
Set the JAX-RPC port interface to use. |
void |
setPortName(String portName)
Set the name of the port. |
void |
setServiceInterface(Class serviceInterface)
Set the interface of the service that this factory should create a proxy for. |
void |
setUsername(String username)
Set the username to specify on the stub. |
Methods inherited from class org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory |
createJaxRpcService, createServiceFactory, getNamespaceUri, getQName, getServiceFactoryClass, getServiceName, getWsdlDocumentUrl, setNamespaceUri, setServiceFactoryClass, setServiceName, setWsdlDocumentUrl |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JaxRpcPortClientInterceptor()
Method Detail |
public void setJaxRpcService(Service jaxRpcService)
LocalJaxRpcServiceFactory.setServiceFactoryClass(java.lang.Class)
,
LocalJaxRpcServiceFactory.setWsdlDocumentUrl(java.net.URL)
,
LocalJaxRpcServiceFactory.setNamespaceUri(java.lang.String)
,
LocalJaxRpcServiceFactory.setServiceName(java.lang.String)
,
JndiObjectFactoryBean
public Service getJaxRpcService()
public void setPortName(String portName)
public String getPortName()
public void setUsername(String username)
Stub.USERNAME_PROPERTY
public String getUsername()
public void setPassword(String password)
Stub.PASSWORD_PROPERTY
public String getPassword()
public void setEndpointAddress(String endpointAddress)
Stub.ENDPOINT_ADDRESS_PROPERTY
public String getEndpointAddress()
public void setMaintainSession(boolean maintainSession)
Stub.SESSION_MAINTAIN_PROPERTY
public boolean isMaintainSession()
public void setCustomProperties(Properties customProperties)
Stub._setProperty(java.lang.String, java.lang.Object)
public Properties getCustomProperties()
public void setServiceInterface(Class serviceInterface)
The interface must be suitable for a JAX-RPC port, if "portInterface" is not set. Else, it must match the methods in the port interface but can be a non-RMI business interface.
setPortInterface(java.lang.Class)
public Class getServiceInterface()
public void setPortInterface(Class portInterface)
The interface must be suitable for a JAX-RPC port, i.e. it must be an
RMI service interface (that extends java.rmi.Remote
).
setServiceInterface(java.lang.Class)
,
Remote
public Class getPortInterface()
public void afterPropertiesSet() throws ServiceException
afterPropertiesSet
in interface InitializingBean
ServiceException
protected void postProcessJaxRpcService(Service service)
Just applied when creating a JAX-RPC Service instance locally, i.e. not applied when an existing Service reference is passed in.
service
- the current JAX-RPC ServiceafterPropertiesSet()
,
setJaxRpcService(javax.xml.rpc.Service)
,
Service.getTypeMappingRegistry()
protected void postProcessPortStub(Stub portStub)
portStub
- the current JAX-RPC port stubafterPropertiesSet()
protected Remote getPortStub()
public Object invoke(MethodInvocation invocation) throws Throwable
invoke
in interface MethodInterceptor
Throwable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |