Dynamic Resource Injection Dynamic Resource Lookup Using JNDI

Overview of Creating Oracle CEP Applications 1-25 Example 1–17 Dynamic Resource Lookup Using JNDI import javax.naming.InitialContext; public class SimpleBean implements EventBean { ... public abstract void getDataSource throws Exception { InitialContext initialContext= new InitialContext ; return initialContext.lookup StockDs”; } } In Example 1–17 , the JNDI name StockDs must exactly match the name of the data source in the Oracle CEP server config.xml file as Example 1–8 shows.

1.4.4 Understanding Resource Name Resolution

Oracle CEP server resolves resource names by examining the naming scopes that Table 1–1 lists. Each naming scope contains a set of unique names. The name resolution behavior is specific to a naming scope. Some naming scopes resolve names by simple matching. Other scopes resolve names by mapping the name used to do the lookup into a new name. Once a name is mapped, lookup proceeds recursively beginning with the current scope.

1.5 Next Steps

After you have programmed all components of your application and created their configuration XML files: ■ Assemble all the components into a deployable OSGi bundle. This step also includes creating the MANIFEST.MF file that describes the bundle. See Section 24.2, Assembling an Oracle CEP Application. ■ Start Oracle CEP. See: – Section 5.3.1, How to Start a Local Oracle CEP Server – Section 5.3.2, How to Stop a Local Oracle CEP Server Note: You must disable security when starting the Oracle CEP server in order to use JNDI. Oracle does not recommend the use of JNDI for this reason. For more information, see Configuring Security for Oracle CEP in the Oracle Complex Event Processing Administrators Guide. Table 1–1 Resource Name Resolution Naming Scope Contents Resolution Behavior Component The property names of the component’s custom configuration Mapping Application The names of the configuration elements in the application configuration files Matching Server The names of the configuration elements in the server configuration file Matching JNDI The names registered in the servers JNDI registry Matching 1-26 Oracle Complex Event Processing Developers Guide ■ Optionally configure the server in your domain to enable logging, debugging, and other services. See: – Section 5.2, Creating Oracle CEP Servers – Section 5.3, Managing Oracle CEP Servers – Section 24.4, Managing Log Message Catalogs – Understanding Oracle CEP Configuration in the Oracle Complex Event Processing Administrators Guide ■ Deploy the application to Oracle CEP. See Section 24.5, Deploying Oracle CEP Applications. ■ Optionally, use the Oracle CEP load generator and Oracle CEP Visualizer to test and tune your Oracle CEP application. The Oracle CEP load generator is a testing tool that you can use to test your application, in particular its rules. This testing tool can temporarily replace the adapter component in your application, for testing purposes. For details, see Chapter 25, Testing Applications With the Load Generator and csvgen Adapter. The Oracle CEP Visualizer is a runtime administration console with advanced diagnostic and maintenance features that you can use to manage and tune your Oracle CEP application. For details, see Oracle Complex Event Processing Visualizer Users Guide.d See also Section 5.4, Debugging an Oracle CEP Application Running on an Oracle CEP Server .