}
protected void registerWithMonitoring()
{
// ORB
MonitoredObject orbMO =
orb.getMonitoringManager().getRootMonitoredObject();
// REVISIT - add ORBUtil mkdir -p like operation for this.
// CONNECTION
MonitoredObject connectionMO =
orbMO.getChild(MonitoringConstants.CONNECTION_MONITORING_ROOT);
if (connectionMO == null) {
connectionMO =
MonitoringFactories.getMonitoredObjectFactory()
.createMonitoredObject(
MonitoringConstants.CONNECTION_MONITORING_ROOT,
MonitoringConstants.CONNECTION_MONITORING_ROOT_DESCRIPTION);
orbMO.addChild(connectionMO);
}
// INBOUND CONNECTION
MonitoredObject inboundConnectionMO =
connectionMO.getChild(
MonitoringConstants.INBOUND_CONNECTION_MONITORING_ROOT);
if (inboundConnectionMO == null) {
inboundConnectionMO =
MonitoringFactories.getMonitoredObjectFactory()
.createMonitoredObject(
MonitoringConstants.INBOUND_CONNECTION_MONITORING_ROOT,
MonitoringConstants.INBOUND_CONNECTION_MONITORING_ROOT_DESCRIPTION);
connectionMO.addChild(inboundConnectionMO);
}
// NODE FOR THIS CACHE
MonitoredObject thisMO =
inboundConnectionMO.getChild(getMonitoringName());
if (thisMO == null) {
thisMO =
MonitoringFactories.getMonitoredObjectFactory()
.createMonitoredObject(
getMonitoringName(),
MonitoringConstants.CONNECTION_MONITORING_DESCRIPTION);
inboundConnectionMO.addChild(thisMO);
}
LongMonitoredAttributeBase attribute;
// ATTRIBUTE
attribute = new
LongMonitoredAttributeBase(
MonitoringConstants.CONNECTION_TOTAL_NUMBER_OF_CONNECTIONS,
MonitoringConstants.CONNECTION_TOTAL_NUMBER_OF_CONNECTIONS_DESCRIPTION)
{
public Object getValue() {
return new Long(CorbaInboundConnectionCacheImpl.this.numberOfConnections());
}
};
thisMO.addAttribute(attribute);
// ATTRIBUTE
attribute = new
LongMonitoredAttributeBase(
MonitoringConstants.CONNECTION_NUMBER_OF_IDLE_CONNECTIONS,
MonitoringConstants.CONNECTION_NUMBER_OF_IDLE_CONNECTIONS_DESCRIPTION)
{
public Object getValue() {
return new Long(CorbaInboundConnectionCacheImpl.this.numberOfIdleConnections());
}
};
thisMO.addAttribute(attribute);
// ATTRIBUTE
attribute = new
LongMonitoredAttributeBase(
MonitoringConstants.CONNECTION_NUMBER_OF_BUSY_CONNECTIONS,
MonitoringConstants.CONNECTION_NUMBER_OF_BUSY_CONNECTIONS_DESCRIPTION)
{
public Object getValue() {
return new Long(CorbaInboundConnectionCacheImpl.this.numberOfBusyConnections());
}
};
thisMO.addAttribute(attribute);
}