01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * published by the Free Software Foundation; either version 2.1 of
10: * the License, or (at your option) any later version.
11: *
12: * This software is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this software; if not, write to the Free
19: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21: */
22: package javax.management.j2ee;
23:
24: import javax.management.ObjectName;
25: import javax.management.NotificationListener;
26: import javax.management.NotificationFilter;
27: import javax.management.InstanceNotFoundException;
28: import javax.management.ListenerNotFoundException;
29: import java.rmi.RemoteException;
30: import java.io.Serializable;
31:
32: /**
33: * ListenerRegistration defines the methods which clients of the MEJB use to add and remove event listeners.
34: *
35: * @author thomas.diesler@jboss.org
36: */
37: public interface ListenerRegistration extends Serializable
38:
39: {
40: /**
41: * Add a listener to a registered managed object.
42: *
43: * @param name The name of the managed object on which the listener should be added.
44: * @param listener The listener object which will handle the notifications emitted by the registered managed object.
45: * @param filter The filter object. If filter is null, no filtering will be performed before handling notifications.
46: * @param handback The context to be sent to the listener when a notification is emitted.
47: * @throws InstanceNotFoundException The managed object name provided does not match any of the registered managed objects.
48: * @throws RemoteException A communication exception occurred during the execution of a remote method call
49: */
50: public void addNotificationListener(ObjectName name,
51: NotificationListener listener, NotificationFilter filter,
52: Object handback) throws InstanceNotFoundException,
53: RemoteException;
54:
55: /**
56: * Remove a listener from a registered managed object.
57: *
58: * @param name The name of the managed object on which the listener should be removed.
59: * @param listener The listener object which will handle the notifications emitted by the registered managed object.
60: * This method will remove all the information related to this listener.
61: * @throws InstanceNotFoundException The managed object name provided does not match any of the registered managed objects.
62: * @throws ListenerNotFoundException The listener is not registered in the managed object.
63: * @throws RemoteException A communication exception occurred during the execution of a remote method call
64: */
65: public void removeNotificationListener(ObjectName name,
66: NotificationListener listener)
67: throws InstanceNotFoundException,
68: ListenerNotFoundException, RemoteException;
69: }
|