@UsesSunHttpServer public class SimpleHttpServerJaxWsServiceExporter extends AbstractJaxWsServiceExporter
WebService
annotation) 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
.
WebService
,
Endpoint.publish(Object)
,
SimpleJaxWsServiceExporter
Constructor and Description |
---|
SimpleHttpServerJaxWsServiceExporter() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Immediately publish all endpoints when fully configured.
|
protected com.sun.net.httpserver.HttpContext |
buildHttpContext(Endpoint endpoint,
java.lang.String serviceName)
Build the HttpContext for the given endpoint.
|
protected java.lang.String |
calculateEndpointPath(Endpoint endpoint,
java.lang.String serviceName)
Calculate the full endpoint path for the given endpoint.
|
void |
destroy()
Stops all published endpoints, taking the web services offline.
|
protected void |
publishEndpoint(Endpoint endpoint,
WebService annotation)
Actually publish the given endpoint.
|
protected void |
publishEndpoint(Endpoint endpoint,
WebServiceProvider annotation)
Actually publish the given provider endpoint.
|
void |
setAuthenticator(com.sun.net.httpserver.Authenticator authenticator)
Register a common
Authenticator to be
applied to all detected WebService annotated beans. |
void |
setBacklog(int backlog)
Specify the HTTP server's TCP backlog.
|
void |
setBasePath(java.lang.String basePath)
Set the base path for context publication.
|
void |
setFilters(java.util.List<com.sun.net.httpserver.Filter> filters)
Register common
Filters to be
applied to all detected WebService annotated beans. |
void |
setHostname(java.lang.String hostname)
Specify the HTTP server's hostname to bind to.
|
void |
setPort(int port)
Specify the HTTP server's port.
|
void |
setServer(com.sun.net.httpserver.HttpServer server)
Specify an existing HTTP server to register the web service contexts
with.
|
void |
setShutdownDelay(int shutdownDelay)
Specify the number of seconds to wait until HTTP exchanges have
completed when shutting down the HTTP server.
|
createEndpoint, publishEndpoints, setBeanFactory, setBindingType, setEndpointFeatures, setEndpointProperties, setExecutor
protected final Log logger
public SimpleHttpServerJaxWsServiceExporter()
public void setServer(com.sun.net.httpserver.HttpServer server)
SimpleHttpServerFactoryBean
.
Alternatively, configure a local HTTP server through the
"port"
, "hostname"
and
"backlog"
properties (or rely on the defaults there).
public void setPort(int port)
Only applicable for a locally configured HTTP server.
Ignored when the "server"
property has been specified.
public void setHostname(java.lang.String hostname)
Only applicable for a locally configured HTTP server.
Ignored when the "server"
property has been specified.
public void setBacklog(int backlog)
Only applicable for a locally configured HTTP server.
Ignored when the "server"
property has been specified.
public void setShutdownDelay(int shutdownDelay)
Only applicable for a locally configured HTTP server.
Ignored when the "server"
property has been specified.
public void setBasePath(java.lang.String basePath)
For each context publication path, the service name will be appended to this base address. E.g. service name "OrderService" -> "/OrderService".
Endpoint.publish(Object)
,
WebService.serviceName()
public void setFilters(java.util.List<com.sun.net.httpserver.Filter> filters)
Filters
to be
applied to all detected WebService
annotated beans.public void setAuthenticator(com.sun.net.httpserver.Authenticator authenticator)
Authenticator
to be
applied to all detected WebService
annotated beans.public void afterPropertiesSet() throws java.lang.Exception
AbstractJaxWsServiceExporter
afterPropertiesSet
in interface InitializingBean
afterPropertiesSet
in class AbstractJaxWsServiceExporter
java.lang.Exception
- in the event of misconfiguration (such as failure to set an
essential property) or if initialization fails for any other reasonAbstractJaxWsServiceExporter.publishEndpoints()
protected void publishEndpoint(Endpoint endpoint, WebService annotation)
AbstractJaxWsServiceExporter
publishEndpoint
in class AbstractJaxWsServiceExporter
endpoint
- the JAX-WS Endpoint objectannotation
- the service bean's WebService annotationprotected void publishEndpoint(Endpoint endpoint, WebServiceProvider annotation)
AbstractJaxWsServiceExporter
publishEndpoint
in class AbstractJaxWsServiceExporter
endpoint
- the JAX-WS Provider Endpoint objectannotation
- the service bean's WebServiceProvider annotationprotected com.sun.net.httpserver.HttpContext buildHttpContext(Endpoint endpoint, java.lang.String serviceName)
endpoint
- the JAX-WS Provider Endpoint objectserviceName
- the given service nameprotected java.lang.String calculateEndpointPath(Endpoint endpoint, java.lang.String serviceName)
endpoint
- the JAX-WS Provider Endpoint objectserviceName
- the given service namepublic void destroy()
AbstractJaxWsServiceExporter
destroy
in interface DisposableBean
destroy
in class AbstractJaxWsServiceExporter