public class EventController extends Thread implements org.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>, org.springframework.context.ApplicationContextAware, ConfigConstants
Thread.State, Thread.UncaughtExceptionHandler
ConfigConstants.RunState
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
DEFAULT_RUNSTATE, DEFAULT_SERVER_ID, EXT_JAR, EXT_PROPERTIES, EXT_XML, PATH_CLASSES, PATH_CLUSTER_PROPERTIES, PATH_CLUSTERS, PATH_CONFIG, PATH_JARS, PATH_LOADED, PATH_RUN_PROPERTIES, PATH_RUNS, PATH_SERVER, PATH_SERVERS, PATH_TEST_CONTEXT, PATH_TEST_PROPERTIES, PATH_TESTS, PROP_CLUSTER, PROP_CONTROL_RUN_STATE, PROP_EVENTS_THREAD_COUNT, PROP_EVENTS_THREAD_EVENTSPERSECONDPERTHREAD, PROP_EVENTS_THREAD_WAITFORCOMPLETION, PROP_HTTP_CONNECTION_MAX, PROP_HTTP_CONNECTION_TIMEOUT_MS, PROP_HTTP_SOCKET_TIMEOUT_MS, PROP_HTTP_SOCKET_TTL_MS, PROP_MONGO_AUTOCONNECTRETRY, PROP_MONGO_CONNECTIONSPERHOST, PROP_MONGO_SOCKETTIMEOUT, PROP_MONGO_URI, PROP_MONGO_WRITENUMBER, PROP_SERVER_ID, PROP_TEST_NAME, PROP_TEST_RUN_FQN, PROP_TEST_RUN_NAME, SEPARATOR
Constructor and Description |
---|
EventController(String serverId,
String testRunFqn,
EventService eventService,
EventProcessorRegistry eventProcessors,
ResultService resultService,
int threadCount)
Construct the controller
|
Modifier and Type | Method and Description |
---|---|
void |
onApplicationEvent(org.springframework.context.event.ApplicationContextEvent event)
The application context is started externally but may be stopped internally
|
void |
run() |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
Record the application context for shutdown once processing has finished
|
void |
setEventsPerSecondPerThread(int eventsPerSecondPerThread)
Override the
maximum number of events
that can be processed per second per thread. |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public EventController(String serverId, String testRunFqn, EventService eventService, EventProcessorRegistry eventProcessors, ResultService resultService, int threadCount)
serverId
- the server controlling the eventstestRunFqn
- the fully qualified name of the test runeventService
- the source of events that will be pushed for executioneventProcessors
- the registry of processors for eventsresultService
- the service used to store and retrieve event resultsthreadCount
- the number of threads available to the processorpublic void setEventsPerSecondPerThread(int eventsPerSecondPerThread)
maximum
number of events
that can be processed per second per thread. This represents a maximum; lower volumes
will be processed at the required rate. Ensure there are enough threads available to
process events at the anticipated rate or change this value.public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public void onApplicationEvent(org.springframework.context.event.ApplicationContextEvent event)
onApplicationEvent
in interface org.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>
Copyright © 2014. All rights reserved.