public class

JaxWsPortClientInterceptor

extends LocalJaxWsServiceFactory
implements BeanClassLoaderAware InitializingBean
java.lang.Object
   ↳ org.springframework.remoting.jaxws.LocalJaxWsServiceFactory
     ↳ org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
Known Direct Subclasses

Class Overview

org.aopalliance.intercept.MethodInterceptor for accessing a specific port of a JAX-WS service. Compatible with JAX-WS 2.0, 2.1 and 2.2.

Uses either LocalJaxWsServiceFactory's facilities underneath, or takes an explicit reference to an existing JAX-WS Service instance (e.g. obtained via JndiObjectFactoryBean).

Summary

Public Constructors
JaxWsPortClientInterceptor()
Public Methods
void addCustomProperty(String name, Object value)
Add a custom property to this JAX-WS BindingProvider.
void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
Map<StringObject> getCustomProperties()
Allow Map access to the custom properties to be set on the stub, with the option to add or override specific entries.
String getEndpointAddress()
Return the endpoint address to specify on the stub.
Service getJaxWsService()
Return a reference to an existing JAX-WS Service instance, if any.
String getPassword()
Return the password to specify on the stub.
String getPortName()
Return the name of the port.
Class<?> getServiceInterface()
Return the interface of the service that this factory should create a proxy for.
String getSoapActionUri()
Return the SOAP action URI to specify on the stub.
String getUsername()
Return the username to specify on the stub.
Object invoke(MethodInvocation invocation)
boolean isMaintainSession()
Return the "session.maintain" flag to specify on the stub.
boolean isUseSoapAction()
Return the "soapaction.use" flag to specify on the stub.
void prepare()
Initialize the JAX-WS port for this interceptor.
void setBeanClassLoader(ClassLoader classLoader)
Set the bean ClassLoader to use for this interceptor: for resolving WebServiceFeature class names as specified through setWebServiceFeatures(Object[]), and also for building a client proxy in the JaxWsPortProxyFactoryBean subclass.
void setCustomProperties(Map<StringObject> customProperties)
Set custom properties to be set on the stub.
void setEndpointAddress(String endpointAddress)
Set the endpoint address to specify on the stub.
void setJaxWsService(Service jaxWsService)
Set a reference to an existing JAX-WS Service instance, for example obtained via JndiObjectFactoryBean.
void setLookupServiceOnStartup(boolean lookupServiceOnStartup)
Set whether to look up the JAX-WS service on startup.
void setMaintainSession(boolean maintainSession)
Set the "session.maintain" flag to specify on the stub.
void setPassword(String password)
Set the password to specify on the stub.
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 setSoapActionUri(String soapActionUri)
Set the SOAP action URI to specify on the stub.
void setUseSoapAction(boolean useSoapAction)
Set the "soapaction.use" flag to specify on the stub.
void setUsername(String username)
Set the username to specify on the stub.
void setWebServiceFeatures(Object[] webServiceFeatures)
Allows for providing JAX-WS 2.1 WebServiceFeature specifications: in the form of actual javax.xml.ws.WebServiceFeature objects, WebServiceFeature Class references, or WebServiceFeature class names.
Protected Methods
void applyDefaultsFromAnnotation(WebService ann)
Initialize this client interceptor's properties from the given WebService annotation, if necessary and possible (i.e.
Object doInvoke(MethodInvocation invocation)
Perform a JAX-WS service invocation based on the given method invocation.
Object doInvoke(MethodInvocation invocation, Object portStub)
Perform a JAX-WS service invocation on the given port stub.
ClassLoader getBeanClassLoader()
Return the bean ClassLoader to use for this interceptor.
final QName getPortQName()
Return the prepared QName for the port.
Object getPortStub()
Return the underlying JAX-WS port stub that this interceptor delegates to for each method invocation on the proxy.
Object getPortStub(Service service, QName portQName)
Obtain the port stub from the given JAX-WS Service.
boolean isPrepared()
Return whether this client interceptor has already been prepared, i.e.
void preparePortStub(Object stub)
Prepare the given JAX-WS port stub, applying properties to it.
[Expand]
Inherited Methods
From class org.springframework.remoting.jaxws.LocalJaxWsServiceFactory
From class java.lang.Object
From interface org.springframework.beans.factory.BeanClassLoaderAware
From interface org.springframework.beans.factory.InitializingBean

Public Constructors

public JaxWsPortClientInterceptor ()

Public Methods

public void addCustomProperty (String name, Object value)

Add a custom property to this JAX-WS BindingProvider.

Parameters
name the name of the attribute to expose
value the attribute value to expose

public void afterPropertiesSet ()

Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

public Map<StringObject> getCustomProperties ()

Allow Map access to the custom properties to be set on the stub, with the option to add or override specific entries.

Useful for specifying entries directly, for example via "customProperties[myKey]". This is particularly useful for adding or overriding entries in child bean definitions.

public String getEndpointAddress ()

Return the endpoint address to specify on the stub.

public Service getJaxWsService ()

Return a reference to an existing JAX-WS Service instance, if any.

public String getPassword ()

Return the password to specify on the stub.

public String getPortName ()

Return the name of the port.

public Class<?> getServiceInterface ()

Return the interface of the service that this factory should create a proxy for.

public String getSoapActionUri ()

Return the SOAP action URI to specify on the stub.

public String getUsername ()

Return the username to specify on the stub.

public Object invoke (MethodInvocation invocation)

Throws
Throwable

public boolean isMaintainSession ()

Return the "session.maintain" flag to specify on the stub.

public boolean isUseSoapAction ()

Return the "soapaction.use" flag to specify on the stub.

public void prepare ()

Initialize the JAX-WS port for this interceptor.

public void setBeanClassLoader (ClassLoader classLoader)

Set the bean ClassLoader to use for this interceptor: for resolving WebServiceFeature class names as specified through setWebServiceFeatures(Object[]), and also for building a client proxy in the JaxWsPortProxyFactoryBean subclass.

Parameters
classLoader the owning class loader; may be null in which case a default ClassLoader must be used, for example the ClassLoader obtained via getDefaultClassLoader()

public void setCustomProperties (Map<StringObject> customProperties)

Set custom properties to be set on the stub.

Can be populated with a String "value" (parsed via PropertiesEditor) or a "props" element in XML bean definitions.

public void setEndpointAddress (String endpointAddress)

Set the endpoint address to specify on the stub.

public void setJaxWsService (Service jaxWsService)

Set a reference to an existing JAX-WS Service instance, for example obtained via JndiObjectFactoryBean. If not set, LocalJaxWsServiceFactory's properties have to be specified.

public void setLookupServiceOnStartup (boolean lookupServiceOnStartup)

Set whether to look up the JAX-WS service on startup.

Default is "true". Turn this flag off to allow for late start of the target server. In this case, the JAX-WS service will be lazily fetched on first access.

public void setMaintainSession (boolean maintainSession)

Set the "session.maintain" flag to specify on the stub.

public void setPassword (String password)

Set the password to specify on the stub.

public void setPortName (String portName)

Set the name of the port. Corresponds to the "wsdl:port" name.

public void setServiceInterface (Class<?> serviceInterface)

Set the interface of the service that this factory should create a proxy for.

public void setSoapActionUri (String soapActionUri)

Set the SOAP action URI to specify on the stub.

public void setUseSoapAction (boolean useSoapAction)

Set the "soapaction.use" flag to specify on the stub.

public void setUsername (String username)

Set the username to specify on the stub.

public void setWebServiceFeatures (Object[] webServiceFeatures)

Allows for providing JAX-WS 2.1 WebServiceFeature specifications: in the form of actual javax.xml.ws.WebServiceFeature objects, WebServiceFeature Class references, or WebServiceFeature class names.

Protected Methods

protected void applyDefaultsFromAnnotation (WebService ann)

Initialize this client interceptor's properties from the given WebService annotation, if necessary and possible (i.e. if "wsdlDocumentUrl", "namespaceUri", "serviceName" and "portName" haven't been set but corresponding values are declared at the annotation level of the specified service interface).

Parameters
ann the WebService annotation found on the specified service interface

protected Object doInvoke (MethodInvocation invocation)

Perform a JAX-WS service invocation based on the given method invocation.

Parameters
invocation the AOP method invocation
Returns
  • the invocation result, if any
Throws
Throwable in case of invocation failure
See Also
  • getPortStub()
  • #doInvoke(org.aopalliance.intercept.MethodInvocation, Object)

protected Object doInvoke (MethodInvocation invocation, Object portStub)

Perform a JAX-WS service invocation on the given port stub.

Parameters
invocation the AOP method invocation
portStub the RMI port stub to invoke
Returns
  • the invocation result, if any
Throws
Throwable in case of invocation failure
See Also

protected ClassLoader getBeanClassLoader ()

Return the bean ClassLoader to use for this interceptor.

protected final QName getPortQName ()

Return the prepared QName for the port.

protected Object getPortStub ()

Return the underlying JAX-WS port stub that this interceptor delegates to for each method invocation on the proxy.

protected Object getPortStub (Service service, QName portQName)

Obtain the port stub from the given JAX-WS Service.

Parameters
service the Service object to obtain the port from
portQName the name of the desired port, if specified
Returns
  • the corresponding port object as returned from Service.getPort(...)

protected boolean isPrepared ()

Return whether this client interceptor has already been prepared, i.e. has already looked up the JAX-WS service and port.

protected void preparePortStub (Object stub)

Prepare the given JAX-WS port stub, applying properties to it. Called by prepare().

Parameters
stub the current JAX-WS port stub