|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jegg.impl.PortImpl
Used to deliver a message to an egg. Each Egg instance has just one message port instance that other eggs can use to send it messages. Any message that is written to an egg port will be delivered, asynchronously, to the egg that the port belongs to.
An egg can publish its port in the JEgg port registry so that other
eggs will be able to send it messages (see Egg.publishPort()
).
Method Summary | |
void |
connect(Port port)
Add a port to the list of ports that broadcast messages will be sent to. |
void |
disconnect(Port port)
Remove a connected port. |
java.lang.Object |
getId()
Return the ID of the egg that owns this port. |
java.lang.Class[] |
getInterface()
Return the set of message types understood by the egg associated with this message port. |
void |
send(Message m)
Deliver a message to the egg that owns this port. |
void |
send(java.lang.Object o)
Deliver an object as a message to the egg that owns this port. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public java.lang.Class[] getInterface()
Port
getInterface
in interface Port
public java.lang.Object getId()
Port
getId
in interface Port
public final void send(java.lang.Object o) throws PortException
send
in interface Port
o
- the object to send to this port's owner. The
object will be delivered wrapped in a Message instance.
PortException
public final void send(Message m) throws PortException
send
in interface Port
PortException
public final void connect(Port port)
port
- xxpublic final void disconnect(Port port)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |