| 限定符和类型 | 字段和说明 |
|---|---|
protected String |
category |
static int |
DEFAULT_MAX_MESSAGES |
protected boolean |
hasThread |
protected boolean |
isActive |
protected DefaultActorManager |
manager |
protected List<DefaultMessage> |
messages |
protected String |
name |
protected boolean |
shutdown |
protected boolean |
suspended |
DEFAULT_CATEGORY| 构造器和说明 |
|---|
AbstractActor() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
activate()
Tell this actor it is active.
|
void |
addMessage(DefaultMessage message)
Queue a messaged to be processed later.
|
protected String |
bodyString() |
void |
deactivate()
Tell this actor it is no longer active.
|
String |
getCategory()
Get the actor's category.
|
boolean |
getHasThread() |
ActorManager |
getManager() |
protected DefaultMessage |
getMatch(String subject,
boolean isRegExpr)
Test a message against a defined subject pattern.
|
int |
getMaxMessageCount()
Limit the number of messages that can be received.
|
int |
getMessageCount()
Get the number of pending messages.
|
DefaultMessage[] |
getMessages() |
String |
getName()
Get an actor's name.
|
boolean |
isActive() |
boolean |
isShutdown()
Has shutdown() been called.
|
boolean |
isSuspended()
Test to see if suspended.
|
protected abstract void |
loopBody(Message m)
Process the accepted subject.
|
Message |
peekNext()
See if there is a pending message.
|
Message |
peekNext(String subject)
See if there is a pending message for a subject using exact match.
|
Message |
peekNext(String subject,
boolean isRegExpr)
See if a message exists that meets the selection criteria.
|
boolean |
receive()
Process a message conditionally.
|
boolean |
remove(Message message)
Remove (cancel) an unprocessed message.
|
void |
run() |
protected void |
runBody()
Do startup processing.
|
void |
setCategory(String category)
Set the actor's category.
|
protected void |
setHasThread(boolean hasThread) |
void |
setManager(DefaultActorManager manager) |
void |
setName(String name)
Set an actors name.
|
void |
setSuspended(boolean f)
Temporarily suspend the reception of messages.
|
void |
shutdown()
End reception of new messages.
|
protected Message |
testMessage()
Test the current message.
|
String |
toString() |
boolean |
willReceive(String subject)
Test to see if a message should be processed.
|
public static final int DEFAULT_MAX_MESSAGES
protected DefaultActorManager manager
protected String name
protected String category
protected List<DefaultMessage> messages
protected boolean isActive
protected boolean hasThread
protected volatile boolean shutdown
protected volatile boolean suspended
public ActorManager getManager()
public void setManager(DefaultActorManager manager)
public String getName()
Actorpublic void setName(String name)
Actorpublic String getCategory()
ActorgetCategory 在接口中 Actorpublic void setCategory(String category)
ActorsetCategory 在接口中 Actorpublic boolean receive()
receive 在接口中 ActortestMessage()public boolean willReceive(String subject)
willReceive 在接口中 Actorprotected Message testMessage()
protected abstract void loopBody(Message m)
protected DefaultMessage getMatch(String subject, boolean isRegExpr)
public DefaultMessage[] getMessages()
public int getMessageCount()
ActorgetMessageCount 在接口中 Actorpublic int getMaxMessageCount()
getMaxMessageCount 在接口中 Actorpublic void addMessage(DefaultMessage message)
public Message peekNext(String subject)
Actorpublic Message peekNext(String subject, boolean isRegExpr)
public boolean remove(Message message)
Actorpublic boolean isActive()
public void activate()
Actorpublic void deactivate()
Actordeactivate 在接口中 Actorprotected void runBody()
public boolean getHasThread()
protected void setHasThread(boolean hasThread)
protected String bodyString()
public boolean isShutdown()
ActorisShutdown 在接口中 Actorpublic void shutdown()
Actorpublic void setSuspended(boolean f)
ActorsetSuspended 在接口中 Actorpublic boolean isSuspended()
ActorisSuspended 在接口中 ActorCopyright © 2021. All rights reserved.