com.sun.jini.outrigger
Interface EventSender

All Known Implementing Classes:
AvailabilityRegistrationWatcher.VisibilityEventSender, EventRegistrationWatcher.BasicEventSender

interface EventSender

EventSenders encapsulates a remote event listener, a handback, an event sequence number, and an event type (an event ID and class of RemoteEvent). EventSenders provide a method that attempts to deliver an event of the encapsulated type with the encapsulated handback and sequence number to the encapsulated listener.


Method Summary
 void cancelRegistration()
          Called when the event sending infrastructure decides to give up on the event registration associated with this sender.
 boolean runAfter(EventSender other)
          Return true if the passed EventSender should run before this one, otherwise return false.
 void sendEvent(JavaSpace source, long now, ProxyPreparer preparer)
          Send a remote event to the encapsulated listener of the encapsulated type, with the encapsulated handback, sequence number.
 

Method Detail

sendEvent

void sendEvent(JavaSpace source,
               long now,
               ProxyPreparer preparer)
               throws UnknownEventException,
                      ClassNotFoundException,
                      IOException
Send a remote event to the encapsulated listener of the encapsulated type, with the encapsulated handback, sequence number. No locks should be held while calling the listener. This method may be called more than once if all previous tries failed. This call may do nothing and return normally if it is determined that delivering the event is no longer useful. It is assumed that once this method returns normally it will not be called again.

Parameters:
source - the source the event object sent to the lister should have.
now - The current time.
preparer - to apply to the listener if it has been recovered from a store and not yet re-prepared in this VM.
Throws:
IOException - if the listener can not be unmarshalled. May throw RemoteException if the call to the listener or preparer does
ClassNotFoundException - if the listener needs to be unmarshalled and a necessary class can not be found.
UnknownEventException - if the call to the listener does. Note, this will not cause the watcher to remove itself.
SecurityException - if the call to the listener does or if the listener needs to be prepared and the prepareProxy call does.
RuntimeException - if the call to the listener does.

cancelRegistration

void cancelRegistration()
Called when the event sending infrastructure decides to give up on the event registration associated with this sender.


runAfter

boolean runAfter(EventSender other)
Return true if the passed EventSender should run before this one, otherwise return false.

Parameters:
other - the sender this object should compare itself too.
Returns:
true if this object should run after other.


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.