Please note that this documentation is not final and is subject to change.

Java™ Platform
Standard Ed. 7

DRAFT ea-b76

javax.management.event
Interface EventRelay

All Known Implementing Classes:
FetchingEventRelay, RMIPushEventRelay

public interface EventRelay

This interface is used to specify a way to receive notifications from a remote MBean server and then to forward the notifications to an EventClient.

See Also:
Custom notification transports

Method Summary
Modifier and Type Method and Description
 String getClientId()
          Returns an identifier that is used by this EventRelay to identify the client when communicating with the EventClientDelegateMBean.
 void setEventReceiver(EventReceiver eventReceiver)
          This method is called by EventClient to register a callback to receive notifications from an EventClientDelegateMBean object.
 void stop()
          Stops receiving and forwarding notifications and performs any necessary cleanup.
 

Method Detail

getClientId

String getClientId()
                   throws IOException
Returns an identifier that is used by this EventRelay to identify the client when communicating with the EventClientDelegateMBean.

This identifier is obtained by calling EventClientDelegateMBean.addClient.

It is the EventRelay that calls EventClientDelegateMBean to obtain the client identifier because it is the EventRelay that decides how to get notifications from the EventClientDelegateMBean, by creating the appropriate EventForwarder.

Returns:
A client identifier.
Throws:
IOException - If an I/O error occurs when communicating with the EventClientDelegateMBean.

setEventReceiver

void setEventReceiver(EventReceiver eventReceiver)
This method is called by EventClient to register a callback to receive notifications from an EventClientDelegateMBean object. A null value is allowed, which means that the EventClient suspends reception of notifications, so that the EventRelay can decide to stop receiving notifications from its EventForwarder.

Parameters:
eventReceiver - An EventClient callback to receive events.

stop

void stop()
          throws IOException
Stops receiving and forwarding notifications and performs any necessary cleanup. After calling this method, the EventClient will never call any other methods of this object.

Throws:
IOException - If an I/O exception appears.
See Also:
EventClient.close()

Java™ Platform
Standard Ed. 7

DRAFT ea-b76

Submit a bug or feature

Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.