1 23 24 package com.sun.enterprise.management.model; 25 26 import javax.management.*; 27 import java.util.Set ; 28 import java.util.HashSet ; 29 import javax.management.j2ee.Management ; 30 import javax.management.j2ee.ManagementHome ; 31 import javax.naming.*; 33 34 37 38 public abstract class J2EEEventProviderMOMdl extends J2EEManagedObjectMdl implements NotificationBroadcaster { 39 40 private NotificationBroadcasterSupport broadcaster; 41 private boolean debug = false; 42 public J2EEEventProviderMOMdl(String name,boolean state, boolean statistics) { 43 super(name,state,statistics,true); 44 broadcaster = new NotificationBroadcasterSupport(); 45 } 46 public void addNotificationListener(NotificationListener listener, 47 NotificationFilter filter, 48 java.lang.Object handback){ 49 if(debug)System.out.println("J2EEEventPRoviderMOMdl::addNotificationListener listener added:"+listener); 50 broadcaster.addNotificationListener(listener,filter,handback); 51 } 52 public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException{ 53 broadcaster.removeNotificationListener(listener); 54 } 55 public MBeanNotificationInfo[] getNotificationInfo(){ 56 return broadcaster.getNotificationInfo(); 57 } 58 public void sendNotification(Notification notification){ 59 if(debug)System.out.println("J2EEEventPRoviderMOMdl::sendNotification sending notification"+notification); 60 broadcaster.sendNotification(notification); 61 } 62 } 63 | Popular Tags |