bees.core
Class ExternalCoroutine
java.lang.Object
|
+--bees.core.Coroutine
|
+--bees.core.ExternalCoroutine
- All Implemented Interfaces:
- ExternalChannel
- public final class ExternalCoroutine
- extends Coroutine
- implements ExternalChannel
An ExternalCoroutine is used to send ExternalCapsules between BDomains on
the same node.
|
Field Summary |
static int |
STATE_CONNECTED
The Coroutine is connected to its peer. |
static int |
STATE_CONNECTING
The Coroutine is attempting to connect to its peer. |
| Fields inherited from class bees.core.Coroutine |
DEFAULT_TIMEOUT, INVALID_ID, STATE_ANY, STATE_COMPLETE, STATE_ERROR, STATE_ERROR_CAGED, STATE_ERROR_INTERNAL, STATE_ERROR_TIMEOUT, STATE_ERROR_USER, STATE_NEWBORN, STATE_USER |
| Methods inherited from class bees.core.Coroutine |
finalize, getCoroutine, getID, getState, getThrowable, setState, setThrowable, waitForCompletion, waitForCompletion, waitForState, waitForState |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
STATE_CONNECTING
public static final int STATE_CONNECTING
- The Coroutine is attempting to connect to its peer.
STATE_CONNECTED
public static final int STATE_CONNECTED
- The Coroutine is connected to its peer.
ExternalCoroutine
public ExternalCoroutine()
- Construct an empty ExternalCoroutine object.
setLocal
public void setLocal(java.lang.Object obj)
- Specified by:
setLocal in interface ExternalChannel
getLocal
public java.lang.Object getLocal()
- Specified by:
getLocal in interface ExternalChannel
waitForConnection
public boolean waitForConnection()
- Wait for the coroutine to be connected to its peer.
- Returns:
- True if the coroutine was successfully connected to a peer.
connect
public void connect(ProtocolPresentation pp,
EventChannel ec,
bees.core.SessionType st)
- Connect this domain/coroutine to a peer BDomain.
- Parameters:
pp - The ProtocolPresentation that will process incoming capsules.ec - The channel used to send events to the peer BDomain.st - The session type this coroutine should be bound to.
disconnect
public void disconnect()
- Disconnect this coroutine from its peer.
disconnected
public void disconnected()
- Specified by:
disconnected in interface ExternalChannel
sendCapsule
public void sendCapsule(ExternalCapsule cap)
- Send a capsule to the peer coroutine.
- Specified by:
sendCapsule in interface ExternalChannel
- Parameters:
cap - The capsule to send.
recycleCapsule
public void recycleCapsule(ExternalCapsule ec)
- Specified by:
recycleCapsule in interface ExternalChannel
cleanup
public void cleanup()
- Description copied from class:
Coroutine
- Call back used to cleanup coroutines that are still in progress when a
BDomain has been shutdown.
- Overrides:
cleanup in class Coroutine
drop
public void drop()
- Description copied from class:
Coroutine
- Drop the Coroutine, which entails setting the unique identifier to
INVALID_ID.
- Overrides:
drop in class Coroutine
handle
public void handle(BeesEvent ae)
- Description copied from class:
Coroutine
- Callback used to handle BeesEvents directed to this Coroutine.
- Overrides:
handle in class Coroutine
- Following copied from class:
bees.core.Coroutine
- Parameters:
ae - The BeesEvent to handle.
toString
public java.lang.String toString()
- Overrides:
toString in class Coroutine
- Following copied from class:
bees.core.Coroutine
- See Also:
Object.toString()
This documentation is Copyright (C) 2002 The University of Utah. All Rights Reserved. See the individual source files for distribution terms.
Documentation, software, and mailing lists for Bees v0.5.0 can be found at the Janos Project: http://www.cs.utah.edu/flux/janos/