org.alfresco.bm.server
Class EventController
java.lang.Object
java.lang.Thread
org.alfresco.bm.server.EventController
- All Implemented Interfaces:
- Runnable, EventListener, ConfigConstants, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>
public class EventController
- extends Thread
- implements org.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>, org.springframework.context.ApplicationContextAware, ConfigConstants
A master controlling thread that ensures that:
- reads events from the queue
- checks out threads to process events
- monitors event processors
- records event executions
- handles exceptions e.g. events that take too long to process
Application events are monitored to start, stop and otherwise control
the threads.
- Since:
- 1.0
- Author:
- Derek Hulley
| Fields inherited from interface org.alfresco.bm.server.ConfigConstants |
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_EVENT_PROCESSOR_THREADS, PROP_HTTP_CONNECTION_MAX, PROP_HTTP_CONNECTION_TIMEOUT_MS, PROP_HTTP_SOCKET_TIMEOUT_MS, PROP_MONGO_URI, PROP_SERVER_ID, PROP_TEST_NAME, PROP_TEST_RUN_FQN, PROP_TEST_RUN_NAME, SEPARATOR |
|
Method Summary |
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 |
setQueuePollTimeMs(long queuePollTimeMs)
The time between polls of the event provider. |
void |
setQueueRestAgeMs(long queueRestAgeMs)
Set the time allowed before events can be requeued. |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, 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 |
EventController
public EventController(String serverId,
String testRunFqn,
EventService eventService,
EventProcessorRegistry eventProcessors,
ExecutorService executor,
ResultService resultService)
- Construct the controller
- Parameters:
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 eventsexecutor - the service that will provide the worker threads for processingresultService - the service used to store and retrieve event results
setQueuePollTimeMs
public void setQueuePollTimeMs(long queuePollTimeMs)
- The time between polls of the event provider.
Default is
DEFAULT_QUEUE_POLL_TIME_MS.
- Parameters:
queuePollTimeMs - the time between checks for events
setQueueRestAgeMs
public void setQueueRestAgeMs(long queueRestAgeMs)
- Set the time allowed before events can be requeued.
Default is
DEFAULT_QUEUE_REST_AGE_MS.
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
- Record the application context for shutdown once processing has finished
- Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
onApplicationEvent
public void onApplicationEvent(org.springframework.context.event.ApplicationContextEvent event)
- The application context is started externally but may be stopped internally
- Specified by:
onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>
run
public void run()
- Specified by:
run in interface Runnable- Overrides:
run in class Thread
Copyright © 2012. All Rights Reserved.