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

Java™ Platform
Standard Ed. 7

DRAFT ea-b76

javax.management.event
Class RMIPushEventRelay

java.lang.Object
  extended by javax.management.event.RMIPushEventRelay
All Implemented Interfaces:
EventRelay

public class RMIPushEventRelay
extends Object
implements EventRelay

This class is an implementation of the EventRelay interface, using push mode. It exports an RMI object that RMIPushEventForwarder uses to forward notifications.

Since:
JMX 2.0

Constructor Summary
Constructor and Description
RMIPushEventRelay(EventClientDelegateMBean delegate)
          Constructs a default RMIPushEventRelay object and exports its notification receiver on any free port.
RMIPushEventRelay(EventClientDelegateMBean delegate, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf, int bufferSize)
          Constructs a RMIPushEventRelay object and exports its notification receiver on a specified port.
 
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 receiver)
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RMIPushEventRelay

public RMIPushEventRelay(EventClientDelegateMBean delegate)
                  throws IOException,
                         MBeanException
Constructs a default RMIPushEventRelay object and exports its notification receiver on any free port. This constructor is equivalent to RMIPushEventRelay(delegate, 0, null, null, <default buffer size>).

Parameters:
delegate - The EventClientDelegateMBean proxy to work with.
Throws:
IOException - if failed to communicate with EventClientDelegateMBean.
MBeanException - if the EventClientDelegateMBean failed to create an EventForwarder for this object.

RMIPushEventRelay

public RMIPushEventRelay(EventClientDelegateMBean delegate,
                         int port,
                         RMIClientSocketFactory csf,
                         RMIServerSocketFactory ssf,
                         int bufferSize)
                  throws IOException,
                         MBeanException
Constructs a RMIPushEventRelay object and exports its notification receiver on a specified port.

Parameters:
delegate - The EventClientDelegateMBean proxy to work with.
port - The port used to export an RMI object to receive notifications from a server. If the port is zero, an anonymous port is used.
csf - The client socket factory used to export the RMI object. Can be null.
ssf - The server socket factory used to export the RMI object. Can be null.
bufferSize - The number of notifications held on the server while waiting for the previous transmission to complete. A value of zero means the default buffer size.
Throws:
IOException - if failed to communicate with EventClientDelegateMBean.
MBeanException - if the EventClientDelegateMBean failed to create an EventForwarder for this object.
See Also:
RMIPushEventForwarder.RMIPushEventForwarder(RMIPushServer, int)
Method Detail

getClientId

public String getClientId()
Description copied from interface: EventRelay
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.

Specified by:
getClientId in interface EventRelay
Returns:
A client identifier.

setEventReceiver

public void setEventReceiver(EventReceiver receiver)
Description copied from interface: EventRelay
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.

Specified by:
setEventReceiver in interface EventRelay
Parameters:
receiver - An EventClient callback to receive events.

stop

public void stop()
Description copied from interface: EventRelay
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.

Specified by:
stop in interface EventRelay
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.