usr/src/java/vpanels/panels/sharemgr/org/opensolaris/os/vp/panels/sharemgr/client/common/SharemgrEventMonitor.java
changeset 545 7a29a25b92e2
parent 513 691122ca7b6f
--- a/usr/src/java/vpanels/panels/sharemgr/org/opensolaris/os/vp/panels/sharemgr/client/common/SharemgrEventMonitor.java	Wed Jul 21 10:13:44 2010 -0700
+++ b/usr/src/java/vpanels/panels/sharemgr/org/opensolaris/os/vp/panels/sharemgr/client/common/SharemgrEventMonitor.java	Wed Jul 21 20:26:39 2010 -0400
@@ -40,7 +40,6 @@
 import org.opensolaris.os.vp.panels.sharemgr.rad.ShareChange;
 import org.opensolaris.os.vp.panels.sharemgr.rad.ShareId;
 
-@SuppressWarnings({"serial"})
 public class SharemgrEventMonitor implements NotificationListener, Runnable {
     //
     // Static data
@@ -60,7 +59,6 @@
     private BlockingQueue<SharemgrNotification> notifications =
 	new LinkedBlockingQueue<SharemgrNotification>();
 
-    private MBeanServerConnection mbsc;
     private Thread thread;
 
     //
@@ -221,39 +219,21 @@
 	}
     }
 
-    public void restart() throws InstanceNotFoundException, IOException {
-	if (thread != null) {
-	    stop();
-	    while (true) {
-		try {
-		    thread.join();
-		    break;
-		} catch (InterruptedException ignore) {
-		}
-	    }
-	}
-	start();
-    }
-
     public void start() throws InstanceNotFoundException, IOException {
-	mbsc = descriptor.getMBeanServerConnection();
-	mbsc.addNotificationListener(SharemgrUtil.OBJECT_NAME, this,
-	    SharemgrUtil.NOTIFICATION_FILTER, null);
+	descriptor.getSharesBeanTracker().addNotificationListener(
+	    this, SharemgrUtil.NOTIFICATION_FILTER, null);
 
 	thread = new Thread(this);
 	thread.start();
     }
 
     public void stop() {
-	if (mbsc != null) {
-	    try {
-		mbsc.removeNotificationListener(SharemgrUtil.OBJECT_NAME, this);
+	try {
+	    descriptor.getSharesBeanTracker().removeNotificationListener(this);
 
-	    // If something prevented us from removing ourselves as a
-	    // notification listener, it probably doesn't matter anymore.
-	    } catch (Throwable ignore) {
-	    }
-	    mbsc = null;
+        // If something prevented us from removing ourselves as a notification
+        // listener, it probably doesn't matter anymore.
+	} catch (Throwable ignore) {
 	}
 
 	add(STOP);