org.codehaus.gpars

groovyx.gpars.agent
[Java] Class AgentCore

java.lang.Object
  groovyx.gpars.agent.AgentCore

@java.lang.SuppressWarningsprotected void handleMessage(final Object message) {
public abstract class AgentCore

Authors:
Vaclav Pech Date: 13.4.2010


Field Summary
private AsyncMessagingCore core

protected java.lang.Thread currentThread

private java.util.List errors

Adds the message to the agent\s message queue

 
Constructor Summary
protected AgentCore()

 
Method Summary
void attachToThreadPool(Pool threadPool)

Informs about a new thread being assigned to process the next message

void call(java.lang.Object message)

Dynamically dispatches the method call

java.util.List getErrors()

Indicates whether there have been exception thrown within the agent's body.

void handleMessage(java.lang.Object message)

boolean hasErrors()

boolean isFair()

Makes the agent fair.

void leftShift(java.lang.Object message)

void makeFair()

Adds the message to the agent\s message queue

void registerError(java.lang.Throwable e)

void send(java.lang.Object message)

void setPGroup(PGroup pGroup)

 
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

core

private final AsyncMessagingCore core


currentThread

protected java.lang.Thread currentThread


errors

private java.util.List errors
Adds the message to the agent\s message queue
Parameters:
message - A value or a closure


 
Constructor Detail

AgentCore

protected AgentCore()


 
Method Detail

attachToThreadPool

public final void attachToThreadPool(Pool threadPool)
Informs about a new thread being assigned to process the next message


call

@java.lang.SuppressWarnings* @param e The exception to store
public final void call(java.lang.Object message)
Dynamically dispatches the method call
Parameters:
message - A value or a closure


getErrors

@java.lang.SuppressWarnings({"SynchronizedMethod"})
public java.util.List getErrors()
Indicates whether there have been exception thrown within the agent's body.
Returns:
True, if any exceptions have occurred in the agent's body


handleMessage

void handleMessage(java.lang.Object message)


hasErrors

@java.lang.SuppressWarnings
public boolean hasErrors()


isFair

public boolean isFair()
Makes the agent fair. Agents are non-fair by default. Fair agents give up the thread after processing each message, non-fair agents keep a thread until their message queue is empty. Non-fair agents tend to perform better than fair ones.


leftShift

@java.lang.SuppressWarnings/**
public final void leftShift(java.lang.Object message)


makeFair

public void makeFair()
Adds the message to the agent\s message queue
Parameters:
message - A value or a closure


registerError

@java.lang.SuppressWarningstry {
void registerError(java.lang.Throwable e)


send

public final void send(java.lang.Object message)


setPGroup

public void setPGroup(PGroup pGroup)


 

Copyright © 2008–2013 Václav Pech. All Rights Reserved.