How to Add a Standard JAR File to an Oracle CEP Project

4-32 Oracle Complex Event Processing Developers Guide Figure 4–32 Manifest Editor - Runtime Tab 8. Add the JAR file to your projects classpath as follows: ■ In the Manifest Editor, click the Add button. The JAR Selection dialog appears as shown in Figure 4–33 . Figure 4–33 JAR Selection Dialog Oracle CEP IDE for Eclipse Projects 4-33 ■ Select the JAR you want to add to the bundle. In this example, expand the lib directory and select the javax.jws_2.0.jar file. ■ Click OK. This adds the selected JAR to the Classpath list as Figure 4–34 shows. Figure 4–34 Manifest Editor Runtime tab After Adding a JAR to the Classpath ■ Press hit CTRL-SHIFT-S to save all files. This edits the MANIFEST.MF file, putting the JAR on your project classpath. To confirm this, in the Manifest Editor, click the MANIFEST.MF tab and note that the JAR is now listed under the Bundle-Classpath property as Figure 4–35 shows. 4-34 Oracle Complex Event Processing Developers Guide Figure 4–35 Manifest Editor MANIFEST.MF Tab Note also that the JAR now appears as a library at the root of the project as Figure 4–36 shows. Figure 4–36 Package Explorer 9. Optionally, if your bundle needs to export packages from this JAR to other bundles that will depend on this bundle, then you can export these packages as Section 4.7.4, How to Export a Package describes. Oracle CEP IDE for Eclipse Projects 4-35

4.7.2 How to Add an OSGi Bundle to an Oracle CEP Project

If the library you need to use is an OSGi bundle, you can add it to your Oracle CEP project. Alternatively, you can add a library as a standard JAR file see Section 4.7.1, How to Add a Standard JAR File to an Oracle CEP Project . To add an OSGi bundle to an Oracle CEP project, you add the bundle to that bundles dependencies definition. To add an OSGi bundle to an Oracle CEP project: 1. Place the OSGi bundle in the DOMAIN_DIRservernamemodules directory, where DOMAIN_DIR refers to the domain directory such as oracle_cepuser_ projectsdomainsmydomain and servername refers to the server instance, such as myserver. For example: c:\oracle_cep\user_projects\domains\mydomain\myserver\modules

2. Start the Oracle CEP IDE for Eclipse.

3. Right-click the project and select Refresh Targeted Runtime.

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

Manifest Editor . The Manifest Editor opens as Figure 4–37 shows. Figure 4–37 Manifest Editor: Dependencies Tab

5. Click the Dependencies tab.

6. In the Required Plug-ins area, click Add.

Note: This process only makes the referenced bundle available to your project at build time. It does not package the bundle directly with your application when it is deployed or exported. Instead, this bundle must be deployed to the Oracle CEP server manually. For more information, see Section 24.1.3, Application Libraries . 4-36 Oracle Complex Event Processing Developers Guide The Plug-in Selection dialog appears as shown in Figure 4–38 . Figure 4–38 Plug-in Selection Dialog 7. Select the bundle you added to the DOMAIN_DIRservernamemodules directory of your Oracle CEP server installation directory in step 1 and click OK. The selected bundle appears in the Require-Bundle section of the MANIFEST.MF file.

4.7.3 How to Add a Property File to an Oracle CEP Project

You can add a Java property file to an Oracle CEP project so that the property file is deployed with your application and is available at runtime. To add a property file to an Oracle CEP project: 1. Create a folder in your Oracle CEP IDE for Eclipse project to put the property files in. Oracle recommends that you create a folder to put them in such as properties. To create a new folder, tight-click your project folder and select New Folder. 2. Outside of the Oracle CEP IDE for Eclipse, copy your property file into the properties folder.

3. Inside the Oracle CEP IDE for Eclipse, right-click the properties folder and

select Refresh. The property file appears in the properties folder as Figure 4–39 shows. Oracle CEP IDE for Eclipse Projects 4-37 Figure 4–39 Oracle CEP IDE for Eclipse properties Directory

4. Expand the META-INF directory and right-click the MANIFEST.MF file and select

Open With Plug-in Manifest Editor . The Manifest Editor opens as Figure 4–40 shows. Figure 4–40 Manifest Editor: Build Tab

5. Click the Build tab.

6. Add your property file to the binary build under the project root as follows:

■ In the Binary Build area, expand the properties directory. ■ Check the box next to your property file as Figure 4–40 shows.