// Setup the monitor: register a listener
MBeanServerConnection connection = connector.getMBeanServerConnection();
final AtomicBoolean notificationSet = new AtomicBoolean(false);
//Add a notification listener to the connection - to
//test for notifications across camel
connection.addNotificationListener(monitorName, new NotificationListener() {
public void handleNotification(Notification notification, Object handback) {
System.out.println("Notification = " + notification);
synchronized (notificationSet) {
notificationSet.set(true);
notificationSet.notify();