edu.vub.at.actors.natives
Class ELFarReference
java.lang.Object
edu.vub.at.actors.eventloops.EventLoop
edu.vub.at.actors.natives.ELFarReference
- All Implemented Interfaces:
- ConnectionListener
- public final class ELFarReference
- extends EventLoop
- implements ConnectionListener
An instance of the class ELFarReference represents the event loop processor for
a remote far reference. That is, the event queue of this event loop serves as
an 'outbox' which is dedicated to a certain receiver object hosted by a remote virtual machine.
This event loop handles event from its event queue by trying to transmit them to a remote virtual machine.
- Author:
- tvcutsem
Nested Class Summary |
private class |
ELFarReference.TransmissionEvent
TransmissionEvent is a named subclass of event, which allows access to the message the
packet it is trying to send which is used, should the event be retracted. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
outboxFuture_
private BlockingFuture outboxFuture_
owner_
private final ELActor owner_
destination_
private final ATObjectID destination_
dispatcher_
private final org.jgroups.blocks.MessageDispatcher dispatcher_
connected_
private boolean connected_
disconnectedListeners_
private java.util.Vector disconnectedListeners_
reconnectedListeners_
private java.util.Vector reconnectedListeners_
ELFarReference
public ELFarReference(ATObjectID destination,
ELActor owner)
setRetractingFuture
public BlockingFuture setRetractingFuture()
- Signals the far reference that its owning actor has requested to retract unsent messages.
The interrupt will be handled as soon as the processing of the current event has finished
- Returns:
- a blocking future the ELActor thread can wait on.
handleRetractRequest
public void handleRetractRequest()
- Resolves the current interrupt's future with the vector of transmission events that are
in the event queue of the far reference. This is used to retrieve copies of all messages
being sent through this far reference. Note that this method performs no deserialisation
of the events into (copied) messages. Such deserialisation needs to be done by an ELActor,
not the ELFarReference which will execute this method.
addDisconnectionListener
public void addDisconnectionListener(ATObject listener)
addReconnectionListener
public void addReconnectionListener(ATObject listener)
removeDisconnectionListener
public void removeDisconnectionListener(ATObject listener)
removeReconnectionListener
public void removeReconnectionListener(ATObject listener)
handle
public void handle(Event event)
- Process message transmission events only when the remote reference
is connected. Otherwise, wait until notified by the connected callback.
- Specified by:
handle
in class EventLoop
- Parameters:
event
- the event object which was dequeued and which should be processed
event_transmit
public void event_transmit(ATAsyncMessage msg)
throws XIOProblem
- Throws:
XIOProblem
retractUnsentMessages
public ATTable retractUnsentMessages()
throws InterpreterException
- Throws:
InterpreterException
connected
public void connected()
- Specified by:
connected
in interface ConnectionListener
disconnected
public void disconnected()
- Specified by:
disconnected
in interface ConnectionListener
getDestinationVMAddress
private org.jgroups.Address getDestinationVMAddress()
execute
public void execute()
- Overrides:
execute
in class EventLoop