Author: objectiser
Date: 2010-03-16 08:07:58 -0400 (Tue, 16 Mar 2010)
New Revision: 571
Added:
trunk/samples/quickstart/bpel_event_listener/
trunk/samples/quickstart/bpel_event_listener/build.xml
trunk/samples/quickstart/bpel_event_listener/readme.txt
trunk/samples/quickstart/bpel_event_listener/src/
trunk/samples/quickstart/bpel_event_listener/src/org/
trunk/samples/quickstart/bpel_event_listener/src/org/jboss/
trunk/samples/quickstart/bpel_event_listener/src/org/jboss/riftsaw/
trunk/samples/quickstart/bpel_event_listener/src/org/jboss/riftsaw/event/
trunk/samples/quickstart/bpel_event_listener/src/org/jboss/riftsaw/event/RiftSawEventListener.java
Modified:
trunk/distribution/src/main/assembly/bin.xml
Log:
Added an example to show how to create a BpelEventListener implementation to monitor
activity within the BPEL engine.
Modified: trunk/distribution/src/main/assembly/bin.xml
===================================================================
--- trunk/distribution/src/main/assembly/bin.xml 2010-03-12 17:26:47 UTC (rev 570)
+++ trunk/distribution/src/main/assembly/bin.xml 2010-03-16 12:07:58 UTC (rev 571)
@@ -80,6 +80,7 @@
<include>quickstart/simple_correlation/**</include>
<include>quickstart/simple_invoke/**</include>
<include>quickstart/simple_pick/**</include>
+ <include>quickstart/bpel_event_listener/**</include>
<include>readme.txt</include>
</includes>
</fileSet>
Added: trunk/samples/quickstart/bpel_event_listener/build.xml
===================================================================
--- trunk/samples/quickstart/bpel_event_listener/build.xml (rev
0)
+++ trunk/samples/quickstart/bpel_event_listener/build.xml 2010-03-16 12:07:58 UTC (rev
571)
@@ -0,0 +1,58 @@
+<project name="Quickstart_bpel_event_listener" default="deploy"
basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <!-- Import the base Ant build script... -->
+ <property file="../../../install/deployment.properties" />
+
+ <property name="server.dir"
value="${org.jboss.as.home}/server/${org.jboss.as.config}"/>
+ <property name="conf.dir" value="${server.dir}/conf"/>
+ <property name="deploy.dir" value="${server.dir}/deploy"/>
+ <property name="server.lib.dir" value="${server.dir}/lib"/>
+
+ <property name="riftsaw.lib.dir"
value="${deploy.dir}/riftsaw.sar/lib"/>
+
+ <property name="sample.jar.name" value="${ant.project.name}.jar"
/>
+
+ <property name="build.dir" location="build/classes"/>
+
+ <path id="compile-classpath">
+ <fileset dir="${org.jboss.as.home}/client" includes="*.jar"
/> <!-- Required for JMS Client Code. -->
+ <fileset dir="${riftsaw.lib.dir}" includes="*.jar" /> <!--
Required for JMS Client Code. -->
+ </path>
+ <property name="compile-classpath"
refid="compile-classpath"/>
+
+ <target name="makejar" description="make jar">
+ <!-- Compile... -->
+ <mkdir dir="${build.dir}" />
+ <javac srcdir="src" destdir="${build.dir}"
debug="true">
+ <classpath>
+ <path refid="compile-classpath" />
+ </classpath>
+ </javac>
+
+ <jar basedir="${build.dir}"
destfile="${riftsaw.lib.dir}/${sample.jar.name}" />
+ </target>
+
+ <target name="deploy" depends="makejar" >
+ <echo>Deploy ${ant.project.name}</echo>
+
+ <echo></echo>
+ <echo></echo>
+ <echo>Don't forget to add
'bpel.event.listeners=org.jboss.riftsaw.event.RiftSawEventListener'</echo>
+ <echo>to the $AS/servers/default/deploy/riftsaw.sar/bpel.properties
file</echo>
+ </target>
+
+ <target name="undeploy" >
+ <echo>Undeploy ${ant.project.name}</echo>
+ <delete file="${riftsaw.lib.dir}/${sample.jar.name}" />
+
+ <echo></echo>
+ <echo></echo>
+ <echo>Don't forget to remove
'bpel.event.listeners=org.jboss.riftsaw.event.RiftSawEventListener'</echo>
+ <echo>from the $AS/servers/default/deploy/riftsaw.sar/bpel.properties
file</echo>
+ </target>
+</project>
Added: trunk/samples/quickstart/bpel_event_listener/readme.txt
===================================================================
--- trunk/samples/quickstart/bpel_event_listener/readme.txt (rev
0)
+++ trunk/samples/quickstart/bpel_event_listener/readme.txt 2010-03-16 12:07:58 UTC (rev
571)
@@ -0,0 +1,17 @@
+Quickstart Examples - Event Listener
+====================================
+
+This is a simple BPEL engine event listener example, which will display
+activity events generated by the ODE engine to the server console. This
+can be used to write a custom event listener for logging and management
+purposes.
+
+To deploy the example, open a command line window in the example's folder,
+and simply type 'ant deploy'. To undeploy, use the command 'ant
undeploy'.
+
+Once the example event listener has been deployed, you will need to manually
+update the $AS/server/default/deploy/riftsaw.sar/bpel.properties file to
+include the following:
+
+bpel.event.listeners=org.jboss.riftsaw.event.RiftSawEventListener
+
Added:
trunk/samples/quickstart/bpel_event_listener/src/org/jboss/riftsaw/event/RiftSawEventListener.java
===================================================================
---
trunk/samples/quickstart/bpel_event_listener/src/org/jboss/riftsaw/event/RiftSawEventListener.java
(rev 0)
+++
trunk/samples/quickstart/bpel_event_listener/src/org/jboss/riftsaw/event/RiftSawEventListener.java 2010-03-16
12:07:58 UTC (rev 571)
@@ -0,0 +1,19 @@
+package org.jboss.riftsaw.event;
+
+import org.apache.ode.bpel.iapi.BpelEventListener;
+import org.apache.ode.bpel.evt.BpelEvent;
+
+public class RiftSawEventListener implements BpelEventListener {
+
+ public void startup(java.util.Properties properties) {
+ System.out.println("RiftSaw BPEL event listener started");
+ }
+
+ public void onEvent(BpelEvent bpelEvent) {
+ System.out.println("RiftSaw BPEL event: "+bpelEvent);
+ }
+
+ public void shutdown() {
+ System.out.println("RiftSaw BPEL event listener stopped");
+ }
+}