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

AddNotifLsnrObjNameCaller

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

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


//    public AddNotifLsnrObjNameCaller(MBeanServerConnection mbsc) {
         
/* END -- S1WS_MOD */
        super(mbsc);
        METHOD_ID = MBeanServerRequestMessage.ADD_NOTIFICATION_LISTENER_OBJECTNAME;
/* BEGIN -- S1WS_MOD */
        this.notifMgr = mgr;
/* END -- S1WS_MOD */
    
Methods Summary
public javax.management.remote.message.MBeanServerResponseMessagecall(javax.management.remote.message.MBeanServerRequestMessage request)

/* BEGIN -- S1WS_MOD */
//        final Object result		= new UnsupportedOperationException("" + METHOD_ID);
//        boolean isException = true;
        Object result		= null;
        boolean isException = false;

        ObjectName objname1 = (ObjectName) request.getParams()[0];
        ObjectName objname2 = (ObjectName) request.getParams()[1];
        NotificationFilter filter  = (NotificationFilter) request.getParams()[2];
        Object handback = request.getParams()[3];
        String lsnrid = (String) request.getParams()[4];

        notifMgr.addObjNameNotificationListener(objname1, filter, handback, lsnrid);

        try {
            mbsc.addNotificationListener(objname1, objname2, filter, handback);
        } catch (Exception e) {
            result = e;
            isException = true;
        }

/* END -- S1WS_MOD */
        return ( new MBeanServerResponseMessage(METHOD_ID, result, isException) );