Class DefaultEventManager

    • Field Detail

      • PLUGIN_TYPE_DB_RESULT_SET_EVENT

        public static final String PLUGIN_TYPE_DB_RESULT_SET_EVENT
        The plug-in type ID for result set events.
        See Also:
        Constant Field Values
      • PLUGIN_TYPE_DB_MEMORY_RESULT_SET_EVENT

        public static final String PLUGIN_TYPE_DB_MEMORY_RESULT_SET_EVENT
        The plug-in type ID for memory result set events.
        See Also:
        Constant Field Values
      • PLUGIN_TYPE_MAIL_EVENT

        public static final String PLUGIN_TYPE_MAIL_EVENT
        The plug-in type ID for mail events.
        See Also:
        Constant Field Values
      • PLUGIN_TYPE_FILE_EVENT

        public static final String PLUGIN_TYPE_FILE_EVENT
        The plug-in type ID for file events.
        See Also:
        Constant Field Values
    • Constructor Detail

      • DefaultEventManager

        protected DefaultEventManager​(org.apache.commons.configuration2.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 be null nor contain null values.
        runtimeRequiredServices - The services required at runtime of the event manager. This must neither be null nor contain null values.
        Throws:
        ConfigurationException - If the password for this authenticated service cannot be parsed from the configuration, a ConfigurationException will be thrown.
      • DefaultEventManager

        @Deprecated(since="15.0.0",
                    forRemoval=true)
        protected DefaultEventManager​(org.apache.commons.configuration2.Configuration conf,
                                      Registry registry,
                                      String[] startupRequiredServices,
                                      String[] runtimeRequiredServices,
                                      Map<String,​Class<? extends Event>> supportedEvents)
                               throws ConfigurationException
        Deprecated, 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 be null nor contain null values.
        runtimeRequiredServices - The services required at runtime of the event manager. This must neither be null nor contain null values.
        supportedEvents - The events supported by subclasses. This may be null. 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, a ConfigurationException will be thrown.
      • DefaultEventManager

        public DefaultEventManager​(org.apache.commons.configuration2.Configuration conf,
                                   Registry registry)
                            throws ConfigurationException
        Creates a new service polling for DB, mail and file events and handling them appropriately.
        Subclasses should use DefaultEventManager(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, a ConfigurationException will be thrown.
    • Method Detail

      • 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, a ServiceNotKnownException will be thrown.
        SQLException - If creating the connection to the data source fails, an SQLException will 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 be null.
        password - The password to log on a the database with. Depending on the JDBC-driver, this may be null.
        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, a ConfigurationException will be thrown.
        SQLException - If creating the connection to the JDBC-database fails, an SQLException will 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 be null.
        password - The password to log on a the database with. Depending on the JDBC-driver, this may be null.
        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, a ConfigurationException will be thrown.
        SQLException - If creating the connection to the JDBC-database fails, an SQLException will be thrown.