Custom Event Beans as Event Sinks

15-6 Oracle Complex Event Processing Developers Guide For complete API reference information about the Oracle CEP APIs described in this section, see the Oracle Fusion Middleware Java API Reference for Oracle Complex Event Processing.

15.2.3 Implementing a Custom Event Bean Factory

Your adapter factory class must implement the com.bea.wlevs.ede.api.EventBeanFactory interface, which has a single method, create, in which you code the creation of your specific adapter class. Event beans implement Factory. The following is a possible adapter factory class for the HelloWorld example: package com.acem; import com.bea.wlevs.ede.api.EventBean; import com.bea.wlevs.ede.api.EventBeanFactory; public class MyEventBeanFactory implements Factory { public MyEventBeanFactory { } public synchronized EventBean create throws IllegalArgumentException { return new MyEventBeanFactory; } } For full details of these APIs, see the Oracle Fusion Middleware Java API Reference for Oracle Complex Event Processing.

15.3 Configuring the Custom Event Bean EPN Assembly File

The custom event bean and custom event bean factory if used must be registered in the EPN assembly file, as discussed in the following sections: ■ Section 15.3.1, Registering the Custom Event Bean Factory ■ Section 15.3.2, Declaring the Custom Event Bean Components in your Application For a complete description of the configuration file, including registration of other components of your application, see Section 4.3, Creating EPN Assembly Files.

15.3.1 Registering the Custom Event Bean Factory

You register factories in the EPN assembly file using the wlevs:factory element: wlevs:factory provider-name=myprovider class=my.Implementation If you need to specify service properties, then you must use the osgi:service element to register the factory as an OSGI service in the EPN assembly file. The scope of the OSGI service registry is the entire Oracle CEP. This means that if more than one application deployed to a given server is going to use the same adapter factory, be sure to register the adapter factory only once as an OSGI service. Add an entry to register the service as an implementation of the com.bea.wlevs.ede.api.EventBeanFactory interface. Provide a property, with the key attribute equal to type, and the name by which this adapter provider will be referenced. Finally, add a nested standard Spring bean element to register your specific adapter class in the Spring application context