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 voidaddAuthListener(AuthenticationListener listener)Register a new listener interface to receive authentication notification.voidaddLifecycleListener(EndpointLifecycleListener listener)Register a new listener interface to receive notification of web service endpoint creation and deletionEndpointImplcreateHandler(WebServiceEndpoint endpointDesc)Collection<AuthenticationListener>getAuthListeners()EndpointgetEndpoint(String uri)Iterator<Endpoint>getEndpoints()GlobalMessageListenergetGlobalMessageListener()get the global listener interface or null if none is set.static WebServiceEngineImplgetInstance()ThreadLocal<ThreadLocalInfo>getThreadLocal()booleanhasGlobalMessageListener()voidpostProcessResponse(String messageID, TransportInfo info)Callback when a web service response has finished being processed by the container and was sent back to the clientStringpreProcessRequest(Endpoint endpoint)Callback when a web service request entered the web service container before any processing is done.voidprocessRequest(String messageID, SOAPMessageContext context, TransportInfo info)Callback when a 2.0 web service request is received on the endpoint.voidprocessResponse(String messageID, SOAPMessageContext context)Callback when a 2.0 web service response is received on the endpoint.voidremoveAuthListener(AuthenticationListener listener)Unregister a listener interfacevoidremoveHandler(WebServiceEndpoint endpointDesc)voidremoveLifecycleListener(EndpointLifecycleListener listener)Unregister a listener interfacevoidsetGlobalMessageListener(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:
getEndpointin 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:
getEndpointsin interfaceWebServiceEngine- Returns:
- an iterator of all the registered active endpoints in the engine.
-
addLifecycleListener
public void addLifecycleListener(EndpointLifecycleListener listener)
Description copied from interface:WebServiceEngineRegister a new listener interface to receive notification of web service endpoint creation and deletion- Specified by:
addLifecycleListenerin interfaceWebServiceEngine- Parameters:
listener- instance to register
-
removeLifecycleListener
public void removeLifecycleListener(EndpointLifecycleListener listener)
Description copied from interface:WebServiceEngineUnregister a listener interface- Specified by:
removeLifecycleListenerin interfaceWebServiceEngine- Parameters:
listener- to unregister.
-
addAuthListener
public void addAuthListener(AuthenticationListener listener)
Description copied from interface:WebServiceEngineRegister a new listener interface to receive authentication notification.- Specified by:
addAuthListenerin interfaceWebServiceEngine- Parameters:
listener- to add
-
removeAuthListener
public void removeAuthListener(AuthenticationListener listener)
Description copied from interface:WebServiceEngineUnregister a listener interface- Specified by:
removeAuthListenerin interfaceWebServiceEngine- Parameters:
listener- to remove
-
getGlobalMessageListener
public GlobalMessageListener getGlobalMessageListener()
Description copied from interface:WebServiceEngineget the global listener interface or null if none is set.- Specified by:
getGlobalMessageListenerin interfaceWebServiceEngine- Returns:
- the global message listener
-
setGlobalMessageListener
public void setGlobalMessageListener(GlobalMessageListener listener)
Description copied from interface:WebServiceEngineSet the unique global listener interface to trace all web service requests or responses. Set to null if no tracing is needed- Specified by:
setGlobalMessageListenerin 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()
-
-