Class SimpleHttpServerJaxWsServiceExporter
- java.lang.Object
- org.springframework.remoting.jaxws.AbstractJaxWsServiceExporter
- org.springframework.remoting.jaxws.SimpleHttpServerJaxWsServiceExporter
- All Implemented Interfaces:
Aware,BeanFactoryAware,DisposableBean,InitializingBean
@UsesSunHttpServer public class SimpleHttpServerJaxWsServiceExporter extends AbstractJaxWsServiceExporter
Simple exporter for JAX-WS services, autodetecting annotated service beans (through the JAX-WSjavax.jws.WebServiceannotation) and exporting them through the HTTP server included in Sun's JDK 1.6. The full address for each service will consist of the server's base address with the service name appended (e.g. "http://localhost:8080/OrderService").Note that this exporter will only work on Sun's JDK 1.6 or higher, as well as on JDKs that ship Sun's entire class library as included in the Sun JDK. For a portable JAX-WS exporter, have a look at
SimpleJaxWsServiceExporter.- Since:
- 2.5.5
- Author:
- Juergen Hoeller
- See Also:
javax.jws.WebService,javax.xml.ws.Endpoint#publish(Object),SimpleJaxWsServiceExporter
Constructor Summary
Constructors Constructor Description SimpleHttpServerJaxWsServiceExporter()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()Immediately publish all endpoints when fully configured.protected com.sun.net.httpserver.HttpContextbuildHttpContext(Endpoint endpoint, String serviceName)Build the HttpContext for the given endpoint.protected StringcalculateEndpointPath(Endpoint endpoint, String serviceName)Calculate the full endpoint path for the given endpoint.voiddestroy()Stops all published endpoints, taking the web services offline.protected voidpublishEndpoint(Endpoint endpoint, WebService annotation)Actually publish the given endpoint.protected voidpublishEndpoint(Endpoint endpoint, WebServiceProvider annotation)Actually publish the given endpoint.voidsetAuthenticator(com.sun.net.httpserver.Authenticator authenticator)Register a commonAuthenticatorto be applied to all detectedjavax.jws.WebServiceannotated beans.voidsetBacklog(int backlog)Specify the HTTP server's TCP backlog.voidsetBasePath(String basePath)Set the base path for context publication.voidsetFilters(List<com.sun.net.httpserver.Filter> filters)Register commonFiltersto be applied to all detectedjavax.jws.WebServiceannotated beans.voidsetHostname(String hostname)Specify the HTTP server's hostname to bind to.voidsetPort(int port)Specify the HTTP server's port.voidsetServer(com.sun.net.httpserver.HttpServer server)Specify an existing HTTP server to register the web service contexts with.voidsetShutdownDelay(int shutdownDelay)Specify the number of seconds to wait until HTTP exchanges have completed when shutting down the HTTP server.Methods inherited from class org.springframework.remoting.jaxws.AbstractJaxWsServiceExporter
createEndpoint, publishEndpoints, setBeanFactory, setBindingType, setEndpointFeatures, setEndpointProperties, setExecutor, setWebServiceFeatures
Constructor Detail
SimpleHttpServerJaxWsServiceExporter
public SimpleHttpServerJaxWsServiceExporter()
Method Detail
setServer
public void setServer(com.sun.net.httpserver.HttpServer server)
Specify an existing HTTP server to register the web service contexts with. This will typically be a server managed by the general SpringSimpleHttpServerFactoryBean.Alternatively, configure a local HTTP server through the
"port","hostname"and"backlog"properties (or rely on the defaults there).
setPort
public void setPort(int port)
Specify the HTTP server's port. Default is 8080.Only applicable for a locally configured HTTP server. Ignored when the
"server"property has been specified.
setHostname
public void setHostname(String hostname)
Specify the HTTP server's hostname to bind to. Default is localhost; can be overridden with a specific network address to bind to.Only applicable for a locally configured HTTP server. Ignored when the
"server"property has been specified.
setBacklog
public void setBacklog(int backlog)
Specify the HTTP server's TCP backlog. Default is -1, indicating the system's default value.Only applicable for a locally configured HTTP server. Ignored when the
"server"property has been specified.
setShutdownDelay
public void setShutdownDelay(int shutdownDelay)
Specify the number of seconds to wait until HTTP exchanges have completed when shutting down the HTTP server. Default is 0.Only applicable for a locally configured HTTP server. Ignored when the
"server"property has been specified.
setBasePath
public void setBasePath(String basePath)
Set the base path for context publication. Default is "/".For each context publication path, the service name will be appended to this base address. E.g. service name "OrderService" -> "/OrderService".
- See Also:
javax.xml.ws.Endpoint#publish(Object),javax.jws.WebService#serviceName()
setFilters
public void setFilters(List<com.sun.net.httpserver.Filter> filters)
Register commonFiltersto be applied to all detectedjavax.jws.WebServiceannotated beans.
setAuthenticator
public void setAuthenticator(com.sun.net.httpserver.Authenticator authenticator)
Register a commonAuthenticatorto be applied to all detectedjavax.jws.WebServiceannotated beans.
afterPropertiesSet
public void afterPropertiesSet() throws Exception
Description copied from class:AbstractJaxWsServiceExporterImmediately publish all endpoints when fully configured.- Specified by:
afterPropertiesSetin interfaceInitializingBean- Overrides:
afterPropertiesSetin classAbstractJaxWsServiceExporter- 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:
AbstractJaxWsServiceExporter.publishEndpoints()
publishEndpoint
protected void publishEndpoint(Endpoint endpoint, WebService annotation)
Description copied from class:AbstractJaxWsServiceExporterActually publish the given endpoint. To be implemented by subclasses.- Specified by:
publishEndpointin classAbstractJaxWsServiceExporter- Parameters:
endpoint- the JAX-WS Endpoint objectannotation- the service bean's WebService annotation
publishEndpoint
protected void publishEndpoint(Endpoint endpoint, WebServiceProvider annotation)
Description copied from class:AbstractJaxWsServiceExporterActually publish the given endpoint. To be implemented by subclasses.- Specified by:
publishEndpointin classAbstractJaxWsServiceExporter- Parameters:
endpoint- the JAX-WS Endpoint objectannotation- the service bean's WebService annotation
buildHttpContext
protected com.sun.net.httpserver.HttpContext buildHttpContext(Endpoint endpoint, String serviceName)
Build the HttpContext for the given endpoint.- Parameters:
endpoint- the JAX-WS Provider Endpoint objectserviceName- the given service name- Returns:
- the fully populated HttpContext
calculateEndpointPath
protected String calculateEndpointPath(Endpoint endpoint, String serviceName)
Calculate the full endpoint path for the given endpoint.- Parameters:
endpoint- the JAX-WS Provider Endpoint objectserviceName- the given service name- Returns:
- the full endpoint path
destroy
public void destroy()
Description copied from class:AbstractJaxWsServiceExporterStops all published endpoints, taking the web services offline.- Specified by:
destroyin interfaceDisposableBean- Overrides:
destroyin classAbstractJaxWsServiceExporter