protected TopicMBean(ITopic managedObject, ManagementService service) {
super(managedObject, service);
objectName = service.createObjectName("ITopic", managedObject.getName());
//can't we rely on the statics functionality of the topic instead of relying on the event system?
MessageListener messageListener = new MessageListener() {
public void onMessage(Message message) {
totalMessageCount.incrementAndGet();
}
};
registrationId = managedObject.addMessageListener(messageListener);