boolean emitPing = sendPingForEvent(descriptor.getEventName());
if (emitPing) {
String destination = getDestinationResolver().resolveDestination(descriptor.getEventClass(), null);
long pingPeriod = getPingPeriod(descriptor.getEventName());
Status maxImpact = getPublisherMaxEffectOnOverallStatus(descriptor.getEventName());
TopicPublisherPingMonitor monitor = new TopicPublisherPingMonitor(this, pingPeriod, destination, maxImpact);
publisherPingMonitors.add(monitor);
if (monitorRegistry != null) {
monitorRegistry.addMonitor(monitor);
}
if (jmxControl != null) {
String name = "CoUGAR."+getTransportShortName()+".transport.monitoring:type=publisher,serviceName="+eventServiceBindingDescriptor.getServiceName()+",serviceVersion="+eventServiceBindingDescriptor.getServiceVersion()+",eventName="+descriptor.getEventName()+",destination="+destination;
if (transportIdentifier != null) {
name += ",transportIdentifier="+transportIdentifier;
}
jmxControl.registerMBean(name, monitor);
}
}
}
}
for (TopicPublisherPingMonitor monitor : publisherPingMonitors) {
monitor.connectionOpened();
}
}