ode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From va...@apache.org
Subject svn commit: r586504 - in /ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine: BpelProcess.java BpelRuntimeContextImpl.java BpelServerImpl.java
Date Fri, 19 Oct 2007 15:41:32 GMT
Author: vanto
Date: Fri Oct 19 08:41:31 2007
New Revision: 586504

URL: http://svn.apache.org/viewvc?rev=586504&view=rev
Log:
fixing ODE-199 in trunk

Modified:
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java?rev=586504&r1=586503&r2=586504&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java Fri Oct
19 08:41:31 2007
@@ -751,18 +751,10 @@
 
     public void saveEvent(ProcessInstanceEvent event, ProcessInstanceDAO instanceDao) {
         markused();
-        List<String> scopeNames = null;
-        if (event instanceof ScopeEvent) {
-            scopeNames = ((ScopeEvent) event).getParentScopesNames();
-        }
-
-        boolean enabled = _pconf.isEventEnabled(scopeNames, event.getType());
-        if (enabled) {
-            if (instanceDao != null)
-                saveInstanceEvent(event, instanceDao);
-            else
-                __log.debug("Couldn't find instance to save event, no event generated!");
-        }
+        if (instanceDao != null)
+            saveInstanceEvent(event, instanceDao);
+        else
+            __log.debug("Couldn't find instance to save event, no event generated!");
     }
 
     void saveInstanceEvent(ProcessInstanceEvent event, ProcessInstanceDAO instanceDao) {

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java?rev=586504&r1=586503&r2=586504&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
(original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
Fri Oct 19 08:41:31 2007
@@ -48,6 +48,7 @@
 import org.apache.ode.bpel.evt.ProcessInstanceStateChangeEvent;
 import org.apache.ode.bpel.evt.ProcessMessageExchangeEvent;
 import org.apache.ode.bpel.evt.ProcessTerminationEvent;
+import org.apache.ode.bpel.evt.ScopeEvent;
 import org.apache.ode.bpel.iapi.BpelEngineException;
 import org.apache.ode.bpel.iapi.ContextException;
 import org.apache.ode.bpel.iapi.EndpointReference;
@@ -941,11 +942,19 @@
         event.setProcessInstanceId(_dao.getInstanceId());
         _bpelProcess._debugger.onEvent(event);
 
-        // notify the listeners
-        _bpelProcess._server.fireEvent(event);
+        //filter events
+        List<String> scopeNames = null;
+        if (event instanceof ScopeEvent) {
+            scopeNames = ((ScopeEvent) event).getParentScopesNames();
+        }
 
-        // saving
-        _bpelProcess.saveEvent(event, _dao);
+        if (_bpelProcess._pconf.isEventEnabled(scopeNames, event.getType())) {
+	        // notify the listeners
+	        _bpelProcess._server.fireEvent(event);
+	
+	        // saving
+	        _bpelProcess.saveEvent(event, _dao);
+        }
     }
 
     /**

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java?rev=586504&r1=586503&r2=586504&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java Fri
Oct 19 08:41:31 2007
@@ -690,8 +690,14 @@
     void fireEvent(BpelEvent event) {
         // Note that the eventListeners list is a copy-on-write array, so need
         // to mess with synchronization.
-        for (org.apache.ode.bpel.iapi.BpelEventListener l : _contexts.eventListeners) {
-            l.onEvent(event);
+        
+    	for (org.apache.ode.bpel.iapi.BpelEventListener l : _contexts.eventListeners) {
+    		try {
+    			l.onEvent(event);
+    		} catch (Throwable t) {
+    			// catch all possible exceptions
+    			__log.warn("Got an exception while notifying BpelEventListener '" + l + "'.", t);
+    		}
         }
     }
 



Mime
View raw message