org.glassfish.webservices.monitoring
Class WebServiceEngineImpl

java.lang.Object
  extended by org.glassfish.webservices.monitoring.WebServiceEngineImpl
All Implemented Interfaces:
WebServiceEngine

public final class WebServiceEngineImpl
extends java.lang.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

Field Summary
protected  java.util.List<AuthenticationListener> authListeners
           
protected  java.util.Map<java.lang.String,Endpoint> endpoints
           
protected  GlobalMessageListener globalMessageListener
           
protected  java.util.List<EndpointLifecycleListener> lifecycleListeners
           
static java.util.logging.Logger sLogger
           
 
Method Summary
 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 deletion
 EndpointImpl createHandler(com.sun.xml.rpc.spi.runtime.SystemHandlerDelegate parent, WebServiceEndpoint endpointDesc)
           
 EndpointImpl createHandler(WebServiceEndpoint endpointDesc)
           
 java.util.Collection<AuthenticationListener> getAuthListeners()
           
 Endpoint getEndpoint(java.lang.String uri)
           
 java.util.Iterator<Endpoint> getEndpoints()
           
 GlobalMessageListener getGlobalMessageListener()
          get the global listener interface or null if none is set.
static WebServiceEngineImpl getInstance()
           
 java.lang.ThreadLocal getThreadLocal()
           
 boolean hasGlobalMessageListener()
           
 void postProcessResponse(java.lang.String messageID, TransportInfo info)
          Callback when a web service response has finished being processed by the container and was sent back to the client
 java.lang.String preProcessRequest(Endpoint endpoint)
          Callback when a web service request entered the web service container before any processing is done.
 void processRequest(java.lang.String messageID, com.sun.xml.rpc.spi.runtime.SOAPMessageContext context, TransportInfo info)
          Callback when a web service request is received on the endpoint.
 void processRequest(java.lang.String messageID, SOAPMessageContext context, TransportInfo info)
          Callback when a 2.0 web service request is received on the endpoint.
 void processResponse(java.lang.String messageID, com.sun.xml.rpc.spi.runtime.SOAPMessageContext context)
          Callback when a web service response is received on the endpoint.
 void processResponse(java.lang.String messageID, SOAPMessageContext context)
          Callback when a 2.0 web service response is received on the endpoint.
 void removeAuthListener(AuthenticationListener listener)
          Unregister a listener interface
 void removeHandler(WebServiceEndpoint endpointDesc)
           
 void removeLifecycleListener(EndpointLifecycleListener listener)
          Unregister a listener interface
 void setGlobalMessageListener(GlobalMessageListener listener)
          Set the unique global listener interface to trace all web service requests or responses.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

endpoints

protected final java.util.Map<java.lang.String,Endpoint> endpoints

lifecycleListeners

protected final java.util.List<EndpointLifecycleListener> lifecycleListeners

authListeners

protected final java.util.List<AuthenticationListener> authListeners

globalMessageListener

protected volatile GlobalMessageListener globalMessageListener

sLogger

public static final java.util.logging.Logger sLogger
Method Detail

getInstance

public static WebServiceEngineImpl getInstance()

createHandler

public EndpointImpl createHandler(WebServiceEndpoint endpointDesc)

createHandler

public EndpointImpl createHandler(com.sun.xml.rpc.spi.runtime.SystemHandlerDelegate parent,
                                  WebServiceEndpoint endpointDesc)

getEndpoint

public Endpoint getEndpoint(java.lang.String uri)
Specified by:
getEndpoint in interface WebServiceEngine
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 java.util.Iterator<Endpoint> getEndpoints()
Specified by:
getEndpoints in interface WebServiceEngine
Returns:
an iterator of all the registered active endpoints in the engine.

removeHandler

public void removeHandler(WebServiceEndpoint endpointDesc)

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 interface WebServiceEngine
Parameters:
listener - instance to register

removeLifecycleListener

public void removeLifecycleListener(EndpointLifecycleListener listener)
Description copied from interface: WebServiceEngine
Unregister a listener interface

Specified by:
removeLifecycleListener in interface WebServiceEngine
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 interface WebServiceEngine
Parameters:
listener - to add

removeAuthListener

public void removeAuthListener(AuthenticationListener listener)
Description copied from interface: WebServiceEngine
Unregister a listener interface

Specified by:
removeAuthListener in interface WebServiceEngine
Parameters:
listener - to remove

getAuthListeners

public java.util.Collection<AuthenticationListener> getAuthListeners()

getGlobalMessageListener

public GlobalMessageListener getGlobalMessageListener()
Description copied from interface: WebServiceEngine
get the global listener interface or null if none is set.

Specified by:
getGlobalMessageListener in interface WebServiceEngine
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 interface WebServiceEngine
Parameters:
listener - to register

hasGlobalMessageListener

public boolean hasGlobalMessageListener()

preProcessRequest

public java.lang.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(java.lang.String messageID,
                           com.sun.xml.rpc.spi.runtime.SOAPMessageContext context,
                           TransportInfo info)
Callback when a web service request is received on the endpoint.

Parameters:
messageID - returned by preProcessRequest call
context - the jaxrpc message trace, transport dependent.

processResponse

public void processResponse(java.lang.String messageID,
                            com.sun.xml.rpc.spi.runtime.SOAPMessageContext context)
Callback when a web service response is received on the endpoint.

Parameters:
messageID - returned by the preProcessRequest call
context - jaxrpc message context

processRequest

public void processRequest(java.lang.String messageID,
                           SOAPMessageContext context,
                           TransportInfo info)
Callback when a 2.0 web service request is received on the endpoint.

Parameters:
messageID - returned by preProcessRequest call
context - the jaxws message trace, transport dependent.
info - the transport info

processResponse

public void processResponse(java.lang.String messageID,
                            SOAPMessageContext context)
Callback when a 2.0 web service response is received on the endpoint.

Parameters:
messageID - returned by the preProcessRequest call
context - jaxws message context

postProcessResponse

public void postProcessResponse(java.lang.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 call

getThreadLocal

public java.lang.ThreadLocal getThreadLocal()


Copyright © 2012 GlassFish Community. All Rights Reserved.