NotificationEmitter notifyProxy = (NotificationEmitter) proxy;
TestJMXNotificationListener listener =
new TestJMXNotificationListener();
notifyProxy.addNotificationListener(listener, null, null);
// add another node
SgsTestNode node3 = null;
try {
node3 = new SgsTestNode(serverNode, null, null);
// We expect to see one notification for a started node
AtomicLong count = listener.notificationMap.get(
NodesMXBean.NODE_STARTED_NOTIFICATION);
assertNotNull(count);
assertEquals(1, count.longValue());
// and no notifications for failed nodes
assertNull(listener.notificationMap.get(
NodesMXBean.NODE_FAILED_NOTIFICATION));
} finally {
if (node3 != null) {
node3.shutdown(false);
}
// Shutdown takes a little while...need to detect that the
// node is gone
int renewTime = Integer.valueOf(serverNode.getServiceProperties().
getProperty(