public class DefaultBascomConfig extends Object implements IBascomConfig
| Constructor and Description |
|---|
DefaultBascomConfig() |
| Modifier and Type | Method and Description |
|---|---|
protected static String |
constructThreadId(TaskThreadStat threadStat,
String id,
String name,
int max) |
long |
getDefaultOrchestratorTimeoutMs()
30-second default timeout.
|
ITaskClosureGenerator |
getExecutionHook(Orchestrator orc,
String pass)
Returns a generator for use within an orchestration execution scope --
i.e.
|
ExecutorService |
getExecutor()
The pool from which threads are drawn as needed for parallel execution.
|
int |
getThreadNameWidthMax()
Indicates the width max for thread names such that when exceeded a '..'
string will be provided in place of any more predecessors.
|
void |
notifyTerminate()
Called on shutdown (when it is possible to do so, typically in a
stand-alone program only).
|
void |
notifyThreadEnd(TaskThreadStat threadStat)
Called after a thread is has finished executing a task and there are no
other tasks ready to execute.
|
void |
notifyThreadStart(TaskThreadStat threadStat)
Sets the thread name.
|
protected void |
setThreadName(TaskThreadStat threadStat)
Sets the name of given thread like so:
|
static void |
shutdownAndAwaitTermination(ExecutorService pool)
Standard way to shutdown an executor as defined in ExecutorService
shutdown, used by this class and also made public here for
convenience.
|
public ExecutorService getExecutor()
IBascomConfiggetExecutor in interface IBascomConfigpublic long getDefaultOrchestratorTimeoutMs()
getDefaultOrchestratorTimeoutMs in interface IBascomConfigfor system default valuepublic void notifyTerminate()
IBascomConfignotifyTerminate in interface IBascomConfigpublic static void shutdownAndAwaitTermination(ExecutorService pool)
pool - to shutdownpublic int getThreadNameWidthMax()
public void notifyThreadStart(TaskThreadStat threadStat)
notifyThreadStart in interface IBascomConfigthreadStat - of the thread which is being startedsetThreadName(TaskThreadStat)protected void setThreadName(TaskThreadStat threadStat)
BT:ID:NAME#..11.12.13.14
Where:
threadStat - of the thread which is being startedprotected static String constructThreadId(TaskThreadStat threadStat, String id, String name, int max)
public void notifyThreadEnd(TaskThreadStat threadStat)
IBascomConfignotifyThreadEnd in interface IBascomConfigthreadStat - metadata for threadpublic ITaskClosureGenerator getExecutionHook(Orchestrator orc, String pass)
IBascomConfigOrchestrator.execute(long, String).
Subclasses can provide their own version instead of the default which
generates TaskMethodClosure instances directly. The returned
value can be a singleton or created for each call if the subclass needs
to keep its own state.getExecutionHook in interface IBascomConfigorc - on which the execution was invokedpass - provided as param to
Orchestrator.execute(long, String)Copyright © 2018. All rights reserved.