|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.fhg.igd.semoa.server.AgentContext
Is a placeholder of an agent. Instances of this class are used by the server to manage agents.
Lifecycle| Field Summary | |
private Map |
fields_
The private fields of this AgentContext. |
private Object |
lock_
The lock object. |
private static Logger |
log_
The Logger instance for this class |
private int |
state_
The state of the agent. |
static String |
WHATIS
The WhatIs entry key for this service. |
| Constructor Summary | |
AgentContext()
Creates an instance. |
|
AgentContext(Map map)
Creates an instance that is backed by the given Map. |
|
| Method Summary | |
void |
clearThreadLocals()
Clears the annotations of the calling thread. |
Object |
doSynchronized(SyncedOperation op)
Runs the given SyncedOperation in a
synchronized block. |
Object |
get(FieldType field)
|
void |
initThreadLocals()
Annotates the current thread with the agent's thread local variables. |
void |
join()
Waits until all threads of this agent have terminated. |
void |
load()
|
void |
notifyListeners(String action)
Sends out an AgentEvent with the given action. |
Object |
set(FieldType field,
Object value)
Sets the given field to the given value. |
protected Bootstrapper.Action |
sigterm(Bootstrapper bs,
ErrorCode err)
|
void |
start()
Starts the agent. |
String |
toString()
Prints basic information about the agent described by this context. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private static Logger log_
Logger instance for this class
public static final String WHATIS
WhatIs entry key for this service.
private transient Map fields_
AgentContext.
Fields are identified by FieldType instances.
FieldTypeprivate Object lock_
private int state_
| Constructor Detail |
public AgentContext()
public AgentContext(Map map)
Map.
map - The Map that is used to store
the fields of this AgentContext.
NullPointerException - if the argument is
null.| Method Detail |
public Object set(FieldType field,
Object value)
field - The FieldType of the field
that is set to the given value.value - The object that is set or null
if the field shall be cleared. Be careful not to loose
important objects by erroneously clearing a field.
Weird errors could occur.
null
if the field wasn't initialized.
NullPointerException - if the given field type
is null.public Object get(FieldType field)
null
if the field is not initialized.
NullPointerException - if the given field type
is null.
public Object doSynchronized(SyncedOperation op)
throws InvocationTargetException
SyncedOperation in a
synchronized block.
op - The SyncedOperation that is
invoked.
SyncedOperation.
NullPointerException - if op
is null.
InvocationTargetException - if the
SyncedOperation threw an exception. The
target exception is the exception that was thrown.public void join()
public void load()
throws IOException
IOException
public void start()
throws LifecycleException
LifecycleException - if the agent type is not
supported by the installed lifecycles.
protected Bootstrapper.Action sigterm(Bootstrapper bs,
ErrorCode err)
public void initThreadLocals()
public void clearThreadLocals()
public void notifyListeners(String action)
AgentEvent with the given action.
action - The action string that identifies the event
subtype.
IllegalStateException - if the event dispatching
failed e.g., because of a lack of permissions.public String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||