|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jegg.impl.EggContextImpl
Constructor Summary | |
EggContextImpl(EggShell e)
|
Method Summary | |
void |
bindToPort(Port p)
Bind this egg to the specified port which belongs to another egg. |
Message |
createMessage(java.lang.Object m)
Create a message at the default priority that is ready to be directly written to a message port. |
Message |
createMessage(java.lang.Object m,
Priority p)
Create a message at the specified priority that is ready to be directly written to a message port. |
Timer |
createRepeatingTimer(long interval_msec,
long delay_msec)
Create a timer that will periodically send timeout messages to this egg. |
Timer |
createSingleShotTimer(long delay_msec)
Create a timer that will send a single timeout message to this egg. |
Message |
getCurrentMessage()
Return the message wrapper of the application message that is currently being handled. |
Dispatcher |
getDispatcher()
Return the dispatcher that this egg is assigned to. |
Port |
getFromPort()
Return the port of the egg that sent the application message that is currently being handled. |
java.lang.Object |
getId()
Return the ID of this egg as assigned to it in the application descriptor. |
java.lang.Class[] |
getInterface()
Return the set of message types that this egg recognizes. |
Port |
getPort()
Return this egg's message port. |
Property[] |
getProperties()
Return all of the properties configured on this egg in the application descriptor. |
java.lang.String |
getProperty(java.lang.String key)
Return a property configured on this egg in the application descriptor. |
java.lang.String |
getProperty(java.lang.String key,
java.lang.String defValue)
Return a property configured on this egg in the application descriptor. |
void |
publishPort(java.lang.String n)
Publish this egg's message port in the JEgg framework registry. |
void |
requestPort(java.lang.String n)
Request a lookup of a message port in the JEgg framework registry. |
void |
respond(java.lang.Object message)
Send a message to the egg that sent the current message. |
void |
respond(java.lang.Object message,
Priority priority)
Send a message to the egg that sent the current message. |
void |
respond(Port port,
java.lang.Object message)
Send a message to the egg that the specified port belongs to. |
void |
respond(Port port,
java.lang.Object message,
Priority priority)
Send a message to the egg that the specified port belongs to. |
void |
send(java.lang.Object msg)
Broadcast a message to all eggs that have bound to this egg's port (see bindToPort ). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EggContextImpl(EggShell e)
Method Detail |
public java.lang.String getProperty(java.lang.String key)
EggContext
getProperty
in interface EggContext
key
- the name of the property.
public java.lang.String getProperty(java.lang.String key, java.lang.String defValue)
EggContext
getProperty
in interface EggContext
key
- the name of the property.defValue
- the value to return if the property can't be found.
public Property[] getProperties()
EggContext
getProperties
in interface EggContext
public final void bindToPort(Port p)
EggContext
bindToPort
in interface EggContext
p
- the port to bind to in order to receive all broadcast
message from the egg that owns the port.public final Message createMessage(java.lang.Object m)
EggContext
send
method accepts the object message to send and
internally wraps it in a message instance.
createMessage
in interface EggContext
m
- the application message to wrap.
public final Message createMessage(java.lang.Object m, Priority p)
EggContext
createMessage
in interface EggContext
m
- the application message to wrap.p
- the priority to assign to the message.
public final Timer createRepeatingTimer(long interval_msec, long delay_msec)
EggContext
createRepeatingTimer
in interface EggContext
interval_msec
- the interval, in milliseconds, at which the
timeout messages should be sent.delay_msec
- the initial delay, in milliseconds, before the first timeout should
be sent.
public final Timer createSingleShotTimer(long delay_msec)
EggContext
createSingleShotTimer
in interface EggContext
delay_msec
- the initial delay, in milliseconds, before the timeout is sent.
public final Message getCurrentMessage()
EggContext
getCurrentMessage
in interface EggContext
public final Dispatcher getDispatcher()
EggContext
getDispatcher
in interface EggContext
public final Port getFromPort()
EggContext
getFromPort
in interface EggContext
public final java.lang.Object getId()
EggContext
getId
in interface EggContext
public final java.lang.Class[] getInterface()
EggContext
getInterface
in interface EggContext
public final Port getPort()
EggContext
getPort
in interface EggContext
public final void publishPort(java.lang.String n)
EggContext
publishPort
in interface EggContext
n
- the name that the message port should be published under.public final void requestPort(java.lang.String n)
EggContext
requestPort
in interface EggContext
n
- the name that the requested port is expected to be registered
under.public final void respond(java.lang.Object message)
respond
in interface EggContext
message
- the message to send to the sending egg.public final void respond(java.lang.Object message, Priority priority)
respond
in interface EggContext
message
- the message to send to the sending egg.priority
- the priority to assign to the message.public final void respond(Port port, java.lang.Object message)
respond
in interface EggContext
port
- the port to send the message on.message
- the message to send to the egg that
the specified port belongs to.public final void respond(Port port, java.lang.Object message, Priority priority)
respond
in interface EggContext
port
- the port to send the message on.message
- the message to send to the egg that
the specified port belongs to.priority
- the message's priority assignment.public final void send(java.lang.Object msg)
bindToPort
).
send
in interface EggContext
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |