* Register http-listener monitoring statistics.
*/
protected void enableHttpListenerMonitoring(VirtualServer virtualServer,
int port, String httpListenerId){
PWCRequestStatsImpl pwcRequestStatsImpl =
virtualServer.getPWCRequestStatsImpl();
if ( pwcRequestStatsImpl == null ){
pwcRequestStatsImpl = new PWCRequestStatsImpl(
getServerContext().getDefaultDomainName());
virtualServer.setPWCRequestStatsImpl(pwcRequestStatsImpl);
}
HTTPListenerStatsImpl httpStats;
MonitoringRegistry mReg = getServerContext().getMonitoringRegistry();
String vsId = virtualServer.getID();
if (isTomcatUsingDefaultDomain()) {
httpStats = new HTTPListenerStatsImpl(
getServerContext().getDefaultDomainName(),port);
} else {
httpStats = new HTTPListenerStatsImpl(vsId,port);
}
try {
mReg.registerHttpListenerStats(httpStats, httpListenerId, vsId, null);
pwcRequestStatsImpl.addHttpListenerStats(httpStats);
} catch (MonitoringRegistrationException mre) {
String msg =
_logger.getResourceBundle().getString(
"web.monitoringRegistrationError");
msg = MessageFormat.format(