1 Overview

Oracle Event Processing on Oracle Java Embedded systems is an event processing server designed to support event processing applications in embedded environments such as those supported by the Java Embedded Suite (JES). Oracle Event Processing on Oracle Java Embedded systems features represent a subset of Oracle Event Processing features.

This guide introduces Oracle Event Processing on Oracle Java Embedded systems and provides installation information. For more information about Oracle Event Processing, see Oracle Fusion Middleware Getting Started with Oracle Event Processing.

This chapter includes the following sections:

1.1 Introduction

Event processing applications receive potentially large amounts of streaming data that represents events and responds in real time based on the event data. Oracle Event Processing on Oracle Java Embedded systems supports applications deployed in embedded environments often found at or near event sources. These environments include sensors such as for environment conditions and moving sources such as vehicles or mobile devices.

By deploying event processing applications in these locations, you can filter events at or near the event source, reducing the amount of network traffic flowing through other server resources, including Oracle Event Processing applications on enterprise servers.

Oracle Event Processing on Oracle Java Embedded systems includes a subset of the functionality available in Oracle Event Processing. It also includes functionality specific to embedded environments. For a list of features both included and omitted, see Section 1.1.2, "Features".

1.1.1 Use Cases

The use cases described in this section illustrate specific uses for Oracle Event Processing on Oracle Java Embedded systems.

Temperature Analysis

A company provides smart home services, in part by monitoring temperature events from residential thermostats. The company wants finer control over event analysis and to reduce network traffic.

The company receives temperature events over the Internet from thermostats in many locations. Data from the thermostats is used to identify patterns and possible alert conditions.

Within an Oracle Event Processing on Oracle Java Embedded systems application embedded in the thermostat devices, Oracle CQL queries aggregate the event data and perform a threshold analysis before the events are sent over the Internet. As a result, the events received have already been identified as worth attention.

Server Room Monitoring

A company offering data management devices and services needs to improve its data center coordination and energy management to reduce the total cost of ownership. The company needs finer-grained, more detailed sensor and data center reporting.

The company receives energy usage sensor data from disparate resources. Data from each sensor must be analyzed for its local relevance, then must be aggregated with data from other sensors to identify patterns that can be used to improve efficiency.

Separate Oracle Event Processing applications provide a two-tiered approach. In one tier, sensors at the very edge of the network represent event sources that send data to gateway devices. These devices run Java SE, Java Embedded Suite (JES), and Oracle Event Processing on Oracle Java Embedded systems.

Oracle Event Processing on Oracle Java Embedded systems applications running on the devices use Oracle Continuous Query Language (Oracle CQL) to query and filter events generated by the sensors. Only event data that meets the filtering criteria is sent to back-end servers in the datacenter where Oracle Event Processing applications run. The Oracle Event Processing applications on the servers send alerts when needed and aggregate and correlate data from across the system to identify consistency issues and to produce data to be used in reports on patterns.

1.1.2 Features

Oracle Event Processing on Oracle Java Embedded systems includes a subset of the features provided in Oracle Event Processing. This subset supports the particular application needs of event processing in an embedded environment. This section lists the features that are included and those that are not.

Note:

There are no tool-related warnings related to using features in an embedded application that are not supported by that tool. When you use Oracle JDeveloper to develop Oracle Event Processing on Oracle Java Embedded systems applications, use only supported features.

Table 1-1 Features Included in Oracle Event Processing on Oracle Java Embedded systems

Feature Notes

Programming model

As with traditional Oracle Event Processing, you develop embedded applications as event processing networks (EPNs). Some features of the programming model are not supported, including features that support tuning for high availability and scalability.

Oracle (CQL)

Oracle CQL is supported, with the exception of functionality provided by the data cartridges listed in Table 1-2.

Java data cartridge

The Java data cartridge enhances Oracle CQL with the ability to invoke Java code from Oracle CQL code.

Data source access

This release supports access to Java DB through drivers included with Java Embedded Suite (JES). You can configure a data source in the standard way using the config.xml file.

For more information about database access, see Section 1.2, "Application and Development Framework".

RESTful web services

You can implement RESTful web services through the Jersey JAX-RS support included with Java Embedded Suite. For more information, see REST Web Services Support.

Local cache

You can use the included local caching service. Coherence caching is not supported in this release. For more about caching support, see Section 1.2, "Application and Development Framework".

Security

Including authentication and SSL and utilities such as policygen, cssconfig, and encryptMSAConfig.

Jetty (HTTPS) service

For more information on Jetty in Oracle Event Processing on Oracle Java Embedded systems, see Section 1.2, "Application and Development Framework".

Configuration

You can use the Configuration Wizard silent mode to create and configure domains. For more information, see Section 1.3, "Creating Domains and Configuring the Server".

Deployer

You can deploy applications from the command line with the Deployer tool.

For more information on Deployer support in Oracle Event Processing on Oracle Java Embedded systems, see Section 1.5, "Application Deployment".

Administration tool

For more information on using wlevs.Admin, see Section 1.6, "Application Administration"

Management through JMX

This release supports management through Java Management Extensions (JMX).

For more about JMX in Oracle Event Processing on Oracle Java Embedded systems, see Section 1.6, "Application Administration".

Logging

Oracle Event Processing servers save information to log files for viewing.


Table 1-2 lists the Oracle Event Processing features that are not supported in Oracle Event Processing on Oracle Java Embedded systems. If you attempt to deploy an application that uses these features, you can receive a deployment or runtime error or failure.

Table 1-2 Features Not Included in Oracle Event Processing on Oracle Java Embedded systems

Feature Notes

Clustering

Embedded applications cannot be clustered.

Coherence caching

Caching through the included local cache service is supported.

Oracle Event Processing Visualizer

Oracle Event Processing Visualizer is not available as a user interface to manage applications. You can manage applications with the command line tools, including the Deployer and the Administration tool.

HTTP publish-subscribe server and adapter

This release does not include the HTTP publish-subscribe server.

JMS adapter and WebLogic Server JMS client API

This release does not include support for JMS.

CSV file adapter

This release does not include an adapter for using a CSV file as test event data.

Load generator

This release does not include the tool for generating event data.

Event recording and playback

This release does not include the ability to record event activity and play it back for testing and debugging.

JDBC drivers, including drivers for SQL Server, Oracle JDBC, and Berkeley DB

You can configure a data source in the standard way with the config.xml file. This release supports access to Java DB through the drivers included with Java Embedded Suite (JES).

Oracle CQL Cartridges (except Java)

Of the Oracle CQL cartridges, which provide support for Oracle CQL enhancements, only the Java cartridge is supported. In particular, the spatial and JDBC cartridges are not supported.

Java Persistence API (JPA) for object-relational mapping

This release does not include support for JPA.

Java Architecture for XML Binding (JAXB)

This release does not include support for JAXB.

SOAP web services

This release does not include support for SOAP web services.

Some security utilities

The passgen, secgen, and GrabCert utilities are not supported in this release.

Monitoring

This release does not include support for monitoring.

Event inspect and trace

This release does not include features to view events flowing from EPN stages and inject events into EPN stages.


Note:

You can use some unsupported features early in development, such as the load generator and CSV adapter, if you remove them before you deploy the application into an embedded environment.

1.2 Application and Development Framework

Oracle Event Processing on Oracle Java Embedded systems supports Java Embedded Suite (JES) technologies such as Java DB for database access, Jersey for RESTful web services support, and the JES JRE. You can use the jconsole JES monitoring tool remotely. Local connections are not supported.

For JES documentation, see http://www.oracle.com/technetwork/java/embedded/resources/java-embedded-suite/index.html.

The following describes technologies that are part of the framework that supports Oracle Event Processing on Oracle Java Embedded systems.

Database Access

Oracle Event Processing on Oracle Java Embedded systems supports the Java DB database engine (based on the Derby project) included with JES. You can use Java DB in either client mode or embedded server mode. You enable access to a Java DB database by copying the driver to the correct location and configuring the data source in the server configuration file. Oracle Event Processing on Oracle Java Embedded systems does not include default JDBC drivers.

Table 1-3 lists Derby drivers and how you can get them:

Table 1-3 Location of Derby Drivers to Support Java DB Access

Driver Where to Find It

Embedded Java DB driver

The embedded driver, derby.jar, is included with JES at the following JES installation directory:

JES_INSTALL_DIR/javadb/lib

Java DB client driver (used for client access to a remote Java DB instance)

The client driver, derbyclient.jar, is not included with JES. You can download the correct version at the following URL:

http://db.apache.org/derby/releases/release-10.8.2.2.html


Once you have the driver JAR file, copy it to the following location in the Oracle Event Processing on Oracle Java Embedded systems server file system:

DOMAIN_HOME\SERVER_HOME\modules\ext

With the driver JAR in the correct location, you can configure data sources through a data-source element that you add to the server config.xml file.

For more information about configuring a data source, see information about the data-source element in.

Web Server

Oracle Event Processing on Oracle Java Embedded systems includes the Jetty web server and supports the Java Servlet API. The standard org.osgi.service.http.HttpService interface is also supported, allowing servlets to be dynamically registered.

Cache Support

As in Oracle Event Processing, Oracle Event Processing on Oracle Java Embedded systems includes simple caching support. You can use the local cache to write applications that access cached data for faster processing. Note that Oracle Coherence is not supported.

For more information about the local cache, see Oracle Fusion Middleware Developing Applications for Oracle Event Processing .

REST Web Services Support

You can implement web services to expose aspects of your Oracle Event Processing on Oracle Java Embedded systems applications. Oracle Event Processing on Oracle Java Embedded systems enables you to implement RESTful web services based on the JAX-RS standard with the Jersey libraries included with Java Embedded Suite. Jersey is the reference implementation of the Java API for RESTful Web Services (JAX-RS) standard.

For more on enabling REST support in your Oracle Event Processing on Oracle Java Embedded systems application, see Section 1.4.2, "REST Web Services Support".

For more information about Jersey, see the Jersey User Guide at http://jersey.java.net/nonav/documentation/latest/user-guide.html.

1.3 Creating Domains and Configuring the Server

Use the Configuration Wizard to create a new domain on which to deploy Oracle Event Processing on Oracle Java Embedded systems. Oracle Event Processing on Oracle Java Embedded systems supports the Configuration Wizard in silent mode, a non-interactive way to create and configure a domain.

The Configuration Wizard creates a single default server in the domain. All of the server-related files are located in a subdirectory of the domain directory that is named the same as the server.

Note:

The public-key certificate must include the full host name as its cn name and the certificate alias name should be evsidentity.

Run the Configuration Wizard in Silent Mode

When you run the Configuration Wizard in silent mode, the program uses the silent.xml file to determine which configuration options to use. A sample silent.xml file comes with the installation at /Oracle/Middleware/my_embedded_oep/oep/common/lib/silent.xml.

  1. Create a silent.xml file that defines the domain configuration settings.

    Incorrect entries in the silent.xml file can cause failures. To determine the cause of a failure, create a log file when you launch the Configuration Wizard.

  2. Open a command window and change to the /Oracle/Middleware/my_embedded_oep/oep/common/bin directory.

  3. Invoke the config.sh shell command in silent mode:

    sh config.sh -mode=silent -silent_xml=path_to_xml_file
    

    where path_to_xml_file is the full path name of the silent.xml template file you created.

  4. To create an execution log, use the -log=full_path_to_log_file option:

    sh config.sh -mode=silent -silent_xml=path_to_xml_file -log=/home/logs/create_domain.log
    

    Upon successful completion, the command returns messages similar to the following:

    /home/testuser/java/jes7.0/jre/bin is added to path
    <Tue Feb 26 01:41:23 PST 2013> <Info> <BootBundle> <BEA-1004030> <An encryption key file at location /home/testuser/test_domain/test_server/.aesinternal.dat has been generated>
    testuser@emb-sca-ti-xm-2:~/Oracle/Middleware0220/ocep_11.1/common/bin$
    

If the Configuration wizard does not complete successfully, check the log file for more information. The shell command exit code can help you learn more about the outcome of silent execution. For more information, see Configuration Wizard Silent Mode Exit Codes.

Create a silent.xml File

  1. Create an empty file called silent.xml on the computer on which you want to run the Configuration Wizard in silent mode.

  2. Copy the contents of the following sample XML file into your own silent.xml file.

    <?xml version="1.0" encoding="UTF-8"?>
    <bea-installer xmlns="http://www.bea.com/plateng/wlevs/config/silent">
        <input-fields>
    
            <data-value name="CONFIGURATION_OPTION" value="createDomain" />
            <data-value name="USERNAME" value="wlevs" />
            <data-value name="PASSWORD" value="wlevs" />
    
            <data-value name="SERVER_NAME" value="my_server" />
            <data-value name="DOMAIN_NAME" value="mydomain" />
            <data-value name="DOMAIN_LOCATION" value="/home/mydomains" />
    
            <data-value name="NETIO_PORT" value="9002" />
            <data-value name="KEYSTORE_PASSWORD" value="welcome1" /> 
    
            <data-value name="DB_URL" value="jdbc:oracle:thin:@hostname.com:1521:xe" />
            <data-value name="DB_USERNAME" value="wlevs" />
            <data-value name="DB_PASSWORD" value="wlevs" />
        </input-fields>
    </bea-installer>
    
  3. In the silent.xml file you just created, edit the values for the keywords shown in Table 1-4 to reflect your configuration.

  4. Save the file in the directory of your choice.

Data Value Names for the silent.xml File

Table 1-4 Data-value names for silent.xml file

For this data-value name... Enter the following value...

CONFIGURATION_OPTION

Specifies whether you want to create a new domain with a default server or update a server in an existing domain.

Valid values are createDomain or updateDomain. Default value is createDomain.

USERNAME

The user name of the administrator of the created or updated server in the domain.

PASSWORD

The password of the administrator of the created or updated server in the domain.

SERVER_NAME

The name of the new server in this domain. This name is also used for the name of the directory that contains the server files.

DOMAIN_NAME

The name of the domain.

DOMAIN_LOCATION

The full name of the directory that contains the domain.

NETIO_PORT

The port number to which the server instance itself listens.

KEYSTORE_PASSWORD

The password for the identity key store.

PRIVATEKEY_PASSWORD

The password for the certificate private key.

The default value of this option is the value of the KEYSTORE_PASSWORD.

DB_URL

The URL to connect to a database with JDBC. This option is used to configure the data source.

The database configuration parameters are optional; if you do not specify them, then no data source is configured for the server.

The configuration wizard supports configuring a data source using the Oracle database only. To use another database technology, please edit the configuration manually.

DB_USERNAME

The name of the user that connects to the database through the data source.

The database configuration parameters are optional. If you do not specify them, then no data source is configured for the server.

DB_PASSWORD

The password of the user that connects to the database via the data source.

The database configuration parameters are optional. If you do not specify them, then no data source is configured for the server.


Configuration Wizard Silent Mode Exit Codes

When run in silent mode, the Configuration Wizard generates exit codes that indicate the success or failure of domain creation and configuration. These exit codes are shown in Table 1-5.

Table 1-5 Configuration Wizard Silent Mode Exit Codes

Code Description

0

Configuration Wizard execution completed successfully.

-1

Configuration Wizard execution failed due to a fatal error

-2

Configuration Wizard execution failed due to an internal XML parsing error


1.4 Applications Development

You can develop Oracle Event Processing on Oracle Java Embedded systems applications with Oracle JDeveloper. See Oracle Fusion Middleware Getting Started with Oracle Event Processing for information about Oracle JDeveloper

When you develop embedded applications, you must limit the set of features you use to those that are supported on Oracle Event Processing on Oracle Java Embedded systems.

Note:

Oracle JDeveloper currently includes no support for ensuring that the embedded applications you build will deploy and run in an embedded environment. For example, Oracle JDeveloper does not validate that your embedded application does not include features that are not supported.

If you create applications using features unsupported by Oracle Event Processing on Oracle Java Embedded systems (whether or not you use Oracle JDeveloper), you might see deployment errors or runtime failures.

For a list of Oracle Event Processing features included in (and excluded from) Oracle Event Processing on Oracle Java Embedded systems, see Section 1.1.2, "Features".

1.4.1 Example Embedded Application

Oracle Event Processing on Oracle Java Embedded systems includes the Smart Appliance example application. The application listens for device events through a socket connection. The device events represent device information and the values associated with it. The threshold values for each device is stored in a JavaDB database. As the application processes device events, if an event value does not fall within specified threshold limits, then the application generates the alerts.

For more information about the sample, including how to run it, see the readme.txt file included with it.

After you install Oracle Event Processing on Oracle Java Embedded systems, you can find the Smart Appliance application at the following file system location:

/Oracle/Middleeware/my_embedded_oep/oep/examples/source/smartappliance

1.4.2 REST Web Services Support

You can expose RESTful web services from your application by using Jersey, the JAX-RS implementation included with Java Embedded Suite. Once you have REST support enabled, you can annotate methods of your Java code so that they execute when REST client calls are made. The Smart Appliance sample application is an example of a REST-enabled application.

For more information about using Jersey and JAX-RS, see the Jersey User Guide at http://jersey.java.net/nonav/documentation/latest/user-guide.html.

Enable Support for REST Web Services

To enable REST support, ensure that the Jersey libraries are in the application class path so that you can use them in classes that implement methods as REST resources. Also configure your RESTful classes with the OSGi service so that they are available to external clients.

The following REST web services are supported:

  • Inbound REST with JSXON, XML, and CSV media types

  • Outbound REST with JSON and XML media types.

To enable REST web services support:

  1. Ensure that the Jersey libraries are in your application class path.

    For example, put the JAR files in the modules/ext directory of your Oracle Event Processing on Oracle Java Embedded systems server domain.

  2. In your application assembly file, include an OSGi HTTP Service reference and associate it with the bean that represents your RESTful class, as follows:

    <osgi:reference id="httpServiceRef" interface="org.osgi.service.http.HttpService" />
    <!-- Bean declaration with properties for the RESTful service root context
         and OSGi HTTP service.  -->
    <bean id="bean" class="com.oracle.cep.example.smartappliance.sink.AlertsService">
        <property name="rootContext" value="/alerts" />
        <property name="httpService" ref="httpServiceRef" />
    </bean>
    
  3. In your bean class code, provide a setter method for the HTTP Service, such as setHttpService(HttpService httpService).

  4. Register a REST servlet with the OSGi HTTP service as follows:

    1. Create a Jersey ServletContainer instance with the appropriate initialization parameters.

    2. In the initialization parameters, set the javax.ws.rs.Application property as the implemented JAX-RS Application class name. The Application class is the one the loads the resource classes.

    The following example shows the setHttpService(HttpService httpService) setter method, and the OSGi service registration.

    public void setHttpService(HttpService httpService) 
           throws Exception {
        Hashtable<String, String> initParams = new Hashtable<String, String>();
        initParams.put("javax.ws.rs.Application",
           WebApplication.class.getName());
        Servlet jerseyServlet = new ServletContainer();
        httpService.registerServlet(rootContext, jerseyServlet, initParams, null);
    }
    

1.5 Application Deployment

You deploy Oracle Event Processing on Oracle Java Embedded systems applications with the Deployer command-line tool included in the installation. You can deploy over both SSL and or non-SSL connections.

The Deployer tool is nearly identical to the Deployer tool provided in Oracle Event Processing, but cluster and group deployments are not supported in Oracle Event Processing on Oracle Java Embedded systems.

Note:

Oracle Event Processing Visualizer is not included with Oracle Event Processing on Oracle Java Embedded systems, so deployment through a graphical user interface is not supported.

To deploy an application to a running Oracle Event Processing on Oracle Java Embedded systems server, use a command similar to the following:

java -jar wlevsdeploy.jar -url http://hostname:9002/wlevsdeployer -user oepadmin -password welcome1 -install myoepapp.jar

The following examples illustrate additional deployment scenarios.

Deploy to a Local Server

java -jar wlevsdeploy.jar -user oepadmin -password welcome1 -url http://localhost:9002/wlevsdeployer -install application

Deploy Over a Non-SSL Connection

java -jar wlevsdeploy.jar -user oepadmin -password welcome1 -url http://<host>:9002/wlevsdeployer -install application

Deploy Over SSL

java -Djavax.net.ssl.trustStore=d:\downloads\evsidentity.jks -Djavax.net.ssl.trsutStorePassword=welcome1 -jar wlevsdeploy.jar -user oepadmin -password welcome1 -url https://<host>:9003/wlevsdeployer -install application

1.6 Application Administration

You can administer Oracle Event Processing on Oracle Java Embedded systems applications with the wlevs.Admin command-line tool and Java Management Extensions (JMX). Whether you use JMX or wlevs.Admin, Oracle Event Processing on Oracle Java Embedded systems supports administration for all but those features omitted from this release. For more information about administrative features, see Oracle Fusion Middleware Administering Oracle Event Processing.

For a list of omitted features, see Section 1.1.2, "Features".

Note:

Oracle Event Processing Visualizer is not included with Oracle Event Processing on Oracle Java Embedded systems, so administration through a graphical user interface is not supported.

Administration with JMX

Oracle Event Processing on Oracle Java Embedded systems supports remote JMX connections through MSA RMI as in Oracle Event Processing. Most configuration and runtime MBeans are supported, with the exception of those specifically related to omitted features. For example the HttpPubSubAdapterMBean, JMSAdapterMBean, and Monitoring related MBeans are not supported because the underlying features are not supported.

Note:

The JES JRE does not include support for the JMX local attach API, so local (non-RMI) JMX connections aren't supported.

Administration with wlevs.Admin

The Admin command line utility is supported and includes most of the functionality present in Oracle Event Processing. Unsupported functionality is specifically related to unsupported features, including commands related to monitoring or record and play back.

For example, you can add an Oracle CQL rule locally with the Admin utility ADDRULE command, as shown in the following example:

prompt> java wlevs.Admin 
        -url service:jmx:msarmi://localhost:9002/jndi/jmxconnector 
        -username wlevs -password wlevs 
        ADDRULE -application helloworld -processor helloworldProcessor 
        -query myquery "SELECT * FROM Withdrawal [Rows 5]"

Note:

This release does not support starting the server with the -disablesecurity flag.

1.6.1 The policygen Command-Line Utility

Use the policygen command-line utility to generate an extensible access control markup language (XACML) file.

The policygen utility is located at /Oracle/Middleware/my_embedded_oep/oep/bin/. Use the following syntax to form the command:

policygen.sh [-h] [-s] [-l|-x] entitlement_file xacml_output_file

Table 1-6 policygen Arguments

Option Description Defaults

-s

Specifies that standard XACML policy is generated in the output file; otherwise, entitlement XACML policy will be generated.

 

-l

Specifies that an XACML LDIFT file should be generated.

 

-x

Specifies that an XACML policy file should be generated.

 

-h

Displays usage help.

 

entitlement_file

Specifies the location of input entitlement XML file.

 

xacml_output_file

Specifies the location of output XACML file.

 

For example:

prompt> policygen.sh ~/security/policygen/AuthorizerInit.xml XACMLAuthorizerInit.ldift

1.7 Supported Platform and Resource Configurations

Oracle Event Processing on Oracle Java Embedded systems supports the following platform configurations:

  • Java Runtime Environment (JRE): Java Embedded Suite (JES) 7.0

  • Operating System: Linux

  • Hardware: x86 or ARM

Oracle Event Processing on Oracle Java Embedded systems supports smaller disk and heap footprint requirements. For a new installation, it requires 60 MB of disk space. With the server started and applications deployed, additional disk space is needed per application.