EM.2. The Interface

The EventMailbox defines the interface to the event mailbox service. Through this interface, other Jini services and clients may request that event notification management be performed on their behalf. This interface belongs to the net.jini.event package, and any service implementing this interface must comply with the definition of a Jini service. This interface is not a remote interface; each implementation exports a proxy object that implements this interface local to the client, using an implementation-specific protocol to communicate with the actual remote server. All of the proxy methods obey normal Java Remote Method Invocation (RMI) interface semantics and can therefore be implemented directly using RMI (except where explicitly noted). Two proxy objects are equal (using the equals method) if they are proxies for the same event mailbox service.

package net.jini.event; 

public interface EventMailbox 
{
    MailboxRegistration register(long leaseDuration) 
        throws RemoteException, LeaseDeniedException; 
} 

Event mailbox clients wishing to use the mailbox service first register themselves with the service using the register method. Clients then use the methods of the returned MailboxRegistration object (a registration) in order to:

  • Manage the lease for this particular registration

  • Obtain a RemoteEventListener reference that can be registered with event generators (that is, objects that support event notification for changes in their abstract state). This listener will store any received notifications for this particular registration.

  • Enable or disable the delivery of any stored notifications for this particular registration

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.36.71