KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mx4j > tools > remote > local > LocalConnectionHandler


1 /*
2  * Copyright (C) The MX4J Contributors.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the MX4J License version 1.0.
6  * See the terms of the MX4J License in the documentation provided with this software.
7  */

8
9 package mx4j.tools.remote.local;
10
11 import java.io.IOException JavaDoc;
12 import javax.management.InstanceNotFoundException JavaDoc;
13 import javax.management.ListenerNotFoundException JavaDoc;
14 import javax.management.NotificationFilter JavaDoc;
15 import javax.management.NotificationListener JavaDoc;
16 import javax.management.ObjectName JavaDoc;
17 import javax.security.auth.Subject JavaDoc;
18
19 import mx4j.tools.remote.JMXConnectionHandler;
20
21 /**
22  * @version $Revision: 1.3 $
23  */

24 class LocalConnectionHandler extends JMXConnectionHandler implements LocalConnection
25 {
26    LocalConnectionHandler(String JavaDoc connectionId, LocalConnectionManager manager, LocalConnection target)
27    {
28       super(target, manager, connectionId);
29    }
30
31    public void addNotificationListener(ObjectName JavaDoc observed, NotificationListener JavaDoc listener, NotificationFilter JavaDoc filter, Object JavaDoc handback, Subject JavaDoc delegate) throws InstanceNotFoundException JavaDoc, IOException JavaDoc
32    {
33       if (isClosed()) throw new IOException JavaDoc("Connection has been closed");
34       ((LocalConnection)getConnection()).addNotificationListener(observed, listener, filter, handback, delegate);
35    }
36
37    public void removeNotificationListener(ObjectName JavaDoc observed, NotificationListener JavaDoc listener, Subject JavaDoc delegate) throws InstanceNotFoundException JavaDoc, ListenerNotFoundException JavaDoc, IOException JavaDoc
38    {
39       if (isClosed()) throw new IOException JavaDoc("Connection has been closed");
40       ((LocalConnection)getConnection()).removeNotificationListener(observed, listener, delegate);
41    }
42
43    public void removeNotificationListener(ObjectName JavaDoc observed, NotificationListener JavaDoc listener, NotificationFilter JavaDoc filter, Object JavaDoc handback, Subject JavaDoc delegate) throws InstanceNotFoundException JavaDoc, ListenerNotFoundException JavaDoc, IOException JavaDoc
44    {
45       if (isClosed()) throw new IOException JavaDoc("Connection has been closed");
46       ((LocalConnection)getConnection()).removeNotificationListener(observed, listener, filter, handback, delegate);
47    }
48 }
49
Popular Tags