|
org.codehaus.gpars | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovyx.gpars.util.AsyncMessagingCore
public abstract class AsyncMessagingCore
Field Summary | |
---|---|
private static int |
ACTIVE
|
private static int |
PASSIVE
|
private int |
active
|
private static java.util.concurrent.atomic.AtomicIntegerFieldUpdater |
activeUpdater
|
private boolean |
fair
|
private MessageQueue |
queue
|
private Pool |
threadPool
|
Constructor Summary | |
protected AsyncMessagingCore(Pool threadPool)
|
Method Summary | |
---|---|
void
|
attachToThreadPool(Pool threadPool)
Retrieves the agent's fairness flag Fair agents give up the thread after processing each message, non-fair agents keep a thread until their message queue is empty. |
protected boolean
|
continueProcessingMessages()
Informs about a new thread being assigned to process the next message |
Pool
|
getThreadPool()
|
protected void
|
handleMessage(java.lang.Object message)
|
boolean
|
isFair()
Makes the agent fair. |
void
|
makeFair()
Indicates, whether there's an active thread handling a message inside the agent's body |
protected void
|
registerError(java.lang.Throwable e)
|
void
|
run()
|
void
|
schedule()
Removes the head of the message queue |
void
|
store(java.lang.Object message)
|
java.lang.Object
|
sweepNextMessage()
|
protected void
|
threadAssigned()
|
protected void
|
threadUnassigned()
|
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Field Detail |
---|
private static final int ACTIVE
private static final int PASSIVE
@java.lang.SuppressWarningsthreadPool.execute(this); } private int active
private static final java.util.concurrent.atomic.AtomicIntegerFieldUpdater activeUpdater
private boolean fair
private final MessageQueue queue
private Pool threadPool
Constructor Detail |
---|
protected AsyncMessagingCore(Pool threadPool)
Method Detail |
---|
public final void attachToThreadPool(Pool threadPool)
protected boolean continueProcessingMessages()
Pool getThreadPool()
protected void handleMessage(java.lang.Object message)
public boolean isFair()
public void makeFair()
protected void registerError(java.lang.Throwable e)
@java.lang.Override} finally { @java.lang.SuppressWarningsthreadUnassigned(); public final void run()
void schedule()
public void store(java.lang.Object message)
public java.lang.Object sweepNextMessage()
@java.lang.SuppressWarnings protected void threadAssigned()
@java.lang.SuppressWarnings protected void threadUnassigned()
Copyright © 2008–2013 Václav Pech. All Rights Reserved.