monitor.setGranularityPeriod(1000);
monitor.setObservedAttribute("ObjectCounter");
final MutableInteger times = new MutableInteger(0);
final MutableObject holder = new MutableObject(null);
monitor.addNotificationListener(new NotificationListener()
{
public void handleNotification(Notification notification, Object handback)
{
times.set(times.get() + 1);
holder.set(notification);