Class WebServiceEngineImpl
- java.lang.Object
-
- org.glassfish.webservices.monitoring.WebServiceEngineImpl
-
- All Implemented Interfaces:
WebServiceEngine
public final class WebServiceEngineImpl extends Object implements WebServiceEngine
This class acts as a factory to create TracingSystemHandler instances. It also provides an API to register listeners of SOAP messages.NOT THREAD SAFE: mutable instance variable: globalMessageListener
- Author:
- Jerome Dochez
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAuthListener(AuthenticationListener listener)
Register a new listener interface to receive authentication notification.void
addLifecycleListener(EndpointLifecycleListener listener)
Register a new listener interface to receive notification of web service endpoint creation and deletionEndpointImpl
createHandler(WebServiceEndpoint endpointDesc)
Collection<AuthenticationListener>
getAuthListeners()
Endpoint
getEndpoint(String uri)
Iterator<Endpoint>
getEndpoints()
GlobalMessageListener
getGlobalMessageListener()
get the global listener interface or null if none is set.static WebServiceEngineImpl
getInstance()
ThreadLocal<ThreadLocalInfo>
getThreadLocal()
boolean
hasGlobalMessageListener()
void
postProcessResponse(String messageID, TransportInfo info)
Callback when a web service response has finished being processed by the container and was sent back to the clientString
preProcessRequest(Endpoint endpoint)
Callback when a web service request entered the web service container before any processing is done.void
processRequest(String messageID, SOAPMessageContext context, TransportInfo info)
Callback when a 2.0 web service request is received on the endpoint.void
processResponse(String messageID, SOAPMessageContext context)
Callback when a 2.0 web service response is received on the endpoint.void
removeAuthListener(AuthenticationListener listener)
Unregister a listener interfacevoid
removeHandler(WebServiceEndpoint endpointDesc)
void
removeLifecycleListener(EndpointLifecycleListener listener)
Unregister a listener interfacevoid
setGlobalMessageListener(GlobalMessageListener listener)
Set the unique global listener interface to trace all web service requests or responses.
-
-
-
Field Detail
-
sLogger
public static final Logger sLogger
-
-
Method Detail
-
getInstance
public static WebServiceEngineImpl getInstance()
-
getEndpoint
public Endpoint getEndpoint(String uri)
- Specified by:
getEndpoint
in interfaceWebServiceEngine
- Parameters:
uri
- the endpoint selector- Returns:
- an Endpoint instance if the supplied selector is the endpoint's invocation selector. In case of HTTP based web services, the selector is the endpoint URL
-
getEndpoints
public Iterator<Endpoint> getEndpoints()
- Specified by:
getEndpoints
in interfaceWebServiceEngine
- Returns:
- an iterator of all the registered active endpoints in the engine.
-
addLifecycleListener
public void addLifecycleListener(EndpointLifecycleListener listener)
Description copied from interface:WebServiceEngine
Register a new listener interface to receive notification of web service endpoint creation and deletion- Specified by:
addLifecycleListener
in interfaceWebServiceEngine
- Parameters:
listener
- instance to register
-
removeLifecycleListener
public void removeLifecycleListener(EndpointLifecycleListener listener)
Description copied from interface:WebServiceEngine
Unregister a listener interface- Specified by:
removeLifecycleListener
in interfaceWebServiceEngine
- Parameters:
listener
- to unregister.
-
addAuthListener
public void addAuthListener(AuthenticationListener listener)
Description copied from interface:WebServiceEngine
Register a new listener interface to receive authentication notification.- Specified by:
addAuthListener
in interfaceWebServiceEngine
- Parameters:
listener
- to add
-
removeAuthListener
public void removeAuthListener(AuthenticationListener listener)
Description copied from interface:WebServiceEngine
Unregister a listener interface- Specified by:
removeAuthListener
in interfaceWebServiceEngine
- Parameters:
listener
- to remove
-
getGlobalMessageListener
public GlobalMessageListener getGlobalMessageListener()
Description copied from interface:WebServiceEngine
get the global listener interface or null if none is set.- Specified by:
getGlobalMessageListener
in interfaceWebServiceEngine
- Returns:
- the global message listener
-
setGlobalMessageListener
public void setGlobalMessageListener(GlobalMessageListener listener)
Description copied from interface:WebServiceEngine
Set the unique global listener interface to trace all web service requests or responses. Set to null if no tracing is needed- Specified by:
setGlobalMessageListener
in interfaceWebServiceEngine
- Parameters:
listener
- to register
-
createHandler
public EndpointImpl createHandler(WebServiceEndpoint endpointDesc)
-
getAuthListeners
public Collection<AuthenticationListener> getAuthListeners()
-
hasGlobalMessageListener
public boolean hasGlobalMessageListener()
-
removeHandler
public void removeHandler(WebServiceEndpoint endpointDesc)
-
preProcessRequest
public String preProcessRequest(Endpoint endpoint)
Callback when a web service request entered the web service container before any processing is done.- Parameters:
endpoint
- the Endpoint- Returns:
- a message ID to trace the request in the subsequent callbacks
-
processRequest
public void processRequest(String messageID, SOAPMessageContext context, TransportInfo info)
Callback when a 2.0 web service request is received on the endpoint.- Parameters:
messageID
- returned by preProcessRequest callcontext
- the jaxws message trace, transport dependent.info
- the transport info
-
processResponse
public void processResponse(String messageID, SOAPMessageContext context)
Callback when a 2.0 web service response is received on the endpoint.- Parameters:
messageID
- returned by the preProcessRequest callcontext
- jaxws message context
-
postProcessResponse
public void postProcessResponse(String messageID, TransportInfo info)
Callback when a web service response has finished being processed by the container and was sent back to the client- Parameters:
messageID
- returned by the preProcessRequest callinfo
-
-
getThreadLocal
public ThreadLocal<ThreadLocalInfo> getThreadLocal()
-
-