public void run() throws Exception {
log.info("connecting");
JGDIProxy jgdiProxy = JGDIFactory.newJMXInstance(master, port, credentials);
Set<EventTypeEnum> subscription = new HashSet<EventTypeEnum>(4);
subscription.add(EventTypeEnum.ExecHostList);
subscription.add(EventTypeEnum.ExecHostAdd);
subscription.add(EventTypeEnum.ExecHostDel);
subscription.add(EventTypeEnum.ExecHostMod);
log.info("addEventListener");
jgdiProxy.addEventListener(this);
log.info("setSubscription");
jgdiProxy.getProxy().setSubscription(subscription);
log.info("connected");
lock.lock();
try {
cond.await();
} finally {
lock.unlock();
}
log.info("disconnecting");
jgdiProxy.close();
log.info("disconnected");
}