Oracle Stream Analytics uses XML schema definitions (xsd's) to describe the types that you can use in XML documents that define application, debugging, deployment, component, server, data cartridge, and binding configurations. The Oracle Stream Analytics modules in Oracle JDeveloper generate these configurations according to the xsd's described in this book.
The Oracle Stream Analytics schema files are provided in the installation in the /Oracle/Middleware/my_osa/xsd
directory.
This chapter includes the following sections:
You use the EPN assembly file to declare the components that make up your Oracle Stream Analytics application and how they connect to each other. The EPN assembly file is an extension of the standard Spring context file. You also use the file to register the Java classes that implement the adapter and POJO components of your application, register the event types that you use throughout your application and EPL rules, and reference in your environment the Oracle Stream Analytics-specific services.
The following XML file shows the EPN assembly file for the HelloWorld example:
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:osgi="http://www.springframework.org/schema/osgi" xmlns:wlevs="http://www.bea.com/ns/wlevs/spring" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd http://www.bea.com/ns/wlevs/spring http://www.bea.com/ns/wlevs/spring/spring-wlevs-v12_1_3_0.xsd"> <wlevs:event-type-repository> <wlevs:event-type type-name="HelloWorldEvent"> <wlevs:class>com.bea.wlevs.event.example.helloworld.HelloWorldEvent</wlevs:class> </wlevs:event-type> </wlevs:event-type-repository> <!-- Adapter can be created from a local class, without going through a adapter factory --> <wlevs:adapter id="helloworldAdapter" class="com.bea.wlevs.adapter.example.helloworld.HelloWorldAdapter" > <wlevs:instance-property name="message" value="HelloWorld - the current time is:"/> </wlevs:adapter> <wlevs:channel id="helloworldInputChannel" event-type="HelloWorldEvent" > <wlevs:listener ref="helloworldProcessor"/> <wlevs:source ref="helloworldAdapter"/> </wlevs:channel> <!-- The default processor for Oracle Event Processing 12.1.3.0 is CQL --> <wlevs:processor id="helloworldProcessor" /> <wlevs:channel id="helloworldOutputChannel" event-type="HelloWorldEvent" advertise="true"> <wlevs:listener> <bean class="com.bea.wlevs.example.helloworld.HelloWorldBean"/> </wlevs:listener> <wlevs:source ref="helloworldProcessor"/> </wlevs:channel> </beans>
An Oracle Stream Analytics application contains one or more component configuration files in its META-INF/wlevs
directory. You use component configuration files to override the default configuration for Oracle Stream Analytics components such as adapters, channels, and processors. The wlevs_application_config.xsd
schema file describes the structure of component configuration files. This XSD schema imports the following schemas:
wlevs_base_config.xsd
wlevs_eventstore_config.xsd
wlevs_diagnostic_config.xsd
The following component configuration file is for the HelloWorld
sample application:
<?xml version="1.0" encoding="UTF-8"?><n1:config xmlns:n1="http://www.bea.com/ns/wlevs/config/application" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <processor> <name>helloworldProcessor</name> <rules> <query id="helloworldRule"> <![CDATA[ select * from helloworldInputChannel [Now] > </query> </rules> </processor> <channel> <name>helloworldInputChannel</name> <max-size>10000</max-size> <max-threads>2</max-threads> </channel> <channel> <name>helloworldOutputChannel</name> <max-size>10000</max-size> <max-threads>2</max-threads> </channel> </n1:config>
The deployments.xml
file is in the /Oracle/Middleware/my_osa/user_projects/domains/<domain>/<server>/
directory. This XML file lists the OSGi bundles that have been deployed to the server. The deployment.xsd
schema file describes the structure of deployment files.
The following example shows the deployments.xml
file for the sample FX domain:
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wlevs="http://www.bea.com/ns/wlevs/deployment" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.bea.com/ns/wlevs/deployment http://www.bea.com/ns/wlevs/deployment/deployment.xsd"> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE"/> </bean> <wlevs:deployment id="fx" state="start" location="file:${wlevs.domain.home}/applications/fx/com.bea.wlevs.example.fx_11.1.0.0.jar"/> </beans>
The Oracle Stream Analytics server configuration file is located in the DOMAIN_DIR
/
servername
/config
directory To change the configuration of an Oracle Stream Analytics instance, update this file manually to add or remove server configuration elements. The welvs_server_config.xsd
schema file describes the structure of server configuration files.
The following example shows how to configure some of these services:
<?xml version="1.0" encoding="UTF-8"?> <n1:config xsi:schemaLocation=" http://www.bea.com/ns/wlevs/config/server wlevs_server_config.xsd" xmlns:n1="http://www.bea.com/ns/wlevs/config/server" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <netio> <name>NetIO</name> <port>9002</port> </netio> <netio> <name>sslNetIo</name> <ssl-config-bean-name>sslConfig</ssl-config-bean-name> <port>9003</port> </netio> <work-manager> <name>JettyWorkManager</name> <min-threads-constraint>5</min-threads-constraint> <max-threads-constraint>10</max-threads-constraint> </work-manager> <jetty> <name>JettyServer</name> <network-io-name>NetIO</network-io-name> <work-manager-name>JettyWorkManager</work-manager-name> <secure-network-io-name>sslNetIo</secure-network-io-name> </jetty> <rmi> <name>RMI</name> <http-service-name>JettyServer</http-service-name> </rmi> <jndi-context> <name>JNDI</name> </jndi-context> <exported-jndi-context> <name>exportedJndi</name> <rmi-service-name>RMI</rmi-service-name> </exported-jndi-context> <jmx> <rmi-service-name>RMI</rmi-service-name> <jndi-service-name>JNDI</jndi-service-name> </jmx> <ssl> <name>sslConfig</name> <key-store>./ssl/dsidentity.jks</key-store> <key-store-pass> <password>changeit</password> </key-store-pass> <key-store-alias>ds</key-store-alias> <key-manager-algorithm>SunX509</key-manager-algorithm> <ssl-protocol>TLS</ssl-protocol> <enforce-fips>false</enforce-fips> <need-client-auth>false</need-client-auth> </ssl> <http-pubsub> <name>pubsub</name> <path>/pubsub</path> <pub-sub-bean> <server-config> <name>pubsubbean</name> <supported-transport> <types> <element>long-polling</element> </types> </supported-transport> <publish-without-connect-allowed>true</publish-without-connect-allowed> </server-config> <channels> <element> <channel-pattern>/evsmonitor</channel-pattern> </element> <element> <channel-pattern>/evsalert</channel-pattern> </element> <element> <channel-pattern>/evsdomainchange</channel-pattern> </element> </channels> </pub-sub-bean> </http-pubsub> </n1:config>