Class DefaultEventManager
java.lang.Object
de.aristaflow.adept2.base.service.AbstractADEPT2Service
de.aristaflow.adept2.base.service.AbstractNonPrivilegedService
de.aristaflow.adept2.core.eventmanager.common.AbstractEventManager
de.aristaflow.adept2.core.eventmanager.common.DefaultEventManager
- All Implemented Interfaces:
ADEPT2Service,LogService,ServiceThreadHandling,ActivityEventManager,EventManager,InstanceStartEventManager
The default event manager supports arbitrary events (e. g. events based on SQL databases,
(incoming) mails and changes in the file system) and provides access to a
Connection.-
Nested Class Summary
Nested classes/interfaces inherited from class de.aristaflow.adept2.base.service.AbstractADEPT2Service
AbstractADEPT2Service.ActiveSessions -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe plug-in type ID for memory result set events.static final StringThe plug-in type ID for result set events.static final StringThe plug-in type ID for file events.static final StringThe plug-in type ID for mail events.Fields inherited from class de.aristaflow.adept2.core.eventmanager.common.AbstractEventManager
activitySelecting, addEventSourceRetryCount, addEventSourceRetryDelay, addService, CONF_ADD_EVENT_SOURCE_RETRY_COUNT, CONF_ADD_EVENT_SOURCE_RETRY_DELAY, CONF_CREATE_WORKLIST_RETRY_DELAY, CONF_CREATE_WORKLIST_SILENT_COUNT, CONF_HANDLER_MIN_POOL_SIZE, CONF_HANDLER_PRIORITY, CONF_HANDLER_QUEUE_LIMIT, CONF_LIB_DIRECTORY, CONF_MIN_LOG_LEVEL_POOL_STATISTICS, CONF_MIN_POOL_SIZE, CONF_POLLER_PRIORITY, CONF_QUEUE_LIMIT_POOL_STATISTICS, CONF_SERVICE_TYPES_FOR_EVENTS, createWorklistRetryDelay, createWorklistSilentCount, dataLock, exmFactory, filterFactory, futures, handler, handlerMinPoolSize, handlerPriority, handlerQueueLimit, handlerService, handlerSource, instanceControl, libDirectory, MINIMAL_DELAY, minLogLevelPoolStatistics, minPoolSize, omm, pingWLMInterval, pm, pollerPriority, pollService, PREREGISTERED_EVENT_HANDLER, queueLimitPoolStatistics, reconnectLogLevel, reconnectWLMInterval, resumeOnly, runtimeService, sharedSources, sourceCount, sources, supportedEventTypes, updateInterval, worklistHandlerFields inherited from class de.aristaflow.adept2.base.service.AbstractADEPT2Service
CONF_CSV_LOGGING, configuration, logger, registry, runtimeRequiredServices, startupRequiredServicesFields inherited from interface de.aristaflow.adept2.core.eventmanager.ActivityEventManager
ACT_CONF_EVENT_TYPE, ACT_CONF_RETRY_COUNT, ACT_CONF_RETRY_DELAY, ACT_CONF_SOURCE_ID, ACT_CONF_SOURCE_TYPE, PLUGIN_TYPE_ACTIVITY_EVENT_HANDLERFields inherited from interface de.aristaflow.adept2.core.eventmanager.EventManager
PLUGIN_TYPE_EVENT_HANDLER -
Constructor Summary
ConstructorsModifierConstructorDescriptionDefaultEventManager(Configuration conf, Registry registry) Creates a new service polling for DB, mail and file events and handling them appropriately.protectedDefaultEventManager(Configuration conf, Registry registry, String[] startupRequiredServices, String[] runtimeRequiredServices) Creates a new service polling for events of registered event types (e. g.protectedDefaultEventManager(Configuration conf, Registry registry, String[] startupRequiredServices, String[] runtimeRequiredServices, Map<String, Class<? extends Event>> supportedEvents) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptiongetConnection(String dataSource, boolean readOnly) Retrieves a connection to the designated data source.getConnection(String driver, String connectionURL, String userName, String password) Retrieves a connection to a JDBC-database using the designated information.getConnection(String driver, String connectionURL, String userName, String password, boolean readOnly) Retrieves a connection to a JDBC-database using the designated information.Methods inherited from class de.aristaflow.adept2.core.eventmanager.common.AbstractEventManager
addEventHandler, addEventHandler, addEventHandler, addEventSource, addPreregistered, addPreregistered, createInstanceDataContainer, createSession, deselectActivity, getEventHandler, getEventSources, getHandlerExecutorService, getInstanceControl, getLatestTemplateReference, getPlugin, getProgressMonitor, getRuntimeEnvironment, getService, getSimpleSessionContext, getSupportedEventTypes, getSupportedEventTypes, getTemplateReference, init, mergeEventRequiredServices, removeAllSources, removeEventHandler, removeEventSource, selectActivity, shutdown, start, startActivity, startInstance, stopAndAbortInstanceMethods inherited from class de.aristaflow.adept2.base.service.AbstractNonPrivilegedService
authenticateService, awaitActiveSessions, getSecurityManager, getSessionFactory, simpleInitMethods inherited from class de.aristaflow.adept2.base.service.AbstractADEPT2Service
_sessionActive, _sessionFinished, activeOrInvalidServiceStateException, changeLogContext, changeLogContext, changeLogContext, consoleLog, csvLoggingEnabled, getClassSpecificJulLogger, getDependencyRegistry, getLocalUris, getLogger, getRelease, getRuntimeRequiredServices, getServiceInstanceName, getStartupRequiredServices, getURIs, getUserCredentials, isActive, isSessionActive, isShutdown, logMethodEntry, logMethodEntry, logMethodEntry, logMethodExit, logMethodExit, ping, preShutdown, privilegeSession, privilegeThread, revertLogContextChanges, sessionActive, sessionActive, sessionActive, sessionActive, sessionFinished, sessionFinished, signalShutdown, signalStart, unprivilegeThreadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.aristaflow.adept2.base.service.ADEPT2Service
getLocalUris, getRelease, getRuntimeRequiredServices, getServiceInstanceName, getStartupRequiredServices, getURIs, ping, preShutdownMethods inherited from interface de.aristaflow.adept2.core.eventmanager.InstanceStartEventManager
createAndStartInstance
-
Field Details
-
PLUGIN_TYPE_DB_RESULT_SET_EVENT
The plug-in type ID for result set events.- See Also:
-
PLUGIN_TYPE_DB_MEMORY_RESULT_SET_EVENT
The plug-in type ID for memory result set events.- See Also:
-
PLUGIN_TYPE_MAIL_EVENT
The plug-in type ID for mail events.- See Also:
-
PLUGIN_TYPE_FILE_EVENT
The plug-in type ID for file events.- See Also:
-
-
Constructor Details
-
DefaultEventManager
protected DefaultEventManager(Configuration conf, Registry registry, String[] startupRequiredServices, String[] runtimeRequiredServices) throws ConfigurationException Creates a new service polling for events of registered event types (e. g. DB, mail and file events) and handling them appropriately. This constructor is for subclasses allowing to extend the startup and runtime required services.- Parameters:
conf- The configuration of this event manager.registry- The registry for retrieving the services required by this service.startupRequiredServices- The services required by subclasses for starting and shutting down the event manager. This must neither benullnor containnullvalues.runtimeRequiredServices- The services required at runtime of the event manager. This must neither benullnor containnullvalues.- Throws:
ConfigurationException- If the password for this authenticated service cannot be parsed from the configuration, aConfigurationExceptionwill be thrown.
-
DefaultEventManager
@Deprecated(since="15.0.0", forRemoval=true) protected DefaultEventManager(Configuration conf, Registry registry, String[] startupRequiredServices, String[] runtimeRequiredServices, Map<String, Class<? extends Event>> supportedEvents) throws ConfigurationExceptionDeprecated, for removal: This API element is subject to removal in a future version.Creates a new service polling for DB, mail and file events and handling them appropriately. This constructor is for subclasses allowing to extend the startup and runtime required services as well as the supported event types.- Parameters:
conf- The configuration of this event manager.registry- The registry for retrieving the services required by this service.startupRequiredServices- The services required by subclasses for starting and shutting down the event manager. This must neither benullnor containnullvalues.runtimeRequiredServices- The services required at runtime of the event manager. This must neither benullnor containnullvalues.supportedEvents- The events supported by subclasses. This may benull. The keys of this map will be used to preregister event sources and handlers.- Throws:
ConfigurationException- If the password for this authenticated service cannot be parsed from the configuration, aConfigurationExceptionwill be thrown.
-
DefaultEventManager
Creates a new service polling for DB, mail and file events and handling them appropriately.
Subclasses should useDefaultEventManager(Configuration, Registry, String[], String[], Map)instead from their registry-conform public constructor.- Parameters:
conf- The configuration of this event manager.registry- The registry for retrieving the services required by this service.- Throws:
ConfigurationException- If the password for this authenticated service cannot be parsed from the configuration, aConfigurationExceptionwill be thrown.
-
-
Method Details
-
getConnection
public ExtendedConnection getConnection(String dataSource, boolean readOnly) throws ServiceNotKnownException, SQLException Retrieves a connection to the designated data source.- Parameters:
dataSource- The simple instance name of the data source to which to retrieve a connection.readOnly- whether the returned connection will be used as read-only- Returns:
- A connection to the designated data source.
- Throws:
ServiceNotKnownException- If the designated data source cannot be retrieved from the registry, aServiceNotKnownExceptionwill be thrown.SQLException- If creating the connection to the data source fails, anSQLExceptionwill be thrown.
-
getConnection
public Connection getConnection(String driver, String connectionURL, String userName, String password) throws ConfigurationException, SQLException Retrieves a connection to a JDBC-database using the designated information.- Parameters:
driver- The fully-qualified name of the class of the JDBC-driver.connectionURL- The URL to connect to the database.userName- The name of the user to log on at the database with. Depending on the JDBC-driver, this may benull.password- The password to log on a the database with. Depending on the JDBC-driver, this may benull.- Returns:
- A connection to a JDBC-database using the designated information.
- Throws:
ConfigurationException- If the designated JDBC-driver cannot is not found or cannot be instantiated, aConfigurationExceptionwill be thrown.SQLException- If creating the connection to the JDBC-database fails, anSQLExceptionwill be thrown.
-
getConnection
public Connection getConnection(String driver, String connectionURL, String userName, String password, boolean readOnly) throws ConfigurationException, SQLException Retrieves a connection to a JDBC-database using the designated information.- Parameters:
driver- The fully-qualified name of the class of the JDBC-driver.connectionURL- The URL to connect to the database.userName- The name of the user to log on at the database with. Depending on the JDBC-driver, this may benull.password- The password to log on a the database with. Depending on the JDBC-driver, this may benull.readOnly- whether the returned connection will be used as read-only- Returns:
- A connection to a JDBC-database using the designated information.
- Throws:
ConfigurationException- If the designated JDBC-driver cannot is not found or cannot be instantiated, aConfigurationExceptionwill be thrown.SQLException- If creating the connection to the JDBC-database fails, anSQLExceptionwill be thrown.
-
DefaultEventManager(Configuration, Registry, String[], String[])instead.