FileDocCategorySizeDatePackage
AddNotifLsnrsCaller.javaAPI DocGlassfish v2 API4438Fri May 04 22:36:26 BST 2007com.sun.enterprise.admin.jmx.remote.server.callers

AddNotifLsnrsCaller

public class AddNotifLsnrsCaller extends AbstractMethodCaller
Invokes the method addNotificationListener of the MBeanServerConnection.
see
MBeanServerRequestMessage#ADD_NOTIFICATION_LISTENERS
author
Kedar Mhaswade
since
S1AS8.0
version
1.0

Fields Summary
private com.sun.enterprise.admin.jmx.remote.server.notification.ServerNotificationManager
notifyMgr
private final Logger
logger
Constructors Summary
public AddNotifLsnrsCaller(MBeanServerConnection mbsc, com.sun.enterprise.admin.jmx.remote.server.notification.ServerNotificationManager mgr)

/*, 
    DefaultConfiguration.LOGGER_RESOURCE_BUNDLE_NAME );*/
    
         
        super(mbsc);
        METHOD_ID = MBeanServerRequestMessage.ADD_NOTIFICATION_LISTENERS;
        this.notifyMgr = mgr;
    
Methods Summary
public javax.management.remote.message.MBeanServerResponseMessagecall(javax.management.remote.message.MBeanServerRequestMessage request)

//        final Object result         = new UnsupportedOperationException("" + METHOD_ID);
        Object result         = null;
        boolean isException   = false;
        ObjectName objname = (ObjectName)request.getParams()[0];
        String cid = (String) request.getParams()[1];
        String id = (String) request.getParams()[2];
        NotificationListenerProxy proxy =
                new NotificationListenerProxy(  objname,
                                                notifyMgr,
                                                cid);
        notifyMgr.addNotificationListener(objname, id, proxy);

        try {
            mbsc.addNotificationListener(objname, proxy, null, null);
        } catch (Exception e) {
            isException = true;
            result = e;
        }

        return ( new MBeanServerResponseMessage(METHOD_ID, result, isException) );