int port;
HttpService httpService;
ServerContext sc = getServerContext();
ConfigContext cc = sc.getConfigContext();
MonitoringRegistry mReg = sc.getMonitoringRegistry();
try {
httpService = ServerBeansFactory.getHttpServiceBean(cc);
} catch(ConfigException ce) {
_logger.log(Level.WARNING,
"Unable to find HttpServiceBean in config",
ce);
return;
}
// keep-alive
try {
mReg.registerPWCKeepAliveStats(
new PWCKeepAliveStatsImpl(sc.getDefaultDomainName()),
null);
} catch (MonitoringRegistrationException mre) {
String msg = _logger.getResourceBundle().getString(
"web.monitoringRegistrationError");
msg = MessageFormat.format(msg,
new Object[] { "PWCKeepAliveStats" });
_logger.log(Level.WARNING, msg, mre);
}
// file-cache
try {
mReg.registerPWCFileCacheStats(
new PWCFileCacheStatsImpl(sc.getDefaultDomainName()),null);
} catch (MonitoringRegistrationException mre) {
String msg = _logger.getResourceBundle().getString(
"web.monitoringRegistrationError");
msg = MessageFormat.format(msg,
new Object[] { "PWCFileCacheStats" });
_logger.log(Level.WARNING, msg, mre);
}
// pwc-thread-pool
try {
mReg.registerPWCThreadPoolStats(
new PWCThreadPoolStatsImpl(sc.getDefaultDomainName()),
null);
} catch (MonitoringRegistrationException mre) {
String msg = _logger.getResourceBundle().getString(
"web.monitoringRegistrationError");
msg = MessageFormat.format(msg,
new Object[] { "PWCThreadPoolStats" });
_logger.log(Level.WARNING, msg, mre);
}
// connection-queue
try {
mReg.registerPWCConnectionQueueStats(
new PWCConnectionQueueStatsImpl(sc.getDefaultDomainName()),
null);
} catch (MonitoringRegistrationException mre) {
String msg = _logger.getResourceBundle().getString(
"web.monitoringRegistrationError");