EndpointHandlerpublic class EndpointHandler extends Object Keeps track of SOAP messages per endpoint. |
Fields Summary |
---|
private MessageFilter | _filter | private com.sun.enterprise.admin.wsmgmt.pool.spi.Pool | _pool | private String | _endpointId | private String | _applicationId | private static final String | DELIM | private static final Logger | _logger | private static final com.sun.enterprise.util.i18n.StringManager | _stringMgr |
Constructors Summary |
---|
EndpointHandler(com.sun.enterprise.admin.wsmgmt.config.spi.WebServiceConfig wsc, String appId)Constructor.
_applicationId = appId;
_endpointId = wsc.getName();
String mLevel = wsc.getMonitoringLevel();
// SOAP message visualization is only enabled for level HIGH
if (Constants.HIGH.equals(mLevel)) {
_pool = new BoundedPool(wsc.getName(), wsc.getMaxHistorySize());
registerFilter();
}
| EndpointHandler(String endpoint, int size, String appId)Constructor.
_applicationId = appId;
_endpointId = endpoint;
_pool = new BoundedPool(endpoint, size);
registerFilter();
|
Methods Summary |
---|
public void | addMessage(com.sun.appserv.management.ext.wsmgmt.MessageTrace msgTrace)Adds a message trace to the pool.
_pool.put(msgTrace.getMessageID(), msgTrace);
| void | destroy()Disables monitoring for the endpoint and deregisters the filters.
if (_pool != null) {
_pool.clear();
_pool = null;
}
if (_filter != null) {
FilterRegistry fr = FilterRegistry.getInstance();
String endpoint = getFQEndpointName();
// unregister filters
fr.unregisterFilter(Filter.PROCESS_REQUEST, endpoint, _filter);
fr.unregisterFilter(Filter.PROCESS_RESPONSE, endpoint, _filter);
fr.unregisterFilter(Filter.POST_PROCESS_RESPONSE, endpoint, _filter);
_filter = null;
}
_logger.finer("Message trace handler destroyed for "
+ getEndpointName());
| java.lang.String | getEndpointName()Returns the name of the endpoint.
return _endpointId;
| java.lang.String | getFQEndpointName()Returns the fully qualified name of this endpoint.
return _applicationId + DELIM + _endpointId;
| java.util.Collection | getMessages()Returns all messages for this endpoint.
return _pool.values();
| private void | registerFilter()Registers a filter with the filter manager for this endpoint.
// msg filter
_filter = new MessageFilter(_applicationId, _endpointId, this);
FilterRegistry fr = FilterRegistry.getInstance();
String endpoint = getFQEndpointName();
// registers the filter
fr.registerFilter(Filter.PROCESS_REQUEST, endpoint, _filter);
fr.registerFilter(Filter.PROCESS_RESPONSE, endpoint, _filter);
fr.registerFilter(Filter.POST_PROCESS_RESPONSE, endpoint, _filter);
| void | setMessageHistorySize(int size)Sets the number of messages stored in memory for this endpoint.
This method is called to dynamically reconfigure the size.
if (_pool != null) {
_pool.resize(size);
_logger.fine("Set message history size to " + size
+ " for " + getEndpointName());
}
|
|