|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.semispace.actor.Actor
public abstract class Actor
Implementation of an actor. You need to register the actor in a space, in order to get a lifetime of the actor. The read and take templates are registered at this time as well.
Constructor Summary | |
---|---|
Actor()
|
Method Summary | |
---|---|
Long |
getActorId()
|
long |
getDefaultLifeMsOfSpaceObject()
|
Object[] |
getReadTemplates()
Default implementation which renders empty array, ie nothing is tried read. |
Object[] |
getTakeTemplates()
Default implementation which renders an empty array, ie nothing is tried taken. |
abstract void |
receive(ActorMessage msg)
Receive a message which either matches the template, or that is addressed to this actor in particular (which implies that you need to check the type for each message). |
void |
register(SemiSpaceInterface registerWith)
Register with the space with a very long long actor life. |
void |
register(SemiSpaceInterface registerWith,
long actorLifeMs)
You must register with a space in order to activate the actor. |
void |
send(Long destinationId,
Object payload)
This is the regular method for sending a message to an actor. |
void |
send(Object obj)
Send two message to the space. |
void |
setDefaultLifeMsOfSpaceObject(long defaultLifeMsOfSpaceObject)
How long a message will live in the space when it is sent. |
void |
unregister()
Removing the connection(s) from the space rendering the actor, for all practical purposes, dead. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Actor()
Method Detail |
---|
public long getDefaultLifeMsOfSpaceObject()
public void setDefaultLifeMsOfSpaceObject(long defaultLifeMsOfSpaceObject)
public final void register(SemiSpaceInterface registerWith)
unregister()
,
register(SemiSpaceInterface, long)
public final void register(SemiSpaceInterface registerWith, long actorLifeMs)
actorLifeMs
- How long the actor shall be active in millisecondsunregister()
public void unregister()
public void send(Object obj)
public void send(Long destinationId, Object payload)
destinationId
- When replying to a message, the originatorId should
be the destination id. i.e. the destination addresspublic Long getActorId()
public Object[] getTakeTemplates()
public Object[] getReadTemplates()
getTakeTemplates()
public abstract void receive(ActorMessage msg)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |