Class AbstractJaxWsServiceExporter
- java.lang.Object
- org.springframework.remoting.jaxws.AbstractJaxWsServiceExporter
- All Implemented Interfaces:
Aware,BeanFactoryAware,DisposableBean,InitializingBean
- Direct Known Subclasses:
SimpleHttpServerJaxWsServiceExporter,SimpleJaxWsServiceExporter
public abstract class AbstractJaxWsServiceExporter extends Object implements BeanFactoryAware, InitializingBean, DisposableBean
Abstract exporter for JAX-WS services, autodetecting annotated service beans (through the JAX-WSjavax.jws.WebServiceannotation). Compatible with JAX-WS 2.1 and 2.2, as included in JDK 6 update 4+ and Java 7/8.Subclasses need to implement the
publishEndpoint(Endpoint, WebService)template methods for actual endpoint exposure.- Since:
- 2.5.5
- Author:
- Juergen Hoeller
- See Also:
javax.jws.WebService,javax.xml.ws.Endpoint,SimpleJaxWsServiceExporter,SimpleHttpServerJaxWsServiceExporter
Constructor Summary
Constructors Constructor Description AbstractJaxWsServiceExporter()
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidafterPropertiesSet()Immediately publish all endpoints when fully configured.protected EndpointcreateEndpoint(Object bean)Create the actual Endpoint instance.voiddestroy()Stops all published endpoints, taking the web services offline.protected abstract voidpublishEndpoint(Endpoint endpoint, WebService annotation)Actually publish the given endpoint.protected abstract voidpublishEndpoint(Endpoint endpoint, WebServiceProvider annotation)Actually publish the given provider endpoint.voidpublishEndpoints()Publish alljavax.jws.WebServiceannotated beans in the containing BeanFactory.voidsetBeanFactory(BeanFactory beanFactory)Obtains all web service beans and publishes them as JAX-WS endpoints.voidsetBindingType(String bindingType)Specify the binding type to use, overriding the value of the JAX-WSjavax.xml.ws.BindingTypeannotation.voidsetEndpointFeatures(WebServiceFeature... endpointFeatures)Specify WebServiceFeature objects (e.g.voidsetEndpointProperties(Map<String,Object> endpointProperties)Set the property bag for the endpoint, including properties such as "javax.xml.ws.wsdl.service" or "javax.xml.ws.wsdl.port".voidsetExecutor(Executor executor)Set the JDK concurrent executor to use for dispatching incoming requests to exported service instances.voidsetWebServiceFeatures(Object[] webServiceFeatures)Deprecated.as of Spring 4.0, in favor ofsetEndpointFeatures(WebServiceFeature...)
Constructor Detail
AbstractJaxWsServiceExporter
public AbstractJaxWsServiceExporter()
Method Detail
setEndpointProperties
public void setEndpointProperties(Map<String,Object> endpointProperties)
Set the property bag for the endpoint, including properties such as "javax.xml.ws.wsdl.service" or "javax.xml.ws.wsdl.port".- See Also:
javax.xml.ws.Endpoint#setProperties,javax.xml.ws.Endpoint#WSDL_SERVICE,javax.xml.ws.Endpoint#WSDL_PORT
setExecutor
public void setExecutor(Executor executor)
Set the JDK concurrent executor to use for dispatching incoming requests to exported service instances.- See Also:
javax.xml.ws.Endpoint#setExecutor
setBindingType
public void setBindingType(String bindingType)
Specify the binding type to use, overriding the value of the JAX-WSjavax.xml.ws.BindingTypeannotation.
setEndpointFeatures
public void setEndpointFeatures(WebServiceFeature... endpointFeatures)
Specify WebServiceFeature objects (e.g. as inner bean definitions) to apply to JAX-WS endpoint creation.- Since:
- 4.0
setWebServiceFeatures
@Deprecated public void setWebServiceFeatures(Object[] webServiceFeatures)
Deprecated.as of Spring 4.0, in favor ofsetEndpointFeatures(WebServiceFeature...)Allows for providing JAX-WS 2.2 WebServiceFeature specifications: in the form of actualjavax.xml.ws.WebServiceFeatureobjects, WebServiceFeature Class references, or WebServiceFeature class names.As of Spring 4.0, this is effectively just an alternative way of specifying
"endpointFeatures". Do not specify both properties at the same time; prefer "endpointFeatures" moving forward.
setBeanFactory
public void setBeanFactory(BeanFactory beanFactory)
Obtains all web service beans and publishes them as JAX-WS endpoints.- Specified by:
setBeanFactoryin interfaceBeanFactoryAware- Parameters:
beanFactory- owning BeanFactory (nevernull). The bean can immediately call methods on the factory.- See Also:
BeanInitializationException
afterPropertiesSet
public void afterPropertiesSet() throws Exception
Immediately publish all endpoints when fully configured.- Specified by:
afterPropertiesSetin interfaceInitializingBean- Throws:
Exception- in the event of misconfiguration (such as failure to set an essential property) or if initialization fails for any other reason- See Also:
publishEndpoints()
publishEndpoints
public void publishEndpoints()
Publish alljavax.jws.WebServiceannotated beans in the containing BeanFactory.
createEndpoint
@UsesJava7 protected Endpoint createEndpoint(Object bean)
Create the actual Endpoint instance.- Parameters:
bean- the service object to wrap- Returns:
- the Endpoint instance
- See Also:
Endpoint#create(Object),Endpoint#create(String, Object)
publishEndpoint
protected abstract void publishEndpoint(Endpoint endpoint, WebService annotation)
Actually publish the given endpoint. To be implemented by subclasses.- Parameters:
endpoint- the JAX-WS Endpoint objectannotation- the service bean's WebService annotation
publishEndpoint
protected abstract void publishEndpoint(Endpoint endpoint, WebServiceProvider annotation)
Actually publish the given provider endpoint. To be implemented by subclasses.- Parameters:
endpoint- the JAX-WS Provider Endpoint objectannotation- the service bean's WebServiceProvider annotation
destroy
public void destroy()
Stops all published endpoints, taking the web services offline.- Specified by:
destroyin interfaceDisposableBean