Component Configuration Files Overview of the Oracle CEP Programming Model

Overview of Creating Oracle CEP Applications 1-13 channel channel namehelloworldOutputChannelname max-size10000max-size max-threads2max-threads channel n1:config For more information, see: ■ Section 1.1.5.1, Accessing Component and Server Configuration Using the ConfigurationPropertyPlaceholderConfigurer Class ■ Section 1.1.6, How Components Fit Together ■ Section 4.4, Creating Component Configuration Files ■ Appendix B.2, Component Configuration Schema wlevs_application_config.xsd 1.1.5.1 Accessing Component and Server Configuration Using the ConfigurationPropertyPlaceholderConfigurer Class Using the ConfigurationPropertyPlaceholderConfigurer class, you can reference existing configuration file properties, in both component configuration and server configuration files, using a symbolic placeholder. This allows you to define a value in one place and refer to that one definition rather than hard-coding the same value in many places. For example, given the element that Example 1–5 shows, you can refer to the netio element port value as Example 1–6 shows. Example 1–5 netio Element netio nameMyNetIOname port9003port netio Example 1–6 Accessing the netio Element port Value property name=myprop value={MyNetIO.port} To use this feature, insert a ConfigurationPropertyPlaceholderConfigurer bean in the application context configuration file of your application bundle as Example 1–7 shows. Example 1–7 Adding a ConfigurationPropertyPlaceholderConfigurer bean class=com.bea.wlevs.spring.support.ConfigurationPropertyPlaceholderConfigurer For complete details, see the com.bea.wlevs.spring.support.ConfigurationPropertyPlaceholderCon figurer class in the Oracle Fusion Middleware Java API Reference for Oracle Complex Event Processing. For more information on accessing property files, see Section 4.7.3, How to Add a Property File to an Oracle CEP Project . 1-14 Oracle Complex Event Processing Developers Guide

1.1.6 How Components Fit Together

Oracle CEP applications are made of services that are assembled together to form an Event Processing Network EPN. The server uses the Spring framework as its assembly mechanism due to Springs popularity and simplicity. Oracle CEP has extended the Spring framework to further simplify the process of assembling applications. This approach allows Oracle CEP applications to be easily integrated with existing Spring-beans, and other light-weight programming frameworks that are based upon a dependency injection mechanism. A common approach for dependency injection is the usage of XML configuration files to declaratively specify the dependencies and assembly of an application. You assemble an Oracle CEP application an EPN assembly file before deploying it to the server; this EPN assembly file is an extension of the Spring framework XML configuration file. After an application is assembled, it must be package so that it can be deployed into Oracle CEP. This is a simple process. The deployment unit of an application is a plain JAR file, which must contain, at a minimum, the following artifacts: ■ The compiled application Java code of the business logic POJO. ■ Component configuration files. Each processor is required to have a configuration file, although adapters and streams do not need to have a configuration file if the default configuration is adequate and you do not plan to monitor these components. ■ The EPN assembly file. ■ A MANIFEST.MF file with some additional OSGi entries. After you assemble the artifacts into a JAR file, you deploy this bundle to Oracle CEP so it can immediately start receiving incoming data. For more information, see Chapter 24, Assembling and Deploying Oracle CEP Applications .

1.1.7 Extending the EPN

In addition to the components that Oracle CEP provides, you can extend the EPN by creating custom adapters, event beans, and Spring beans. You can also extend the EPN using the Oracle Java data cartridge and Oracle Spatial to incorporate Java and Oracle Spatial operations in your Oracle CQL queries. You can also expose Oracle CEP applications as Web services and consume Web services in your Oracle CEP application. For more information, see Part IV, Extending the Oracle CEP Event Processing Network

1.1.8 High Availability and Scalability

When designing an Oracle CEP application, it is a best practice to consider high availability and scalability early in the design process. Oracle CEP provides a range of high availability options that allow you to declaratively configure the quality of service your application requires for recovering from server failures. Oracle CEP also provides a variety of features that allow you to scale your application to accommodate increasing event rates. Overview of Creating Oracle CEP Applications 1-15 For more information, see: ■ Part V, Developing Applications for High Availability ■ Part VI, Developing Applications for Scalability

1.1.9 Oracle CEP Application Lifecycle

Figure 1–2 shows a state diagram for the Oracle CEP application lifecycle. In this diagram, the state names STARTING, INITIALIZING, RUNNING, SUSPENDING, SUSPENDED, and FAILED correspond to the ApplicationRuntimeMBean method getState return values. These states are specific to Oracle CEP; they are not OSGi bundle states. Figure 1–2 Oracle CEP Application Lifecycle State Diagram This section describes the lifecycle of an application deployed to the Oracle CEP server and the sequence of com.bea.wlevs.ede.api API callbacks. The lifecycle description is broken down into actions that a user performs, including: ■ Section 1.1.9.1, User Action: Installing an Application or Start the Server With Application Already Deployed ■ Section 1.1.9.2, User Action: Suspend Application ■ Section 1.1.9.3, User Action: Resume Application ■ Section 1.1.9.4, User Action: Uninstall Application ■ Section 1.1.9.5, User Action: Update Application ■ Section 1.1.9.6, User Action: Calling Methods of Stream and Relation Sources and Sinks Note: For information on Oracle CEP server lifecycle, see Oracle CEP Server Lifecycle in the Oracle Complex Event Processing Administrators Guide.