1 23 24 29 30 package com.sun.enterprise.admin.jmx.remote.server.callers; 31 32 33 import java.util.logging.Logger ; 34 35 import com.sun.enterprise.admin.jmx.remote.DefaultConfiguration; 36 import javax.management.MBeanServerConnection ; 37 38 import javax.management.NotificationFilter ; 39 import javax.management.ObjectName ; 40 41 import javax.management.remote.message.MBeanServerRequestMessage; 42 import javax.management.remote.message.MBeanServerResponseMessage; 43 44 45 import com.sun.enterprise.admin.jmx.remote.notification.ListenerInfo; 46 import com.sun.enterprise.admin.jmx.remote.server.notification.ServerNotificationManager; 47 48 49 50 56 57 public class AddNotifLsnrObjNameCaller extends AbstractMethodCaller { 58 59 private final Logger logger = Logger.getLogger( 60 DefaultConfiguration.JMXCONNECTOR_LOGGER); 62 63 private ServerNotificationManager notifMgr = null; 64 65 public AddNotifLsnrObjNameCaller(MBeanServerConnection mbsc, ServerNotificationManager mgr) { 67 68 super(mbsc); 69 METHOD_ID = MBeanServerRequestMessage.ADD_NOTIFICATION_LISTENER_OBJECTNAME; 70 71 this.notifMgr = mgr; 72 73 } 74 75 public MBeanServerResponseMessage call(MBeanServerRequestMessage request) { 76 77 Object result = null; 80 boolean isException = false; 81 82 ObjectName objname1 = (ObjectName ) request.getParams()[0]; 83 ObjectName objname2 = (ObjectName ) request.getParams()[1]; 84 NotificationFilter filter = (NotificationFilter ) request.getParams()[2]; 85 Object handback = request.getParams()[3]; 86 String lsnrid = (String ) request.getParams()[4]; 87 88 notifMgr.addObjNameNotificationListener(objname1, filter, handback, lsnrid); 89 90 try { 91 mbsc.addNotificationListener(objname1, objname2, filter, handback); 92 } catch (Exception e) { 93 result = e; 94 isException = true; 95 } 96 97 98 return ( new MBeanServerResponseMessage(METHOD_ID, result, isException) ); 99 } 100 } 101 | Popular Tags |