|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jegg.EggBase
A convenience base class for a concrete egg implementation. Rather than directly implement the jegg.Egg interface, an application egg can extend this base class.
This class handles the context configuration from the JEgg framework
and makes the context available to the derived class via a getter method,
and provides a default implementation of the init
method that
the framework calls to complete the initialization of the egg, prior to
delivering the first application message to the egg.
For each message type that the derived class can handle, it should include a method of the following form:
public void handle([message-type]);where [message-type] is the concrete class name of the message type that method can handle. All handler methods should follow this naming convention - it's expected by the message dispatcher.
Constructor Summary | |
EggBase()
|
Method Summary | |
protected EggContext |
getContext()
Return this egg's current context. |
protected Port |
getPort()
Return this egg's message port. |
void |
init()
A default implementation, that does nothing, of the initialization method used by the framework to complete the initialization of the derived class egg. |
void |
setContext(EggContext c)
Set the application context for this egg. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface jegg.Egg |
handle |
Constructor Detail |
public EggBase()
Method Detail |
public final void setContext(EggContext c)
Egg
setContext
in interface Egg
c
- this eggs application context.public void init() throws UnableToInitializeException
init
in interface Egg
UnableToInitializeException
- if this egg cannot complete its
initialization.protected final EggContext getContext()
protected Port getPort()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |