Skip Headers
Oracle® Fusion Middleware Developer's Guide for Oracle Complex Event Processing
11g Release 1 (11.1.1.6.3) for Eclipse

Part Number E14301-10
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

5 Oracle CEP IDE for Eclipse and Oracle CEP Servers

This chapter describes how to use the Oracle Complex Event Processing (Oracle CEP) IDE for Eclipse to create and manage Oracle CEP servers to develop and debug event-driven applications.

This chapter describes:

5.1 Oracle CEP Server Overview

The Oracle CEP IDE for Eclipse provides features that allow you to set up and manage Oracle CEP servers that are used during development. These tools help you to:

Table 5-1 maps Eclipse terminology used by the Oracle CEP IDE for Eclipse to Oracle CEP server terminology.

Table 5-1 Eclipse and Oracle CEP Server Concepts

Eclipse IDE Concept Oracle CEP Server Concept Description

Runtime

Oracle CEP server installation

The Oracle CEP IDE for Eclipse has the concept of a runtime. The runtime defines the location where the Oracle CEP IDE for Eclipse can find the installation of a particular Oracle CEP server. This information is used to find JAR files and OSGi bundles to add to the project classpath and to further define Servers and Server Instances.

Note that a Runtime is not itself a runnable artifact.

Server and Server Instance

Domain

The Oracle CEP IDE for Eclipse uses the term Server to describe an actual runnable Oracle CEP server instance. You can think of it as something that has start scripts, for example. In Oracle CEP server terminology, this equates to a Domain. When you set up a server, you specify the domain that this instance will run.

For more information on domains, see:

Publish

Deploy

The Oracle CEP IDE for Eclipse typically uses the term Publish to describe physically deploying an application to a server.

Project

Application or Deployment

A project in the Oracle CEP IDE for Eclipse becomes a single Oracle CEP application packaged as an OSGi bundle. It is deployed to a server and shows in the Oracle CEP server's deployments.xml file.


Server definitions are the central concept in controlling an Oracle CEP server from the Oracle CEP IDE for Eclipse. It is from the server definition that you start and stop the server. After associating a project with the server, you can publish (deploy) the application to and unpublish (undeploy) the application from the server, all without having to leave the Oracle CEP IDE for Eclipse. For more information, see Section 5.2, "Creating Oracle CEP Servers".

You can communicate with a running Oracle CEP server using Oracle CEP IDE for Eclipse in the following ways:

5.2 Creating Oracle CEP Servers

Creating a server allows you to start and stop the server instance from within the Oracle CEP IDE for Eclipse, as well as automatically deploy your applications to that server.

You can create a local or remote Oracle CEP server:

This section describes:

5.2.1 How to Create a Local Oracle CEP Server and Server Runtime

This section describes how to create both a local server and server runtime. After creating the initial server and server runtime, you can create additional server runtimes.

A local Oracle CEP server is one in which both the server and server runtime are on the same host. Alternatively, you can create a remote server and server runtime.

Note:

If the server you're creating in Eclipse is one you created from a domain with the Configuration Wizard, be sure to run the server from the command line before adding the server to your Eclipse project. Doing so will ensure that all server artifacts are created. Also, when specifying domain configuration information in the Eclipse New Server wizard, be sure to click the Advanced tab to specify the user name and password used when creating the domain.

For more information on running a server from the command line, see "Starting and Stopping an Oracle CEP Server in a Standalone-Server Domain" in Oracle Fusion Middleware Administrator's Guide for Oracle Complex Event Processing.

For more information, see:

To create a local Oracle CEP server and server runtime:

  1. Select Window > Show View > Servers.

    The Servers view appears as shown in Figure 5-1.

    Figure 5-1 Oracle CEP IDE for Eclipse Server View

    Description of Figure 5-1 follows
    Description of "Figure 5-1 Oracle CEP IDE for Eclipse Server View"

  2. Right-click in the Servers view pane and select New > Server.

  3. Consider whether or not server runtimes have been created:

    1. If this is the first time you have created an Oracle CEP server, there will be no installed server runtimes. Proceed to step 4.

    2. If this is not the first time you have created an Oracle CEP server, there will be one or more installed server runtimes. Proceed to step 5.

  4. If this is the first time you have created an Oracle CEP server, there will be no installed server runtimes:

    In this case, the New Server: Define New Server dialog appears as Figure 5-2 shows.

    Figure 5-2 New Server: Define New Server Dialog (No Installed Runtimes)

    Description of Figure 5-2 follows
    Description of "Figure 5-2 New Server: Define New Server Dialog (No Installed Runtimes)"

    Configure the new server as follows:

    1. Configure the dialog as shown in Table 5-2.

      Table 5-2 New Server: Define New Server Dialog (No Installed Runtimes) Attributes

      Attribute Description

      Server's host name

      The host name of the computer on which you installed Oracle CEP server.

      For development, this will typically be localhost.

      Select the server type

      The type of Oracle CEP server.

      In this example, choose Oracle CEP v11

      Server name

      The name of this Oracle CEP server.

      Default: Oracle CEP v11.1 at HOSTNAME

      Where HOSTNAME is the value you entered in the Server's host name field.


    2. Click Next.

      The New Server: New Oracle CEP v11 Runtime dialog appears as shown in Figure Figure 5-3.

      Figure 5-3 New Server: New Oracle CEP v11.1 Runtime Dialog

      Description of Figure 5-3 follows
      Description of "Figure 5-3 New Server: New Oracle CEP v11.1 Runtime Dialog"

    3. Configure the dialog as shown in Table 5-3.

      Table 5-3 New Server: New Oracle CEP v11 Runtime Dialog Attributes

      Attribute Description

      Oracle Middleware Home Directory

      The fully qualified path to the Oracle CEP server installation directory. This is the same as the "Middleware Home" that was selected when installing the server.

      When selecting this directory, select the directory that contains the Oracle CEP installation rather than the Oracle CEP directory itself. For example, choose:

      C:\OracleCEP
      

      But do not choose:

      C:\OracleCEP\ocep_11.1
      

      The runtime wizard will use the installation to find the appropriate Oracle CEP installation directory.

      For more information, see "Oracle Fusion Middleware Directory Structure and Concepts" in the Oracle Fusion Middleware Getting Started Guide for Oracle Complex Event Processing.

      JRE

      The type of JRE to use.

      Select the type of JRE to use from the pull-down menu or click the Installed JRE preferences link to create a new JRE.

      Be sure to choose a Java 6 JRE.

      NOTE: The Oracle CEP server JRE is ultimately set by the JAVA_HOME setting in setDomainEnv.cmd or setDomainEnv.sh script in the server domain directory.


    4. Proceed to step 6.

  5. If this is not the first time you have created an Oracle CEP server, there will be one or more installed server runtimes.

    In this case, the New Server: Define New Server dialog appears as Figure 5-4 shows.

    Figure 5-4 New Server: Define New Server (Installed Runtimes) Dialog

    Description of Figure 5-4 follows
    Description of "Figure 5-4 New Server: Define New Server (Installed Runtimes) Dialog"

    Configure the dialog as shown in Table 5-4.

    Table 5-4 New Server: Define New Server (Installed Runtimes) Dialog Attributes

    Attribute Description

    Server's host name

    The host name of the computer on which you installed Oracle CEP server.

    For development, this will typically be localhost.

    Select the server type

    The type of Oracle CEP server.

    In this example, choose Oracle CEP v11.

    Server runtime

    Select the server runtime from the pull-down menu.

    To create or edit server runtimes, click Installed Runtimes. For more information, see Section 5.2.3, "How to Create an Oracle CEP Server Runtime".


  6. Click Next.

    The New Server: New Oracle CEP v11.1 Server dialog appears as Figure 5-5 shows.

    Figure 5-5 New Server: New Oracle CEP v11.1 Server

    Description of Figure 5-5 follows
    Description of "Figure 5-5 New Server: New Oracle CEP v11.1 Server"

  7. Select Local Server.

  8. Click Next.

    The New Server: New Oracle CEP v11 Server dialog appears as Figure 5-6 shows.

    Figure 5-6 New Server: New Oracle CEP v11 Server Dialog for a Local Server

    Description of Figure 5-6 follows
    Description of "Figure 5-6 New Server: New Oracle CEP v11 Server Dialog for a Local Server"

  9. Click Advanced and configure the dialog as shown in Table 5-5.

    Table 5-5 New Server: New Oracle CEP v11 Server Dialog Attributes for a Local Server

    Attribute Description

    Domain Directory

    The fully qualified path to the directory that contains the domain for this server.

    Click Browse to choose the directory.

    Default: ORACLE-CEP-HOME\user_projects\domains\ocep_domain\defaultserver.

    Start Script

    The script that Oracle CEP IDE for Eclipse uses to start the Oracle CEP server.

    Default on UNIX: ORACLE-CEP-HOME/user_projects/domains/ocep_domain/defaultserver/startwlevs.sh

    Default on Windows: ORACLE-CEP-HOME\user_projects\domains\ocep_domain\defaultserver\startwlevs.cmd

    Stop Script

    The script that Oracle CEP IDE for Eclipse uses to stop the Oracle CEP server.

    Default on UNIX: ORACLE-CEP-HOME/user_projects/domains/ocep_domain/defaultserver/stopwlevs.sh

    Default on Windows: ORACLE-CEP-HOME\user_projects\domains\ocep_domain\defaultserver\stopwlevs.cmd

    Debug Port

    The Oracle CEP server port that Oracle CEP IDE for Eclipse connects to when debugging the Oracle CEP server.

    Default: 8453.

    Server Name

    The name of the Oracle CEP server.

    Default: Oracle CEP v11

    User Name

    The user name Oracle CEP IDE for Eclipse uses when logging into the Oracle CEP server.

    Default: wlevs.

    User Password

    The user password Oracle CEP IDE for Eclipse uses when logging into the Oracle CEP server.

    Default: wlevs.

    Automatic Publishing

    By default, when you change an application, you must manually publish the changes to the Oracle CEP server.

    Select Use Workspace Default to configure Oracle CEP IDE for Eclipse to automatically publish changes to the Oracle CEP server.

    Default: Disabled.


  10. Click Finish.

  11. If you configured Automatic Publishing to Use Workspace Default, select Windows > Preferences.

    The Preferences dialog appears as Figure 5-7 shows.

    Figure 5-7 Preferences - Server

    Description of Figure 5-7 follows
    Description of "Figure 5-7 Preferences - Server"

  12. Select the Server option.

  13. Configure your automatic publishing options:

    • Automatically publish to local servers: enable or disable this option, as required.

      Default: enabled.

      • Publishing interval: configure the frequency at which the Oracle CEP IDE for Eclipse publishes changes to the server (in seconds).

        Default: 60 seconds.

    • Automatically publish to remote servers: enable or disable this option, as required.

      Default: enabled.

      • Publishing interval: configure the frequency at which the Oracle CEP IDE for Eclipse publishes changes to the server (in seconds).

        Default: 60 seconds.

  14. Click OK.

5.2.2 How to Create a Remote Oracle CEP Server and Server Runtime

This section describes how to create both a remote server and server runtime. After creating the initial server and server runtime, you can create additional server runtimes.

A remote Oracle CEP server is one in which the server and server runtime are on different hosts. The server is on a remote host and the server runtime is on the local host (the host on which you are executing the Oracle CEP IDE for Eclipse).

Alternatively, you can create a local server and server runtime.

For more information, see:

To create a remote Oracle CEP server and server runtime:

  1. Select Window > Show View > Servers.

    The Servers view appears as shown in Figure 5-1.

    Figure 5-8 Oracle CEP IDE for Eclipse Server View

    Description of Figure 5-8 follows
    Description of "Figure 5-8 Oracle CEP IDE for Eclipse Server View"

  2. Right-click in the Servers view pane and select New > Server.

  3. Consider whether or not server runtimes have been created:

    1. If this is the first time you have created an Oracle CEP server, there will be no installed server runtimes. Proceed to step 4.

    2. If this is not the first time you have created an Oracle CEP server, there will be one or more installed server runtimes. Proceed to step 5.

  4. If this is the first time you have created an Oracle CEP server, there will be no installed server runtimes:

    In this case, the New Server: Define New Server dialog appears as Figure 5-2 shows.

    Figure 5-9 New Server: Define New Server Dialog (No Installed Runtimes)

    Description of Figure 5-9 follows
    Description of "Figure 5-9 New Server: Define New Server Dialog (No Installed Runtimes)"

    Configure the new server as follows:

    1. Configure the dialog as shown in Table 5-2.

      Table 5-6 New Server: Define New Server Dialog (No Installed Runtimes) Attributes

      Attribute Description

      Server's host name

      The host name of the computer on which you installed Oracle CEP server.

      For development, this will typically be localhost.

      Select the server type

      The type of Oracle CEP server.

      In this example, choose Oracle CEP v11

      Server name

      The name of this Oracle CEP server.

      Default: Oracle CEP v11.1 at HOSTNAME

      Where HOSTNAME is the value you entered in the Server's host name field.


    2. Click Next.

      The New Server: New Oracle CEP v11 Runtime dialog appears as shown in Figure Figure 5-3.

      Figure 5-10 New Server: New Oracle CEP v11.1 Runtime Dialog

      Description of Figure 5-10 follows
      Description of "Figure 5-10 New Server: New Oracle CEP v11.1 Runtime Dialog"

    3. Configure the dialog as shown in Table 5-3.

      Table 5-7 New Server: New Oracle CEP v11 Runtime Dialog Attributes

      Attribute Description

      Oracle Middleware Home Directory

      The fully qualified path to the Oracle CEP server installation directory. This is the same as the "Middleware Home" that was selected when installing the server.

      When selecting this directory, select the directory that contains the Oracle CEP installation rather than the Oracle CEP directory itself. For example, choose:

      C:\OracleCEP
      

      But do not choose:

      C:\OracleCEP\ocep_11.1
      

      The runtime wizard will use the installation to find the appropriate Oracle CEP installation directory.

      For more information, see "Oracle Fusion Middleware Directory Structure and Concepts" in the Oracle Fusion Middleware Getting Started Guide for Oracle Complex Event Processing.

      JRE

      The type of JRE to use.

      Select the type of JRE to use from the pull-down menu or click the Installed JRE preferences link to create a new JRE.

      Be sure to choose a Java 6 JRE.

      NOTE: The Oracle CEP server JRE is ultimately set by the JAVA_HOME setting in setDomainEnv.cmd or setDomainEnv.sh script in the server domain directory.


    4. Proceed to step 6.

  5. If this is not the first time you have created an Oracle CEP server, there will be one or more installed server runtimes.

    In this case, the New Server: Define New Server dialog appears as Figure 5-4 shows.

    Figure 5-11 New Server: Define New Server (Installed Runtimes) Dialog

    Description of Figure 5-11 follows
    Description of "Figure 5-11 New Server: Define New Server (Installed Runtimes) Dialog"

    Configure the new server as follows:

    Table 5-8 New Server: Define New Server (Installed Runtimes) Dialog Attributes

    Attribute Description

    Server's host name

    The host name of the computer on which you installed Oracle CEP server.

    For development, this will typically be localhost.

    Select the server type

    The type of Oracle CEP server.

    In this example, choose Oracle CEP v11.

    Server runtime

    Select the server runtime from the pull-down menu.

    To create or edit server runtimes, click Installed Runtimes. For more information, see Section 5.2.3, "How to Create an Oracle CEP Server Runtime".


  6. Click Next.

    The New Server: New Oracle CEP v11.1 Server dialog appears as Figure 5-5 shows.

    Figure 5-12 New Server: New Oracle CEP v11.1 Server

    Description of Figure 5-12 follows
    Description of "Figure 5-12 New Server: New Oracle CEP v11.1 Server"

  7. Select Remote Server.

  8. Click Next.

    The New Server: New Oracle CEP v11 Server dialog appears dialog appears as Figure 5-13 shows.

    Figure 5-13 New Server: New Oracle CEP v11 Server Dialog for a Remote Server

    Description of Figure 5-13 follows
    Description of "Figure 5-13 New Server: New Oracle CEP v11 Server Dialog for a Remote Server"

  9. Configure the dialog as shown in Table 5-9.

    Table 5-9 New Server: New Oracle CEP v11 Server Dialog Attributes for a Local Server

    Attribute Description

    Remote Server IP Address

    The IP address of the remote Oracle CEP server.

    Default: IP address of localhost.

    Remote Server Port

    The port you specified in the remote Oracle CEP server 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>
    

    Default: 9002

    User Name

    The user name that the Oracle CEP IDE for Eclipse uses to log into the remote server.

    Default: wlevs

    User Password

    The password that the Oracle CEP IDE for Eclipse uses to log into the remote server.

    Default: wlevs


  10. Click Finish.

5.2.3 How to Create an Oracle CEP Server Runtime

Before you can create a server, you must configure the Oracle CEP IDE for Eclipse with the location of your Oracle CEP server installation by creating a server runtime using the runtime wizard. You can access the runtime wizard from several places including the new server wizard, the new project wizard, and the workspace preferences dialog.

You only need to create a runtime explicitly if you have not yet created an Oracle CEP server.

For more information, see:

To create an Oracle CEP server runtime:

  1. Select Windows > Preferences.

    The Preferences dialog appears as Figure 5-14 shows.

    Figure 5-14 Preferences - Server - Installed Runtimes

    Description of Figure 5-14 follows
    Description of "Figure 5-14 Preferences - Server - Installed Runtimes"

  2. Expand the Server option and select Runtime Environments.

  3. Click Add.

    The New Server Runtime Environment dialog appears as shown in Figure 5-15.

    Figure 5-15 New Server Runtime Environment Dialog

    Description of Figure 5-15 follows
    Description of "Figure 5-15 New Server Runtime Environment Dialog"

  4. Configure the dialog as shown in Table 5-10.

    Table 5-10 New Server Runtime Dialog Attributes

    Attribute Description

    Select the type of runtime environment

    The type of Oracle CEP server.

    In this example, choose Oracle CEP v11.1.

    Create a new local server

    Optionally, check this to create a new local server if you have not yet created a server. For more information, see Section 5.2.1, "How to Create a Local Oracle CEP Server and Server Runtime".


  5. Click Next.

    The New Server Runtime Environment dialog appears as shown in Figure 5-16.

    Figure 5-16 New Server Runtime Environment: New Oracle CEP v11.1 Runtime Dialog

    Description of Figure 5-16 follows
    Description of "Figure 5-16 New Server Runtime Environment: New Oracle CEP v11.1 Runtime Dialog"

  6. Configure the dialog as shown in Table 5-11.

    Table 5-11 New Server Runtime Dialog Attributes

    Attribute Description

    Oracle Middleware Home Directory

    The fully qualified path to the Oracle CEP server installation directory. This is the same as the "Middleware Home" that was selected when installing the server.

    When selecting this directory, select the directory that contains the Oracle CEP installation rather than the Oracle CEP directory itself. For example, choose:

    C:\OracleCEP
    

    But do not choose:

    C:\OracleCEP\ocep_11.1
    

    The runtime wizard will use the installation to find the appropriate Oracle CEP installation directory.

    For more information, see "Oracle Fusion Middleware Directory Structure and Concepts" in the Oracle Fusion Middleware Getting Started Guide for Oracle Complex Event Processing.

    JRE

    The type of JRE to use.

    Select the type of JRE to use from the pull-down menu or click the Installed JRE preferences link to create a new JRE.

    Be sure to choose either JRockit Real Time or the JRockit JDK installed with your Oracle CEP installation.


  7. Click Finish.

5.3 Managing Oracle CEP Servers

Using the Oracle CEP IDE for Eclipse and the Oracle CEP Visualizer accessible from the Oracle CEP IDE for Eclipse, you can manage many aspects of your Oracle CEP server during development.

This section describes the following Oracle CEP server management tasks you can perform from the Oracle CEP IDE for Eclipse:

5.3.1 How to Start a Local Oracle CEP Server

After you create a local server, you can start the Oracle CEP server from the Oracle CEP IDE for Eclipse.

You can also start the local Oracle CEP server in debug mode.

Alternatively, you can start the local Oracle CEP server from the command line and attach to it using Oracle CEP IDE for Eclipse.

For more information, see:

To start a local Oracle CEP server:

  1. Select Window > Show Views > Servers.

    The Servers view opens as shown in Figure 5-17.

    Figure 5-17 Starting an Oracle CEP Server

    Description of Figure 5-17 follows
    Description of "Figure 5-17 Starting an Oracle CEP Server"

  2. Start the server by choosing one of the following:

    1. Click the Start the Server icon in the Servers view tool bar.

    2. Right-click a server in the Servers view and select Start.

    After starting the server you will see log messages from the server in the Console view.

5.3.2 How to Stop a Local Oracle CEP Server

After you start a local Oracle CEP server from the Oracle CEP IDE for Eclipse, you can stop the Oracle CEP server from the Oracle CEP IDE for Eclipse.

For more information, see Section 5.3.1, "How to Start a Local Oracle CEP Server".

To stop a local Oracle CEP server:

  1. Select Window > Show Views > Servers.

    The Servers view opens as shown in Figure 5-18.

    Figure 5-18 Stopping an Oracle CEP Server

    Description of Figure 5-18 follows
    Description of "Figure 5-18 Stopping an Oracle CEP Server"

  2. Stop the server by choosing one of the following:

    1. Click the Stop the Server icon in the Servers view tool bar.

    2. Right-click a server in the Servers view and select Stop.

5.3.3 How to Attach to an Existing Local Oracle CEP Server Instance

After you create a local server, you can start the local Oracle CEP server from the command line and attach Oracle CEP IDE for Eclipse to this existing, already running local Oracle CEP server instance.

Alternatively, you can start the local Oracle CEP server directly from within Oracle CEP IDE for Eclipse.

For more information, see:

To attach to an existing local Oracle CEP server instance:

  1. Start the Oracle CEP server from the command line.

    For more information, see "Starting and Stopping Oracle CEP Servers" in the Oracle Fusion Middleware Administrator's Guide for Oracle Complex Event Processing.

  2. Select Window > Show Views > Servers.

    The Servers view opens as shown in Figure 5-17.

    Figure 5-19 Attaching to an Existing Local Oracle CEP Server Instance

    Description of Figure 5-19 follows
    Description of "Figure 5-19 Attaching to an Existing Local Oracle CEP Server Instance"

  3. Attach to the already running local server by choosing one of the following:

    1. Click the Start the Server icon in the Servers view tool bar.

    2. Right-click a server in the Servers view and select Start.

    The Attach to Running CEP Server dialog appears as Figure 5-20 shows.

    Figure 5-20 Attach to Running CEP Server

    Description of Figure 5-20 follows
    Description of "Figure 5-20 Attach to Running CEP Server"

  4. Click Yes.

    After attaching to the server you will not see log messages from the server in the Console view.

    You can view the server console using the Oracle CEP Visualizer. For more information, see "How to View Console Output" in the Oracle Fusion Middleware Visualizer User's Guide for Oracle Complex Event Processing.

5.3.4 How to Attach to an Existing Remote Oracle CEP Server Instance

After you create a remote server, you can start the remote Oracle CEP server from the command line and attach Oracle CEP IDE for Eclipse to this existing, already running remote Oracle CEP server instance.

For more information, see Section 5.2.2, "How to Create a Remote Oracle CEP Server and Server Runtime".

To attach to an existing remote Oracle CEP server instance:

  1. Start the remote Oracle CEP server from the command line.

    For more information, see "Starting and Stopping Oracle CEP Servers" in the Oracle Fusion Middleware Administrator's Guide for Oracle Complex Event Processing.

  2. Select Window > Show Views > Servers.

    The Servers view opens as shown in Figure 5-17.

    Figure 5-21 Attaching to an Existing Remote Oracle CEP Server Instance

    Description of Figure 5-21 follows
    Description of "Figure 5-21 Attaching to an Existing Remote Oracle CEP Server Instance"

  3. Attach to the already running remote server by choosing one of the following:

    1. Click the Start the Server icon in the Servers view tool bar.

    2. Right-click a server in the Servers view and select Start.

    After attaching to the remote server, Oracle CEP IDE for Eclipse writes one status message to the Console view, reading:

    [3/23/10 12:32 PM] Attached to remote CEP server at address 10.11.12.13 and port 9002
    

    You will not see log messages from the remote server in the Console view.

    You can view the server console using the Oracle CEP Visualizer. For more information, see "How to View Console Output" in the Oracle Fusion Middleware Visualizer User's Guide for Oracle Complex Event Processing.

5.3.5 How to Detach From an Existing Oracle CEP Server Instance

After you attach to an existing, running Oracle CEP server instance, you can detach from the Oracle CEP server and leave it running.

For more information, see:

To detach from an existing Oracle CEP server instance:

  1. Select Window > Show Views > Servers.

    The Servers view opens as shown in Figure 5-18.

    Figure 5-22 Stopping an Oracle CEP Server

    Description of Figure 5-22 follows
    Description of "Figure 5-22 Stopping an Oracle CEP Server"

  2. Detach from the server by choosing one of the following:

    1. Click the Stop the Server icon in the Servers view tool bar.

    2. Right-click a server in the Servers view and select Stop.

    Oracle CEP IDE for Eclipse detaches from the Oracle CEP server instance. The Oracle CEP server instance continues to run.

    If you detach from a remote Oracle CEP server, Oracle CEP IDE for Eclipse writes a log message to the Console view reading:

    [3/23/10 12:47 PM] Server communication stopped
    

5.3.6 How to Deploy an Application to an Oracle CEP Server

A project in the Oracle CEP IDE for Eclipse is built as an Oracle CEP application, then deployed to the server. To deploy an application, a server must first be defined. To then deploy an application, simply add it to the server. The application will be deployed immediately if the server is already started, or when the server is next started if the server is stopped.

For more information, see:

To deploy an application to an Oracle CEP server:

  1. Create an Oracle CEP project (see Section 4.2, "Creating Oracle CEP Projects").

  2. Create a server (see Section 5.2.1, "How to Create a Local Oracle CEP Server and Server Runtime").

  3. Select Window > Show Views > Servers.

    The Servers view opens as shown in Figure 5-23.

    Figure 5-23 Adding a Project to an Oracle CEP Server

    Description of Figure 5-23 follows
    Description of "Figure 5-23 Adding a Project to an Oracle CEP Server"

  4. Right-click the server and select Add and Remove.

    The Add and Remove dialog appears as shown in Figure 5-24.

    Figure 5-24 Add and Remove Dialog

    Description of Figure 5-24 follows
    Description of "Figure 5-24 Add and Remove Dialog"

  5. Configure the dialog as Table 5-12 shows.

    Table 5-12 Add and Remove Dialog Attributes

    Attribute Description

    Available

    Select one or more projects from this list and click Add or Add All to move them into the Configured list.

    Configured

    Select one or more projects from this list and click Remove or Remove All to move them into the Available list.

    If server is started, publish changes immediately.

    Check this option to immediately publish projects that you modify. Applicable only if the server is already running.


  6. Click Finish.

    Once an application is added, it will show as a child of the server in the Servers view as shown in Figure 5-25.

    Figure 5-25 Server View After Adding a Project

    Description of Figure 5-25 follows
    Description of "Figure 5-25 Server View After Adding a Project"

  7. To deploy (publish) the application to the Oracle CEP server, right-click the added application and select Force Publish.

    1. If the Oracle CEP server is part of a standalone-server, domain the application is deployed.

    2. If the Oracle CEP server is part of a multi-server domain, the Select Cluster Deployment Group Name dialog appears as Figure 5-26 shows.

      Figure 5-26 Select Cluster Deployment Group Name Dialog

      Description of Figure 5-26 follows
      Description of "Figure 5-26 Select Cluster Deployment Group Name Dialog"

      Select the cluster deployment group you want to deploy the application to and click OK.

      For more information on clustering, see "Introduction to Multi-Server Domains" in the Oracle Fusion Middleware Administrator's Guide for Oracle Complex Event Processing.

    Once an application is deployed (published), it will show as a child of the server in the Servers view as shown in Figure 5-27.

    Figure 5-27 Server View After Deploying (Publishing) a Project

    Description of Figure 5-27 follows
    Description of "Figure 5-27 Server View After Deploying (Publishing) a Project"

5.3.7 How to Configure Connection and Control Settings for Oracle CEP Server

After you create a server, you can use the Server Overview editor to configure all the important server connection and control settings that Oracle CEP IDE for Eclipse uses to communicate with the Oracle CEP server.

For more information, see:

To configure connection and control settings for Oracle CEP server:

  1. Select Window > Show Views > Servers.

  2. Double-click a server in the Servers view.

    The Server Overview editor opens as shown in Figure 5-28.

    Figure 5-28 Server Overview Editor

    Description of Figure 5-28 follows
    Description of "Figure 5-28 Server Overview Editor"

  3. Configure the Server Overview editor as shown in Table 5-13.

    Table 5-13 Server Overview Editor Attributes

    Attribute Description

    Server Name

    The name of this server. Only used within the Oracle CEP IDE for Eclipse as a useful identifier.

    For more information, see Section 5.2.1, "How to Create a Local Oracle CEP Server and Server Runtime".

    Host Name

    The name of the host on which this server is installed.

    For more information, see Section 5.2.1, "How to Create a Local Oracle CEP Server and Server Runtime".

    Runtime Environment

    The current installed runtime selected for this server.

    Select a new runtime from the pull down menu or click the Edit link to modify the configuration of the selected runtime.

    For more information, see Section 5.2.1, "How to Create a Local Oracle CEP Server and Server Runtime".

    Domain DirectoryFoot 1 

    The fully qualified path to the directory that contains the domain for this server.

    Click Browse to choose the directory.

    Default: ORACLE-CEP-HOME\user_projects\domains\ocep_domain\defaultserver.

    Start ScriptFootref 1

    The script that Oracle CEP IDE for Eclipse uses to start the Oracle CEP server.

    Click Browse to choose the start script.

    Default on UNIX: ORACLE-CEP-HOME\user_projects\domains\ocep_domain\defaultserver\stopwlevs.sh

    Default on Windows: ORACLE-CEP-HOME\user_projects\domains\ocep_domain\defaultserver\stopwlevs.cmd

    Stop ScriptFootref 1

    The script that Oracle CEP IDE for Eclipse uses to stop the Oracle CEP server.

    Click Browse to choose the stop script.

    Default on UNIX: ORACLE-CEP-HOME\user_projects\domains\ocep_domain\defaultserver\startwlevs.sh

    Default on Windows: ORACLE-CEP-HOME\user_projects\domains\ocep_domain\defaultserver\startwlevs.cmd

    Debug PortFootref 1

    The Oracle CEP server port that Oracle CEP IDE for Eclipse connects to when debugging the Oracle CEP server.

    Default: 8453.

    Remote Server IP AddressFoot 2 

    The IP address of the remote Oracle CEP server.

    Default: IP address of localhost.

    Remote Server PortFootref 2

    The port you specified in the remote Oracle CEP server 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>
    

    Default: 9002

    User NameFootref 2

    The user name that the Oracle CEP IDE for Eclipse uses to log into the remote server.

    Default: wlevs

    User PasswordFootref 2

    The password that the Oracle CEP IDE for Eclipse uses to log into the remote server.

    Default: wlevs

    Publishing

    By default, when you change an application, you must manually publish the changes to the Oracle CEP server.

    Select Never publish automatically to disable automatic publishing.

    Select Override default settings to override the default automatic publishing interval. Enter a new publishing interval (in seconds).

    Default: Never publish automatically.

    Timeouts

    Enter a positive, integer number of seconds in the Start (in seconds) field to specify the time in which the Oracle CEP server must start.

    Default: 150 seconds.

    Enter a positive, integer number of seconds in the Stop (in seconds) field to specify the time in which the Oracle CEP server must start.

    Default: 60 seconds.


    Footnote 1 Click Local Server to modify. Applies to both a local server and the runtime of a remote server.

    Footnote 2 Click Remote Server to modify. Applies only to a remote server.

  4. Select File > Save.

  5. Close the Server Overview editor.

5.3.8 How to Configure Domain (Runtime) Settings for Oracle CEP Server

After you create a server, you can use the Oracle CEP IDE for Eclipse to configure Oracle CEP server domain (runtime) settings in the Oracle CEP server config.xml file.

Recall that a local Oracle CEP server is one in which both the server and server runtime are on the same host and a remote Oracle CEP server is one in which the server and server runtime are on different hosts: the server is on a remote host and the server runtime is on the local host (the host on which you are executing the Oracle CEP IDE for Eclipse).

For both local and remote Oracle CEP servers, when you configure domain (runtime) settings, you are modifying only the Oracle CEP server config.xml on the local host.

You can also use the Oracle CEP IDE for Eclipse to configure all the important server connection and control settings that Oracle CEP IDE for Eclipse uses to communicate with the Oracle CEP server.

Any changes you make to the Oracle CEP server config.xml file for a running Oracle CEP server are not read by the Oracle CEP server until you restart it.

If you make changes to the Oracle CEP server config.xml file for a running Oracle CEP server using the Oracle CEP Visualizer, the changes apply to the running Oracle CEP server as soon as you save them. The Oracle CEP Visualizer updates the Oracle CEP server config.xml file and overwrites the current filesystem version of that file with the current, in-memory version.

If you make changes to the Oracle CEP server config.xml file by manually editing this file, and you then make further changes using the Oracle CEP Visualizer, your manual edits will be overwritten by the Oracle CEP Visualizer.

To avoid this, when you manually edit the Oracle CEP server config.xml file, always stop and start the Oracle CEP server to read those changes into the runtime configuration and then use the Oracle CEP Visualizer to make further changes.

For more information, see:

To configure domain (runtime) settings for Oracle CEP server:

  1. Select Window > Show Views > Servers.

  2. Right-click a server in the Servers view and select Open Domain Configuration File as shown in Figure 5-29.

    Figure 5-29 Editing the Domain Configuration File

    Description of Figure 5-29 follows
    Description of "Figure 5-29 Editing the Domain Configuration File"

    The Oracle CEP server domain configuration file config.xml opens as shown in Figure 5-30.

    Figure 5-30 Oracle CEP Domain Configuration File config.xml

    Description of Figure 5-30 follows
    Description of "Figure 5-30 Oracle CEP Domain Configuration File config.xml"

  3. Edit the domain configuration file as required.

  4. Select File > Save.

  5. Close the domain configuration file.

5.3.9 How to Start the Oracle CEP Visualizer from Oracle CEP IDE for Eclipse

After you create a server, you can start the Oracle CEP Visualizer from the Oracle CEP IDE for Eclipse.

The Oracle CEP Visualizer is the administration console for a running Oracle CEP server. For more information, see the Oracle Fusion Middleware Visualizer User's Guide for Oracle Complex Event Processing.

For more information, see Section 5.2.1, "How to Create a Local Oracle CEP Server and Server Runtime".

Note:

If you use the Oracle CEP Visualizer to make changes to the Oracle CEP server config.xml (for example, editing a data source), you may overwrite config.xml file changes made manually. For more information, see Section 5.3.8, "How to Configure Domain (Runtime) Settings for Oracle CEP Server".

To start the Oracle CEP Visualizer from Oracle CEP IDE for Eclipse:

  1. Start the server (see Section 5.3.1, "How to Start a Local Oracle CEP Server").

  2. Right-click the running server in the Servers view and select Open CEP Visualizer as shown in Figure 5-31.

    Figure 5-31 Opening the Oracle CEP Visualizer

    Description of Figure 5-31 follows
    Description of "Figure 5-31 Opening the Oracle CEP Visualizer"

    The Oracle CEP Visualizer opens as shown in Figure 5-32.

    Figure 5-32 Oracle CEP Visualizer

    Description of Figure 5-32 follows
    Description of "Figure 5-32 Oracle CEP Visualizer"

  3. Use the Oracle CEP Visualizer as the Oracle Fusion Middleware Visualizer User's Guide for Oracle Complex Event Processing describes.

5.4 Debugging an Oracle CEP Application Running on an Oracle CEP Server

Because Oracle CEP applications are Java applications, standard Java debugging tools including those provided in Eclipse can be used with these applications.

This section describes:

You can also use the load generator and csvgen adapter to simulate data feeds for testing. For more information, see Chapter 25, "Testing Applications With the Load Generator and csvgen Adapter".

5.4.1 How to Debug an Oracle CEP Application Running on an Oracle CEP Server

This section describes how to debug an Oracle CEP application running on an Oracle CEP server.

To debug an Oracle CEP application running on an Oracle CEP server:

  1. Set a breakpoint in the Java code you wish to debug.

    In this case, set the breakpoint by right-clicking in the gutter of the editor and selecting Toggle Breakpoint as Figure 5-33 shows.

    Figure 5-33 Setting a Breakpoint

    Description of Figure 5-33 follows
    Description of "Figure 5-33 Setting a Breakpoint"

  2. Select Window > Show Views > Servers.

  3. Start the server in debug mode by choosing one of the following as shown in Figure 5-34:

    1. Click the Start the Server in debug mode icon in the Servers view tool bar.

    2. Right-click a server in the Servers view and select Debug.

    Figure 5-34 Starting the Oracle CEP Server in Debug Mode

    Description of Figure 5-34 follows
    Description of "Figure 5-34 Starting the Oracle CEP Server in Debug Mode"

  4. The server will start, and when it gets to your breakpoint the thread will stop.

    If the Oracle CEP IDE for Eclipse does not automatically switch to the Debug perspective, switch to that perspective by selecting Window > Open Perspective > Other and selecting the Debug option from the list of perspective.

  5. Debug your application using the Debug perspective.

    Note:

    In some cases you may get a dialog box warning that it could not install a breakpoint because of missing line number information. This dialog comes from the core Eclipse debugger and is normally a harmless issue with Oracle CEP Service Engine applications. Simply check the Don't Tell Me Again checkbox and continue debugging.

  6. When you are finished you can stop the server as usual (see Section 5.3.2, "How to Stop a Local Oracle CEP Server").