1 8 9 package mx4j.tools.remote.http; 10 11 import java.io.IOException ; 12 13 import javax.management.InstanceNotFoundException ; 14 import javax.management.ListenerNotFoundException ; 15 import javax.management.ObjectName ; 16 import javax.management.remote.NotificationResult ; 17 import javax.security.auth.Subject ; 18 19 import mx4j.tools.remote.ConnectionManager; 20 import mx4j.tools.remote.JMXConnection; 21 import mx4j.tools.remote.JMXConnectionHandler; 22 23 26 public class HTTPConnectionHandler extends JMXConnectionHandler implements HTTPConnection 27 { 28 public HTTPConnectionHandler(JMXConnection connection, ConnectionManager manager, String connectionId) 29 { 30 super(connection, manager, connectionId); 31 } 32 33 public String connect(Object credentials) throws IOException , SecurityException 34 { 35 throw new Error ("Method connect() must not be forwarded to the invocation chain"); 36 } 37 38 public Integer addNotificationListener(ObjectName name, Object filter, Subject delegate) throws InstanceNotFoundException , IOException 39 { 40 if (isClosed()) throw new IOException ("Connection has been closed"); 41 return ((HTTPConnection)getConnection()).addNotificationListener(name, filter, delegate); 42 } 43 44 public void removeNotificationListeners(ObjectName name, Integer [] listenerIDs, Subject delegate) throws InstanceNotFoundException , ListenerNotFoundException , IOException 45 { 46 if (isClosed()) throw new IOException ("Connection has been closed"); 47 ((HTTPConnection)getConnection()).removeNotificationListeners(name, listenerIDs, delegate); 48 } 49 50 public NotificationResult fetchNotifications(long clientSequenceNumber, int maxNotifications, long timeout) throws IOException 51 { 52 if (isClosed()) throw new IOException ("Connection has been closed"); 53 return ((HTTPConnection)getConnection()).fetchNotifications(clientSequenceNumber, maxNotifications, timeout); 54 } 55 } 56 | Popular Tags |