public interface IWorkerProcess
IHomeLayout.
Worker process component definitions have no resources beyond a property sheet. A worker process definition typically looks like this:
com.zfabrik.component.type=com.zfabrik.worker # worker configuration # # target states # worker.states=environment/webWorkerUp # # max worker thread pool concurrency # worker.concurrency=15 # # debug port # worker.debug.port=5001 # # timeout (in ms) before the worker will be forcefully killed at worker stop # worker.process.timeouts.termination=20000 # # vm options # worker.process.vmOptions=\ -Xmx128m -Xms128m -XX:+HeapDumpOnOutOfMemoryError \ -Duser.language=en \ -Dcom.sun.management.jmxremote.port=7778
Properties in detail:
http://blogs.sun.com/watt/resource/jvm-options-list.html for a general overview.
IDependencyComponent and ISystemState). Typically
system states.
The worker process, when starting, will
try to force preparation of these components (i.e. load the states in case of system states) and will try so again
during each verification and synchronization.
ApplicationThreadPool). In general this thread
pool is used for application type work (e.g. for web requests or parallel execution within
the application). This property helps achieving a simple but effective
concurrent load control
true and the home process has debugging enabled.
Otherwise the worker process will not be configured for debugging.
WORKER_DEBUG)
| Modifier and Type | Field and Description |
|---|---|
static String |
DEBUG_PORT
The debug port to use for this worker process, if it is configured for debugging
(see
WORKER_DEBUG)
This port is subject to variant computation in the presence of detached worker processes. |
static short |
DETACHED |
static String |
JMX_PORT
The jmx port to use for this worker process.
|
static String |
MSG_NODE
msg header providing id of target node if one specific
|
static String |
MSG_TARGET
msg header describing the target of a message
|
static String |
MSG_TARGET_ALL |
static String |
MSG_TARGET_HOME |
static String |
MSG_TARGET_NODE |
static String |
MSG_TIMEOUT
msg header providing the time out of the message operation (per node).
|
static short |
NOT_STARTED |
static short |
STARTED |
static short |
STARTING |
static String |
STATES
Target states (or dependency components) of the worker process (see above).
|
static short |
STOPPING |
static String |
TO_MSG
Timeout in milliseconds.
|
static String |
TO_MSG_DEF |
static String |
TO_START
Timeout in milliseconds.
|
static String |
TO_START_DEF |
static String |
TO_TERM
Timeout in milliseconds.
|
static String |
TO_TERM_DEF |
static String |
VMOPTS
General virtual machine parameters for the worker process.
|
static String |
WORKER_CONCURRENCY
Size of application thread pool (see
ApplicationThreadPool). |
static String |
WORKER_DEBUG
Debugging for the worker process will be configured if this property is set to
true and the home process has debugging enabled. |
| Modifier and Type | Method and Description |
|---|---|
void |
detach()
Detach this worker.
|
String |
getComponentName()
Get the worker process' component name
|
long |
getCreated()
Get the creation date of the worker process object (this is not necessarily the time it got started)
|
long |
getDetachTime()
Get the time of detachment (if any).
|
String |
getName()
Get the worker process's instance technical name
|
short |
getState()
get the state of this worker
|
boolean |
isRunning()
Returns whether the current process is running.
|
Map<String,Serializable> |
sendMessage(Map<String,Serializable> args,
long timeout)
send a message to the process.
|
Map<String,Serializable> |
sendMessage(Map<String,Serializable> args,
long timeout,
boolean killOnTimeOut)
send a message to the process.
|
void |
start()
start this worker
|
void |
stop()
Stop this worker
|
void |
stop(long timeout)
Stop this worker with a non-default timeout.
|
static final String VMOPTS
http://blogs.sun.com/watt/resource/jvm-options-list.html for a general overview.static final String STATES
static final String TO_START
static final String TO_TERM
static final String TO_MSG
static final String WORKER_CONCURRENCY
ApplicationThreadPool). In general this thread
pool is used for application type work (e.g. for web requests or parallel execution within
the application). This property helps achieving a simple but effective
concurrent load controlstatic final String WORKER_DEBUG
true and the home process has debugging enabled.
Otherwise the worker process will not be configured for debugging.
static final String DEBUG_PORT
WORKER_DEBUG)
This port is subject to variant computation in the presence of detached worker processes.static final String JMX_PORT
static final String TO_START_DEF
static final String TO_TERM_DEF
static final String TO_MSG_DEF
static final String MSG_TARGET
static final String MSG_TARGET_NODE
static final String MSG_TARGET_ALL
static final String MSG_TARGET_HOME
static final String MSG_NODE
static final String MSG_TIMEOUT
static final short NOT_STARTED
static final short STARTING
static final short STARTED
static final short DETACHED
static final short STOPPING
Map<String,Serializable> sendMessage(Map<String,Serializable> args, long timeout) throws IOException
args - a map of name value pairs that will be serialized as strings
to the slavetimeout - timeout for message answering in ms.IOExceptionMap<String,Serializable> sendMessage(Map<String,Serializable> args, long timeout, boolean killOnTimeOut) throws IOException
args - a map of name value pairs that will be serialized as strings
to the slavetimeout - timeout for message answering in ms.killOnTimeOut - if true a timeout will lead to a process termination.IOExceptionvoid stop()
void stop(long timeout)
void start()
void detach()
boolean isRunning()
short getState()
String getComponentName()
String getName()
long getCreated()
long getDetachTime()