Click OK. How to Configure an Absolute Path

24-22 Oracle Complex Event Processing Developers Guide

6. Right-click the src directory and select New Class.

The Java Class dialog appears as Figure 24–9 shows. Figure 24–9 New Java Class Dialog 7. Configure the New Java Class dialog as Table 24–5 shows. Leave the other parameters at their default values.

8. Click Finish.

A new Java class is added to your project. 9. Edit the Java class to implement it as Example 24–5 shows. Be sure to set the NAME and VERSION so that they supersede the existing version of JDBC driver. In this example, the existing version is: ■ oracle10g ■ 10.0.0 To supersede the existing version, the MyActivator class sets these values to: ■ oracle11g ■ 11.2.0 Table 24–5 New Java Class Parameters Parameter Description Package The package name. For example, com.foo. Name The name of the class. For example, MyActivator. Assembling and Deploying Oracle CEP Applications 24-23 Example 24–5 MyActivator Class Implementation package com.foo; import java.util.Dictionary; import java.util.Properties; import javax.sql.XADataSource; import java.sql.Driver; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceRegistration; public class MyActivator implements BundleActivator { private static final String NAME=oracle11g; private static final String VERSION=11.2.0; private String[] factories = {oracle.jdbc.xa.client.OracleXADataSource,oracle.jdbc.OracleDriver}; private String[] interfaces= {javax.sql.XADataSource,java.sql.Driver}; private ServiceRegistration[] serviceRegistrations = new ServiceRegistration[factories.length]; public void startBundleContext bc throws Exception { Dictionary props = new Properties; props.putname, NAME; props.putversion, VERSION; for int i=0; ifactories.length; i++ { Object svc = bc.getBundle.loadClassfactories[i].newInstance; serviceRegistrations[i] = bc.registerServiceinterfaces[i], svc, props; } } public void stopBundleContext bc throws Exception { for int i=0; iserviceRegistrations.length; i++ { serviceRegistrations[i].unregister; } } }

10. Right-click the META-INFMANIFEST.MF file and select Open With Plug-in

Manifest Editor . The Manifest Editor appears as Figure 24–10 shows.