|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RunActive
RunActive is related to the activity of an active object. When an active object is started, which means that its active thread starts and serves the requests being sent to its request queue, it is possible to define exactly how the activity (the serving of requests amongst others) will be done.
An object implementing this interface is invoked to run the activity until an event trigger its end. The object being reified as an active object can directly implement this interface or an external class can also be used.
It is the role of the body of the active object to perform the
call on the object implementing this interface. For an active object
to run an activity, the method runActivity
must not end
before the end of the activity. When the method runActivity
ends, the activity ends too and the endActivity
can be invoked.
Here is an example of a simple implementation of runActivity
method
doing a FIFO service of the request queue :
public void runActivity(Body body) { Service service = new Service(body); while (body.isActive()) { service.blockingServeOldest(); } }
Method Summary | |
---|---|
void |
runActivity(Body body)
Runs the activity of the active object. |
Method Detail |
---|
void runActivity(Body body)
body
- the body of the active object being started
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |