类 JaxWsPortClientInterceptor
- java.lang.Object
- org.springframework.remoting.jaxws.LocalJaxWsServiceFactory
- org.springframework.remoting.jaxws.JaxWsPortClientInterceptor
- 所有已实现的接口:
Advice,Interceptor,MethodInterceptor,Aware,BeanClassLoaderAware,InitializingBean
- 直接已知子类:
JaxWsPortProxyFactoryBean
public class JaxWsPortClientInterceptor extends LocalJaxWsServiceFactory implements MethodInterceptor, BeanClassLoaderAware, InitializingBean
MethodInterceptorfor accessing a specific port of a JAX-WS service.Uses either
LocalJaxWsServiceFactory's facilities underneath, or takes an explicit reference to an existing JAX-WS Service instance (e.g. obtained viaJndiObjectFactoryBean).
构造器概要
构造器 构造器 说明 JaxWsPortClientInterceptor()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddCustomProperty(String name, Object value)Add a custom property to this JAX-WS BindingProvider.voidafterPropertiesSet()Invoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.protected voidapplyDefaultsFromAnnotation(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).protected ObjectdoInvoke(MethodInvocation invocation)Perform a JAX-WS service invocation based on the given method invocation.protected ObjectdoInvoke(MethodInvocation invocation, Object portStub)Perform a JAX-WS service invocation on the given port stub.protected ClassLoadergetBeanClassLoader()Return the bean ClassLoader to use for this interceptor.Map<String,Object>getCustomProperties()Allow Map access to the custom properties to be set on the stub, with the option to add or override specific entries.StringgetEndpointAddress()Return the endpoint address to specify on the stub.ServicegetJaxWsService()Return a reference to an existing JAX-WS Service instance, if any.StringgetPassword()Return the password to specify on the stub.StringgetPortName()Return the name of the port.protected QNamegetPortQName()Return the prepared QName for the port.protected ObjectgetPortStub()Return the underlying JAX-WS port stub that this interceptor delegates to for each method invocation on the proxy.protected ObjectgetPortStub(Service service, QName portQName)Obtain the port stub from the given JAX-WS Service.Class<?>getServiceInterface()Return the interface of the service that this factory should create a proxy for.StringgetSoapActionUri()Return the SOAP action URI to specify on the stub.StringgetUsername()Return the username to specify on the stub.Objectinvoke(MethodInvocation invocation)Implement this method to perform extra treatments before and after the invocation.booleanisMaintainSession()Return the "session.maintain" flag to specify on the stub.protected booleanisPrepared()Return whether this client interceptor has already been prepared, i.e. has already looked up the JAX-WS service and port.booleanisUseSoapAction()Return the "soapaction.use" flag to specify on the stub.voidprepare()Initialize the JAX-WS port for this interceptor.protected voidpreparePortStub(Object stub)Prepare the given JAX-WS port stub, applying properties to it.voidsetBeanClassLoader(ClassLoader classLoader)Set the bean ClassLoader to use for this interceptor: primarily for building a client proxy in theJaxWsPortProxyFactoryBeansubclass.voidsetCustomProperties(Map<String,Object> customProperties)Set custom properties to be set on the stub.voidsetEndpointAddress(String endpointAddress)Set the endpoint address to specify on the stub.voidsetJaxWsService(Service jaxWsService)Set a reference to an existing JAX-WS Service instance, for example obtained viaJndiObjectFactoryBean.voidsetLookupServiceOnStartup(boolean lookupServiceOnStartup)Set whether to look up the JAX-WS service on startup.voidsetMaintainSession(boolean maintainSession)Set the "session.maintain" flag to specify on the stub.voidsetPassword(String password)Set the password to specify on the stub.voidsetPortFeatures(WebServiceFeature... features)Specify WebServiceFeature objects (e.g. as inner bean definitions) to apply to JAX-WS port stub creation.voidsetPortName(String portName)Set the name of the port.voidsetServiceInterface(Class<?> serviceInterface)Set the interface of the service that this factory should create a proxy for.voidsetSoapActionUri(String soapActionUri)Set the SOAP action URI to specify on the stub.voidsetUsername(String username)Set the username to specify on the stub.voidsetUseSoapAction(boolean useSoapAction)Set the "soapaction.use" flag to specify on the stub.从类继承的方法 org.springframework.remoting.jaxws.LocalJaxWsServiceFactory
createJaxWsService, getNamespaceUri, getQName, getServiceName, getWsdlDocumentUrl, setExecutor, setHandlerResolver, setNamespaceUri, setServiceFeatures, setServiceName, setWsdlDocumentResource, setWsdlDocumentUrl
构造器详细资料
JaxWsPortClientInterceptor
public JaxWsPortClientInterceptor()
方法详细资料
setJaxWsService
public void setJaxWsService(@Nullable Service jaxWsService)
Set a reference to an existing JAX-WS Service instance, for example obtained viaJndiObjectFactoryBean. If not set,LocalJaxWsServiceFactory's properties have to be specified.
getJaxWsService
@Nullable public Service getJaxWsService()
Return a reference to an existing JAX-WS Service instance, if any.
setPortName
public void setPortName(@Nullable String portName)
Set the name of the port. Corresponds to the "wsdl:port" name.
getPortName
@Nullable public String getPortName()
Return the name of the port.
setUsername
public void setUsername(@Nullable String username)
Set the username to specify on the stub.
getUsername
@Nullable public String getUsername()
Return the username to specify on the stub.
setPassword
public void setPassword(@Nullable String password)
Set the password to specify on the stub.
getPassword
@Nullable public String getPassword()
Return the password to specify on the stub.
setEndpointAddress
public void setEndpointAddress(@Nullable String endpointAddress)
Set the endpoint address to specify on the stub.
getEndpointAddress
@Nullable public String getEndpointAddress()
Return the endpoint address to specify on the stub.
setMaintainSession
public void setMaintainSession(boolean maintainSession)
Set the "session.maintain" flag to specify on the stub.
isMaintainSession
public boolean isMaintainSession()
Return the "session.maintain" flag to specify on the stub.
setUseSoapAction
public void setUseSoapAction(boolean useSoapAction)
Set the "soapaction.use" flag to specify on the stub.
isUseSoapAction
public boolean isUseSoapAction()
Return the "soapaction.use" flag to specify on the stub.
setSoapActionUri
public void setSoapActionUri(@Nullable String soapActionUri)
Set the SOAP action URI to specify on the stub.
getSoapActionUri
@Nullable public String getSoapActionUri()
Return the SOAP action URI to specify on the stub.
setCustomProperties
public void setCustomProperties(Map<String,Object> 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.
getCustomProperties
public Map<String,Object> 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.
addCustomProperty
public void addCustomProperty(String name, Object value)
Add a custom property to this JAX-WS BindingProvider.- 参数:
name- the name of the attribute to exposevalue- the attribute value to expose- 另请参阅:
BindingProvider.getRequestContext()
setPortFeatures
public void setPortFeatures(WebServiceFeature... features)
Specify WebServiceFeature objects (e.g. as inner bean definitions) to apply to JAX-WS port stub creation.
setServiceInterface
public void setServiceInterface(@Nullable Class<?> serviceInterface)
Set the interface of the service that this factory should create a proxy for.
getServiceInterface
@Nullable public Class<?> getServiceInterface()
Return the interface of the service that this factory should create a proxy for.
setLookupServiceOnStartup
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.
setBeanClassLoader
public void setBeanClassLoader(@Nullable ClassLoader classLoader)
Set the bean ClassLoader to use for this interceptor: primarily for building a client proxy in theJaxWsPortProxyFactoryBeansubclass.- 指定者:
setBeanClassLoader在接口中BeanClassLoaderAware- 参数:
classLoader- the owning class loader
getBeanClassLoader
@Nullable protected ClassLoader getBeanClassLoader()
Return the bean ClassLoader to use for this interceptor.
afterPropertiesSet
public void afterPropertiesSet()
从接口复制的说明:InitializingBeanInvoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
- 指定者:
afterPropertiesSet在接口中InitializingBean
prepare
public void prepare()
Initialize the JAX-WS port for this interceptor.
applyDefaultsFromAnnotation
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).- 参数:
ann- the WebService annotation found on the specified service interface
isPrepared
protected boolean isPrepared()
Return whether this client interceptor has already been prepared, i.e. has already looked up the JAX-WS service and port.
getPortQName
@Nullable protected final QName getPortQName()
Return the prepared QName for the port.
getPortStub
protected Object getPortStub(Service service, @Nullable QName portQName)
Obtain the port stub from the given JAX-WS Service.- 参数:
service- the Service object to obtain the port fromportQName- the name of the desired port, if specified- 返回:
- the corresponding port object as returned from
Service.getPort(...)
preparePortStub
protected void preparePortStub(Object stub)
Prepare the given JAX-WS port stub, applying properties to it. Called byprepare().- 参数:
stub- the current JAX-WS port stub- 另请参阅:
setUsername(java.lang.String),setPassword(java.lang.String),setEndpointAddress(java.lang.String),setMaintainSession(boolean),setCustomProperties(java.util.Map<java.lang.String, java.lang.Object>)
getPortStub
@Nullable protected Object getPortStub()
Return the underlying JAX-WS port stub that this interceptor delegates to for each method invocation on the proxy.
invoke
@Nullable public Object invoke(MethodInvocation invocation) throws Throwable
从接口复制的说明:MethodInterceptorImplement this method to perform extra treatments before and after the invocation. Polite implementations would certainly like to invokeJoinpoint.proceed().- 指定者:
invoke在接口中MethodInterceptor- 参数:
invocation- the method invocation joinpoint- 返回:
- the result of the call to
Joinpoint.proceed(); might be intercepted by the interceptor - 抛出:
Throwable- if the interceptors or the target object throws an exception
doInvoke
@Nullable protected Object doInvoke(MethodInvocation invocation) throws Throwable
Perform a JAX-WS service invocation based on the given method invocation.- 参数:
invocation- the AOP method invocation- 返回:
- the invocation result, if any
- 抛出:
Throwable- in case of invocation failure- 另请参阅:
getPortStub(),doInvoke(org.aopalliance.intercept.MethodInvocation, Object)
doInvoke
@Nullable protected Object doInvoke(MethodInvocation invocation, @Nullable Object portStub) throws Throwable
Perform a JAX-WS service invocation on the given port stub.- 参数:
invocation- the AOP method invocationportStub- the RMI port stub to invoke- 返回:
- the invocation result, if any
- 抛出:
Throwable- in case of invocation failure- 另请参阅:
getPortStub()