Register a custom event provider
To process events generated by SPE processing through your host application, the application needs to register an event provider.
An event provider consists of two components:
- An event store provider, which is a Java class that implements
the
com.ibm.spe.core.events.IEventStoreProvider
interface. - An event store, which is a Java class that implements the
com.ibm.spe.core.events.IEventStore
interface. SPE includes an implementation (com.ibm.spe.core.events.SPEEventStore
) that is sufficient to work with most event store providers.
You can register
an event provider in two ways: directly or indirectly.
- Use the direct method if the event provider is not going to change,
or the host application doesn't want the event provider to be overridden.
Example call:
SPE.registerProvider(IEventStoreProvider.PROVIDER_KEY, "yourEventProviderClassName");
- Use the indirect method if the application allows overriding the
event provider without having to recompile the application code. This
method checks the customer_overrides.properties for
the specified
spePropertyName
key and, if found, registers that event provider class name. Otherwise, it registers thedefaultEventProviderClassName
. Example call:SPE.registerProvider(IEventStoreProvider.PROVIDER_KEY, "defaultEventProviderClassName", "spePropertyName")
If properly registered, events generated during SPE processing
(enveloping, de-enveloping, and so on) are sent to the registered
event provider via the IEventStoreProvider.fireEvent
method.