How to Assemble a Custom Event Bean in its Own Bundle

24-20 Oracle Complex Event Processing Developers Guide Example 24–2 shows how to use the bundler.sh to create an OSGi bundle for an Oracle JDBC driver. Example 24–2 Using the Bundler Utility bundler.sh \ -source C:\drivers\com.oracle.ojdbc14_11.2.0.jar \ -name oracle11g \ -version 11.2.0 \ -factory oracle.jdbc.xa.client.OracleXADataSource oracle.jdbc.OracleDriver \ -service javax.sql.XADataSource java.sql.Driver \ -targetdir C:\stage The source JAR is an Oracle driver located in directory C:\drivers. The name of the generated bundle JAR is the concatenation of the -name and -version arguments oracle10g_11.2.0.jar and is created in the C:\stage directory. The bundle JAR contains the files that Example 24–3 shows. Example 24–3 Bundle JAR Contents 1465 Thu Jun 29 17:54:04 EDT 2006 META-INFMANIFEST.MF 1540457 Thu May 11 00:37:46 EDT 2006 com.oracle.ojdbc14_11.2.0.jar 1700 Thu Jun 29 17:54:04 EDT 2006 combeacoretoolsbundlerActivator.class The command line options specify that there are two factory classes that will be instantiated and registered as an OSGi service when the bundle is activated, each under a separate object class as Table 24–4 shows. Each service registration will be made with a name property set to oracle11g and a version property with a value of 11.2.0. Example 24–4 shows the Oracle CEP server log messages showing the registration of the services. Example 24–4 Service Registration Log Messages ... INFO: [Jun 29, 2006 5:54:18 PM] Service REGISTERED: { version=11.2.0, name=oracle11g, objectClass=[ javax.sql.XADataSource ], service.id=23 } INFO: [Jun 29, 2006 5:54:18 PM] Service REGISTERED: { version=11.2.0, name=oracle11g, objectClass=[ java.sql.Driver ], service.id=24 } INFO: [Jun 29, 2006 5:54:18 PM] Bundle oracle11g STARTED ...

3. Copy the application library JAR to the appropriate Oracle CEP server application

library directory: -explode This optional flag specifies that the content of the source JAR should be exploded into the target JAR file. By default, the source JAR is nested within the target JAR file and the generated bundle manifest will contain an appropriate Bundle-Classpath attribute. -verbose An optional flag to enable verbose output. Table 24–4 Factory Class and Service Interfacee Factory Class Service Interface oracle.jdbc.xa.client.OracleXADataSource javax.sql.XADataSource oracle.jdbc.OracleDriver java.sql.Driver Table 24–3 Cont. bundler.sh Command Line Options Argument Description