20 Assembling and Deploying Oracle CEP Applications

This section contains information on the following subjects:

20.1 Overview of Application Assembly and Deployment

The term application assembly refers to the process of packaging the components of an application, such as the Java files and XML configuration files, into an OSGI bundle that can be deployed to Oracle CEP. The term application deployment refers to the process of making an application available for processing client requests in an Oracle CEP domain.

This section describes:

Note:

Oracle CEP applications are built on top of the Spring Framework and OSGi Service Platform and make extensive use of their technologies and services. See Appendix A, "Additional Information about Spring and OSGi," for links to reference and conceptual information about Spring and OSGi.

20.1.1 Applications

In the context of Oracle CEP assembly and deployment, an application is defined as an OSGi bundle (see http://www2.osgi.org/javadoc/r4/org/osgi/framework/Bundle.html) JAR file that contains the following artifacts:

  • The compiled Java class files that implement some of the components of the application, such as the adapters, adapter factory, and POJO that contains the business logic.

  • One or more Oracle CEP configuration XML files that configure the components of the application. The only type of component that is required to have a configuration file is the complex event processor; all other components (adapters and streams) do not require configuration files if the default configuration of the component is adequate. You can combine all configuration files into a single file, or separate the configuration for individual components in their own files.

    The configuration files must be located in the META-INF/wlevs directory of the OSGi bundle JAR file if you plan to dynamically deploy the bundle. If you have an application already present in the domain directory, then the configuration files need to be extracted in the same directory.

  • An EPN assembly file that describes all the components of the application and how they are connected to each other.

    The EPN assembly file must be located in the META-INF/spring directory of the OSGi bundle JAR file.

  • A MANIFEST.MF file that describes the contents of the JAR.

20.1.2 Application Dependencies

The OSGI bundle declares dependencies by specifying imported and required packages. It also provides functionality to other bundles by exporting packages. If a bundle is required to provide functionality to other bundles, you must use Export-Package to allow other bundles to reference named packages. All packages not exported are not available outside the bundle.

You define dependencies at design time.

Some dependencies are satisfied by a component bundled in and deployed with the application. For example, standard JAR files or property files.

Other dependencies are satisfied by a component deployed to the Oracle CEP server application library directory. These components are not bundled in and deployed with the application.

For more information, see:

20.1.3 Application Libraries

The Oracle CEP application library gives you a convenient location to deploy shared libraries and gives you complete control over the order in which shared libraries are deployed at Oracle CEP server start up time.

An application library is an OSGi bundle that contains a Java archive (JAR) of compiled Java classes and any other required artifacts. For more information on OSGi, see Appendix A, "Additional Information about Spring and OSGi".

You can use application libraries for a variety of purposes such as drivers or foreign stages (partial or complete Oracle CEP applications that are useful to other downstream applications).

Although you can add a library to a project as a simple embedded JAR file, there are advantages to using an application library, including:

  • Simplifying application assembly and maintenance activities such as deploying an updated version of the library.

  • Encouraging re-use.

  • Reducing server disk space consumption.

You deploy application libraries to either of the following Oracle CEP server directories:

For more information, see:

20.1.3.1 Library Extensions Directory

The Oracle CEP server library extensions directory is the DOMAIN_DIR/servername/modules/ext directory, where DOMAIN_DIR refers to the domain directory such as /oracle_cep/user_projects/domains/mydomain and servername refers to the server instance, such as myserver. For example:

c:\oracle_cep\user_projects\domains\mydomain\myserver\modules\ext

The libraries in this directory are deployed first along with the Oracle CEP server core modules.

If your library is a driver (such as a JDBC driver), you must put it in the library extensions directory so that it is activated in the correct order. For example, to override an older version with a newer version or to provide access to an alternative driver.

20.1.3.2 Library Directory

The Oracle CEP server library directory is the DOMAIN_DIR/servername/modules directory, where DOMAIN_DIR refers to the domain directory such as /oracle_cep/user_projects/domains/mydomain and servername refers to the server instance, such as myserver. For example:

c:\oracle_cep\user_projects\domains\mydomain\myserver\modules

The libraries in this directory are deployed after the components in the library extensions directory but before any Oracle CEP applications.

If your library is a driver (such as a JDBC driver), you must put it in the library extensions directory as Section 20.1.3.1, "Library Extensions Directory" describes.

20.1.4 Deployment and Deployment Order

After you have assembled the application, you deploy it by making it known to the Oracle CEP domain using the deployment tool appropriate for your needs. For detailed instructions, see Section 20.4, "Deploying Oracle CEP Applications."

The Oracle CEP server deploys components in the following order at Oracle CEP server start up time:

  1. Deploy libraries in the library extensions directory (DOMAIN_DIR/servername/modules/ext directory).

  2. Deploy libraries in the library directory (DOMAIN_DIR/servername/modules directory).

  3. Deploy Oracle CEP applications.

The Oracle CEP server deploys libraries from both the library extensions directory and library directory based on the lexical order of the library names. Lexical ordering includes the relative directory name plus JAR file name.

For example:

  • modules/a.jar will start before modules/b.jar

  • modules/0/my.jar will start before module/my.jar since 0/my.jar comes before my.jar in lexical order

Using this convention, you can control the order in which Oracle CEP server deploys JAR files simply by organizing JAR files into appropriately named subdirectories of either the library extensions directory or library directory.

Once the application is deployed to Oracle CEP, the configured adapters immediately start listening for events for which they are configured, such as financial data feeds and so on.

For more information, see Section 20.3, "Managing an Application Library".

20.1.5 Configuration History Management

When you deploy an application to the Oracle CEP server, the Oracle CEP server creates a configuration history for the application. Any configuration changes you make to rules or Oracle CEP high availability adapter configuration are recorded in this history are recorded in this history. You can view and roll-back (undo) these changes using the Oracle CEP Visualizer or wlevs.Admin tool.

For more information, see:

20.2 Assembling an Oracle CEP Application

Assembling an Oracle CEP application refers to bundling the artifacts that make up the application into an OSGi bundle JAR file as http://www2.osgi.org/javadoc/r4/org/osgi/framework/Bundle.html describes. These artifacts include:

  • compiled Java classes

  • Oracle CEP component configuration files that configure application components (such as the processors or adapters)

  • EPN assembly file

  • MANIFEST.MF file

See Appendix A, "Additional Information about Spring and OSGi," for links to reference and conceptual information about Spring and OSGi.

This section describes:

20.2.1 Assembling an Oracle CEP Application Using Oracle CEP IDE for Eclipse

You can use Oracle CEP IDE for Eclipse to easily assemble your Oracle CEP application.

For more information, see:

If your application depends on foreign stages, see Section 20.2.3, "Assembling Applications With Foreign Stages".

20.2.2 Assembling an Oracle CEP Application Manually

Optionally, you can assemble your Oracle CEP application manually.

For simplicity, the following procedure creates a temporary directory that contains the required artifacts, and then jars up the contents of this temporary directory. This is just a suggestion and you are not required, of course, to assemble the application using this method.

Note:

See the HelloWorld example source directory for a sample build.xml Ant file that performs many of the steps described below. The build.xml file is located in ORACLE_CEP_HOME\ocep_11.1\samples\source\applications\helloworld, where ORACLE_CEP_HOME refers to the main Oracle CEP installation directory, such as d:\oracle_cep.

To assemble an Oracle CEP application manually:

  1. Open a command window and set your environment as described in "Setting Your Development Environment" in the Oracle CEP Getting Started.

  2. Create an empty directory, such as output:

    prompt> mkdir output
    
  3. Compile all application Java files into the output directory.

  4. Create an output/META-INF/spring directory.

  5. Copy the EPN assembly file that describes the components of your application and how they are connected into the output/META-INF/spring directory.

    See Section 3.3, "Creating EPN Assembly Files" for details about this file.

  6. Create an output/META-INF/wlevs directory.

  7. Copy the XML files that configure the components of your application (such as the processors or adapters) into the output/META-INF/wlevs directory.

    You create these XML files during the course of creating your application, as described in Section 1.1, "Overview of the Oracle CEP Programming Model."

  8. Create a MANIFEST.MF file that contains descriptive information about the bundle.

    See Section 20.2.2.1, "Creating the MANIFEST.MF File."

  9. If you need to access third-party JAR files from your Oracle CEP application, see Section 20.2.2.2, "Accessing Third-Party JAR Files."

  10. Create a JAR file that contains the contents of the output directory.

    Be sure you specify the MANIFEST.MF file you created in the previous step rather than the default manifest file.

    You can name the JAR file anything you want. In the Oracle CEP examples, the name of the JAR file is a combination of Java package name and version, such as:

    com.bea.wlevs.example.helloworld_1.0.0.0.jar
    

    Consider using a similar naming convention to clarify which bundles are deployed to the server.

    See the Apache Ant documentation at http://ant.apache.org/manual/CoreTasks/jar.html for information on using the jar task or the Java SE documentation at http://java.sun.com/javase/6/docs/technotes/tools/windows/jar.html for information on using the jar command-line tool.

  11. If your application depends on foreign stages, see Section 20.2.3, "Assembling Applications With Foreign Stages".

20.2.2.1 Creating the MANIFEST.MF File

The structure and contents of the MANIFEST.MF file is specified by the OSGi Framework. Although the value of many of the headers in the file is specific to your application or business, many of the headers are required by Oracle CEP.

In particular, the MANIFEST.MF file defines the following:

  • Application name—Specified with the Bundle-Name header.

  • Symbolic application name—Specified with the Bundle-SymbolicName header.

    Many of the Oracle CEP tools, such as the wlevs.Admin utility and JMX subsystem, use the symbolic name of the bundle when referring to the application.

  • Application version—Specified with the Bundle-Version header.

  • Imported packages—Specified with the Import-Package header.

    Oracle CEP requires that you import the following packages at a minimum:

    Import-Package:  
     com.bea.wlevs.adapter.defaultprovider;version="11.1.1.1_0",
     com.bea.wlevs.ede;version="11.1.1.1_0",
     com.bea.wlevs.ede.api;version="11.1.1.1_0",
     com.bea.wlevs.ede.impl;version="11.1.1.1_0",
     org.osgi.framework;version="1.3.0",
     org.springframework.beans.factory;version="2.5.6",
     org.apache.commons.logging;version="1.1.0",
     com.bea.wlevs.spring;version="11.1.1.1_0",
     com.bea.wlevs.util;version="11.1.1.1_0",
     org.springframework.beans;version="2.5.6",
     org.springframework.util;version="2.0",
     org.springframework.core.annotation;version="2.5.6",
     org.springframework.beans.factory;version="2.5.6",
     org.springframework.beans.factory.config;version="2.5.6",
     org.springframework.osgi.context;version="1.2.0",
     org.springframework.osgi.service;version="1.2.0"
    

    If you have extended the configuration of an adapter, then you must also import the following packages:

     javax.xml.bind;version="2.0",
     javax.xml.bind.annotation;version=2.0,
     javax.xml.bind.annotation.adapters;version=2.0,
     javax.xml.bind.attachment;version=2.0,
     javax.xml.bind.helpers;version=2.0,
     javax.xml.bind.util;version=2.0,
     com.bea.wlevs.configuration;version="11.1.1.1_0",
     com.bea.wlevs.configuration.application;version="11.1.1.1_0",
     com.sun.xml.bind.v2;version="2.0.2"
    
  • Exported packages—Specified with the Export-Package header. You should specify this header only if you need to share one or more application classes with other deployed applications. A typical example is sharing an event type JavaBean.

    If possible, you should export packages that include only the interfaces, and not the implementation classes themselves. If other applications are using the exported classes, you will be unable to fully undeploy the application that is exporting the classes.

    Exported packages are server-wide, so be sure their names are unique across the server.

The following complete MANIFEST.MF file is from the HelloWorld example, which extends the configuration of its adapter:

Manifest-Version: 1.0
Archiver-Version:
Build-Jdk: 1.6.0_06
Extension-Name: example.helloworld
Specification-Title: 1.0.0.0
Specification-Vendor: Oracle.
Implementation-Vendor: Oracle.
Implementation-Title: example.helloworld
Implementation-Version: 1.0.0.0
Bundle-Version: 11.1.1.1_0
Bundle-ManifestVersion: 1
Bundle-Vendor: Oracle.
Bundle-Copyright: Copyright (c) 2006 by Oracle.
Import-Package: com.bea.wlevs.adapter.defaultprovider;version="11.1.1.1_0",
 com.bea.wlevs.ede;version="11.1.1.1_0",
 com.bea.wlevs.ede.impl;version="11.1.1.1_0",
 com.bea.wlevs.ede.api;version="11.1.1.1_0",
 org.osgi.framework;version="1.3.0",
 org.apache.commons.logging;version="1.1.0",
 com.bea.wlevs.spring;version="11.1.1.1_0",
 com.bea.wlevs.util;version="11.1.1.1_0",
 net.sf.cglib.proxy,
 net.sf.cglib.core,
 net.sf.cglib.reflect,
 org.aopalliance.aop,
 org.springframework.aop.framework;version="2.5.6",
 org.springframework.aop;version="2.5.6",
 org.springframework.beans;version="2.5.6",
 org.springframework.util;version="2.0",
 org.springframework.core.annotation;version="2.5.6",
 org.springframework.beans.factory;version="2.5.6",
 org.springframework.beans.factory.config;version="2.5.6",
 org.springframework.osgi.context;version="1.2.0",
 org.springframework.osgi.service;version="1.2.0",
 javax.xml.bind;version="2.0",
 javax.xml.bind.annotation;version=2.0,
 javax.xml.bind.annotation.adapters;version=2.0,
 javax.xml.bind.attachment;version=2.0,
 javax.xml.bind.helpers;version=2.0,
 javax.xml.bind.util;version=2.0,
 com.bea.wlevs.configuration;version="11.1.1.1_0",
 com.bea.wlevs.configuration.application;version="11.1.1.1_0",
 com.sun.xml.bind.v2;version="2.0.2"
Bundle-Name: example.helloworld
Bundle-Description: WLEvS example helloworld
Bundle-SymbolicName: helloworld

20.2.2.2 Accessing Third-Party JAR Files

When creating your Oracle CEP applications, you might need to access legacy libraries within existing third-party JAR files. You can ensure access to this legacy code using any of the following approaches:

20.2.2.2.1 Accessing Third-Party JAR Files Using Bundle-Classpath

The recommended approach is to package the third-party JAR files in your Oracle CEP application JAR file. You can put the JAR files anywhere you want.

Note:

This approach gives you little control over the order in which JAR files are loaded and it is possible that dependency conflicts may occur. For this reason, Oracle recommends that you use the Oracle CEP server application library approach instead. For more information, see Section 20.1.3, "Application Libraries".

However, to ensure that your Oracle CEP application finds the classes in the third-party JAR file, you must update the application classpath by adding the Bundle-Classpath header to the MANIFEST.MF file. Set Bundle-Classpath to a comma-separate list of the JAR file path names that should be searched for classes and resources. Use a period (.) to specify the bundle itself. For example:

Bundle-Classpath: ., commons-logging.jar, myExcitingJar.jar, myOtherExcitingJar.jar

If you need to access native libraries, you must also package them in your JAR file and use the Bundle-NativeCode header of the MANIFEST.MF file to specify their location in the JAR.

For more information, see Section 3.7.1, "How to Add a Standard JAR File to an Oracle CEP Project".

20.2.2.2.2 Accessing Third-Party JAR Files Using -Xbootclasspath

If the JAR files include libraries used by all applications deployed to Oracle CEP, such as JDBC drivers, you can add the JAR file to the server's boot classpath by specifying the -Xbootclasspath/a option to the java command in the scripts used to start up an instance of the server.

Note:

This approach gives you little control over the order in which JAR files are loaded and it is possible that dependency conflicts may occur. For this reason, Oracle recommends that you use the Oracle CEP server application library approach instead. For more information, see Section 20.1.3, "Application Libraries".

The name of the server start script is startwlevs.cmd (Windows) or startwlevs.sh (UNIX), and the script is located in the server directory of your domain directory. The out-of-the-box sample domains are located in ORACLE_CEP_HOME/ocep_11.1/samples/domains, and the user domains are located in ORACLE_CEP_HOME/user_projects/domains, where ORACLE_CEP_HOME refers to the main Oracle CEP installation directory, such as d:\oracle_cep.

Update the start script by adding the -Xbootclasspath/a option to the java command that executes the wlevs_2.0.jar file. Set the -Xbootclasspath/a option to the full pathname of the third-party JAR files you want to access system-wide.

For example, if you want all deployed applications to be able to access a JAR file called e:\jars\myExcitingJAR.jar, update the java command in the start script as follows (updated section shown in bold):

  %JAVA_HOME%\bin\java -Dwlevs.home=%USER_INSTALL_DIR% -Dbea.home=%BEA_HOME%  -Xbootclasspath/a:e:\jars\myExcitingJAR.jar -jar "%USER_INSTALL_DIR%\bin\wlevs_2.0.jar" -disablesecurity %1 %2 %3 %4 %5 %6 

20.2.3 Assembling Applications With Foreign Stages

When assembling applications that depend on foreign stages, be aware of classpath dependencies. Consider the application dependency graph that Figure 20-1 shows.

Figure 20-1 Foreign Stage Dependency Graph

Description of Figure 20-1 follows
Description of "Figure 20-1 Foreign Stage Dependency Graph"

In this example, Application A depends on Application B, Application B depends on Application C, and Application C depends on Application A. Application C declares and exports an event type class for Java Bean event type MarketEvent. Applications A and B import the MarketEvent class that Application C provides.

Note the following:

  • When you redeploy a foreign stage, you must redeploy all foregin stages that depend on that application or foreign stage.

    For example, if you redeploy Application B, you must also redeploy Application A.

  • If there is a classpath dependency between one foreign stage and another, when you deploy the foreign stage that declares and exports the shared class, you must redeploy all foregin stages that import the shared class.

    For example, if you redeploy Application C, you must also redeploy Application A and B because Application A and B have a classpath dependency on Application C (MarketEvent).

For more information, see:

20.3 Managing an Application Library

The Oracle CEP application library gives you a convenient location to deploy shared libraries and gives you complete control over the order in which shared libraries are deployed at Oracle CEP server start up time.

This section describes how to manage an Oracle CEP server application library, including:

For more information, see Section 20.1.3, "Application Libraries".

20.3.1 How to Define an Application Library Directory Using Oracle CEP IDE for Eclipse

Before you can use the Oracle CEP server application library, you must update your Oracle CEP IDE for Eclipse design time configuration with the location of the application library directory.

For more information, see Section 20.3, "Managing an Application Library".

To define an application library directory using Oracle CEP IDE for Eclipse:

  1. Launch the Oracle CEP IDE for Eclipse.

  2. Rigth-click the project and select Properties.

    The Preferences dialog appears as shown in Figure 20-2.

    Figure 20-2 Preferences Dialog: Application Library Path

    Description of Figure 20-2 follows
    Description of "Figure 20-2 Preferences Dialog: Application Library Path"

  3. Select Oracle CEP Application Library Path.

  4. Specify the application library path as Table 20-1 describes.

    Table 20-1 Oracle CEP Application LIbrary Path

    Option Description

    Use an absolute path

    Select this option to specify an absolute file path to the application library directory.

    See Section 20.3.1.1, "How to Configure an Absolute Path".

    Extend a path variable

    Select this option to specify an application library path based on a path variable.

    See Section 20.3.1.2, "How to Extend a Path Variable".


20.3.1.1 How to Configure an Absolute Path

You can specify the application library path as an absolute file path. It may be more convenient in a team environment to specify the application library path based on a path variable as Section 20.3.1.2, "How to Extend a Path Variable" describes.

To configure an absolute path:

  1. Click the Browse button to open a file system browser.

  2. Use the file system browser to choose a directory.

    Note:

    The directory must reside within an Oracle CEP server domain. For more information, see Section 4.2, "Creating Oracle CEP Servers".
  3. Click OK.

  4. Click Apply.

  5. Click OK.

20.3.1.2 How to Extend a Path Variable

You can specify the application library path by extending a path variable. This is the most flexible approach and is appropriate for team environments. Alternatively, you can specify the application library with an absolute path as Section 20.3.1.1, "How to Configure an Absolute Path" describes.

To extend a path variable:

  1. Click the Variable button.

    The Select Path Variable dialog appears as Figure 20-3 shows.

    Figure 20-3 Select Path Variable Dialog

    Description of Figure 20-3 follows
    Description of "Figure 20-3 Select Path Variable Dialog"

  2. Click New.

    The New Variable dialog appears as Figure 20-4 shows.

    Figure 20-4 New Variable Dialog

    Description of Figure 20-4 follows
    Description of "Figure 20-4 New Variable Dialog"

  3. Configure the New Variable dialog as Table 20-2 describes.

    Table 20-2 Oracle CEP Application LIbrary Path Variable

    Option Description

    Name

    Enter a name for the variable.

    Location

    Click the Folder button to open a file system browser and choose the root directory to use as the application library directory.

    NOTE: The directory must reside within an Oracle CEP server domain. For more information, see Section 4.2, "Creating Oracle CEP Servers"


  4. Click OK.

    The new variable appears in the Select Path Variable dialog as Figure 20-5 shows.

    Figure 20-5 Select Path Variable: With Variable

    Description of Figure 20-5 follows
    Description of "Figure 20-5 Select Path Variable: With Variable"

  5. Optionally, select the variable and click Extend.

    The Variable Extension dialog appears as Figure 20-6 shows. This dialog shows any directories below the root directory you specified for this variable.

    Figure 20-6 Variable Extension Dialog

    Description of Figure 20-6 follows
    Description of "Figure 20-6 Variable Extension Dialog"

  6. Select a sub-directory and click OK.

    The application library path is specified relative to the path variable you defined as Figure 20-7 shows.

    Figure 20-7 Preferences Dialog: Application Library Path With Path Variable

    Description of Figure 20-7 follows
    Description of "Figure 20-7 Preferences Dialog: Application Library Path With Path Variable"

  7. Click Apply.

  8. Click OK.

20.3.2 How to Update an Application Library Using Oracle CEP IDE for Eclipse

When you add, replace, or remove a JAR file in the application library extension or application library directory or their user-defined subdirectories, you must make this change in two places:

  • On the local Oracle CEP server you used to create a server runtime in the Oracle CEP IDE for Eclipse.

  • On the production Oracle CEP server to which you deploy dependent applications.

These changes need not be performed simultaneously: you must make the change to the local Oracle CEP server before making code changes to projects that depend on the application library change; you must make the change to the production Oracle CEP server before you deploy applications that depend on the application library change.

For more information, see Section 20.3, "Managing an Application Library".

To update an application library using Oracle CEP IDE for Eclipse:

  1. Add a new or revised bundle to the application library extension or application library directory on the production Oracle CEP server.

    This is the server to which you will deploy applications that depend on this application library.

    To control library deployment order, organize your libraries in appropriately named subdirectories. For more information, see Section 20.1.4, "Deployment and Deployment Order".

  2. Stop and start the production Oracle CEP server.

    The Oracle CEP server refreshes itself from the updated application library extension or application library directory.

    For more information, see:

  3. Add the same new or revised bundle to the application library extension or application library directory on your Oracle CEP IDE for Eclipse targeted runtime Oracle CEP server.

  4. Start the Oracle CEP IDE for Eclipse.

  5. Right click a project and select Refresh Targeted Runtimes.

    The Oracle CEP IDE for Eclipse refreshes this project from the updated application library extension or application library directory on your Oracle CEP IDE for Eclipse targeted runtime Oracle CEP server.

  6. If necessary, update your application's dependencies.

    For example, if you added a new bundle or changed the version of an existing bundle.

    For more information, see Section 20.1.2, "Application Dependencies".

  7. Assemble and deploy your application to the production Oracle CEP server.

    For more information, see Section 20.4, "Deploying Oracle CEP Applications".

    The dependencies you defined for this application in the Oracle CEP IDE for Eclipse at development time will be satisfied by the components you installed in the application library of your production Oracle CEP server at run time.

20.3.3 How to View an Application Library Using the Oracle CEP Visualizer

You can view the application libraries deployed to the Oracle CEP server using the Oracle CEP Visualizer.

You can view libraries from both the library extensions directory and libraries directory.

For more information, see:

20.4 Deploying Oracle CEP Applications

After you assemble your Oracle CEP application, you deploy it to an Oracle CEP server domain.

This section describes:

For more information, see:

20.4.1 How to Deploy an Oracle CEP Application Using Oracle CEP IDE for Eclipse

You can deploy an Oracle CEP application using Oracle CEP IDE for Eclipse.

Using the Oracle CEP IDE for Eclipse, you can deploy an application to either a stand-alone or multi-server domain.

Note:

If you are using foreign stages, beware of the rules governing deployment and redeployment of dependent stages as Section 20.2.3, "Assembling Applications With Foreign Stages" describes.

To deploy an Oracle CEP application using Oracle CEP IDE for Eclipse:

  1. Assemble your Oracle CEP application.

    See Section 20.2, "Assembling an Oracle CEP Application."

  2. Use the Oracle CEP IDE for Eclipse to deploy your application.

    See Section 4.3.6, "How to Deploy an Application to an Oracle CEP Server".

20.4.2 How to Deploy an Oracle CEP Application Using Oracle CEP Visualizer

The simplest way to deploy an Oracle CEP application to an Oracle CEP server domain is to use the Oracle CEP Visualizer.

Using the Oracle CEP Visualizer, you can deploy an application to either a stand-alone or multi-server domain.

Note:

If you are using foreign stages, beware of the rules governing deployment and redeployment of dependent stages as Section 20.2.3, "Assembling Applications With Foreign Stages" describes.

To deploy an Oracle CEP application using Oracle CEP Visualizer:

  1. Assemble your Oracle CEP application.

    See Section 20.2, "Assembling an Oracle CEP Application."

  2. Start the Oracle CEP Visualizer.

    See Section 4.3.9, "How to Start the Oracle CEP Visualizer from Oracle CEP IDE for Eclipse".

  3. Use the Oracle CEP Visualizer to deploy your application.

    See "Deploying an Application" in the Oracle CEP Visualizer User's Guide.

20.4.3 How to Deploy an Oracle CEP Application Using the Deployer Utility

The following procedure describes how to deploy an application to Oracle CEP using the Deployer command-line utility.

Using the Deployer, you can deploy an application to either a stand-alone or multi-server domain.

For more information, see "Deployer Command-Line Reference" in the Oracle CEP Administrator's Guide.

Note:

If you are using foreign stages, beware of the rules governing deployment and redeployment of dependent stages as Section 20.2.3, "Assembling Applications With Foreign Stages" describes.

To deploy an Oracle CEP application using the Deployer utility:

  1. Assemble your Oracle CEP application.

    See Section 20.2, "Assembling an Oracle CEP Application."

  2. Open a command window and set your environment as described in "Setting Your Development Environment" in the Oracle CEP Getting Started.

  3. Update your CLASSPATH variable to include the wlevsdeploy.jar JAR file, located in the ORACLE_CEP_HOME/ocep_11.1/bin directory where, ORACLE_CEP_HOME refers to the main Oracle CEP installation directory, such as /oracle_cep.

    Note:

    If you are running the Deployer on a remote computer, see "Running the Deployer Utility Remotely" in the Oracle CEP Administrator's Guide.
  4. Be sure you have configured Jetty for the Oracle CEP instance to which you are deploying your application.

    For more information, see "Configuring Jetty for Oracle CEP" in the Oracle CEP Administrator's Guide.

  5. In the command window, run the Deployer utility using the following syntax to install your application:

    prompt> java -jar wlevsdeploy.jar -url http://host:port/wlevsdeployer -user user -password password -install application_jar_file
    

    where

    • host refers to the hostname of the computer on which Oracle CEP is running.

    • port refers to the port number to which Oracle CEP listens; default value is 9002.

      This port is specified in the DOMAIN_DIR/config/config.xml file that describes your Oracle CEP domain, where DOMAIN_DIR refers to your domain directory.

      The port number is the value of the <Port> child element of the <Netio> element:

      <Netio>
          <Name>NetIO</Name>
          <Port>9002</Port>
      </Netio>
      
    • user refers to the username of the Oracle CEP administrator.

    • password refers to the password of the Oracle CEP administrator.

    • application_jar_file refers to your application JAR file, assembled into an OSGi bundle as described in Section 20.2, "Assembling an Oracle CEP Application." This file must be located on the same computer from which you execute the Deployer utility.

      For example, if Oracle CEP is running on host ariel, listening on port 9002, username and password of the administrator is wlevs/wlevs, and your application JAR file is called myapp_1.0.0.0.jar and is located in the /applications directory, then the command is:

      prompt> java -jar wlevsdeploy.jar -url http://ariel:9002/wlevsdeployer -user wlevs -password wlevs -install /applications/myapp_1.0.0.0.jar
      

    After the application JAR file has been successfully installed and all initialization tasks completed, Oracle CEP automatically starts the application and the adapter components immediately start listening for incoming events.

    The Deployer utility provides additional options to resume, suspend, update, and uninstall an application JAR file, as well as deploy an application to a specified group of a multi-server domain. For more information, see "Deployer Command-Line Reference" in the Oracle CEP Administrator's Guide.

    Oracle CEP uses the deployments.xml file to internally maintain its list of deployed application OSGi bundles. This file is located in the DOMAIN_DIR/servername directory, where DOMAIN_DIR refers to the main domain directory corresponding to the server instance to which you are deploying your application and servername refers to the actual server. See Appendix B, "Deployment Schema deployment.xsd" for information about this file. This information is provided for your information only; Oracle does not recommend updating the deployments.xml file manually.