You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by va...@apache.org on 2008/05/23 01:26:18 UTC

svn commit: r659307 [8/24] - in /ode/trunk: axis2-war/src/main/webapp/WEB-INF/ axis2-war/src/main/webapp/WEB-INF/classes/ axis2-war/src/test/resources/XSDReferences/ axis2-war/src/test/resources/XSDReferences/BPMN/ axis2-war/src/test/resources/XSDRefer...

Modified: ode/trunk/bpel-ql/src/test/resources/main
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-ql/src/test/resources/main?rev=659307&r1=659306&r2=659307&view=diff
==============================================================================
--- ode/trunk/bpel-ql/src/test/resources/main (original)
+++ ode/trunk/bpel-ql/src/test/resources/main Thu May 22 16:25:57 2008
@@ -1,4 +1,4 @@
-
-limit 100
-order by field1 asc
+
+limit 100
+order by field1 asc
 order by last-active desc limit 1000
\ No newline at end of file

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ProcessAndInstanceManagementMBean.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ProcessAndInstanceManagementMBean.java?rev=659307&r1=659306&r2=659307&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ProcessAndInstanceManagementMBean.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ProcessAndInstanceManagementMBean.java Thu May 22 16:25:57 2008
@@ -1,156 +1,156 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.ode.bpel.engine;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-import javax.management.Attribute;
-import javax.management.AttributeList;
-import javax.management.AttributeNotFoundException;
-import javax.management.DynamicMBean;
-import javax.management.InvalidAttributeValueException;
-import javax.management.MBeanAttributeInfo;
-import javax.management.MBeanConstructorInfo;
-import javax.management.MBeanException;
-import javax.management.MBeanInfo;
-import javax.management.MBeanNotificationInfo;
-import javax.management.MBeanOperationInfo;
-import javax.management.ReflectionException;
-
-import org.apache.ode.bpel.iapi.BpelServer;
-import org.apache.ode.bpel.iapi.ProcessStore;
-
-
-/**
- * Standard MBean exposing ODE's process model and instance management API
- * 
- * @author Tammo van Lessen (University of Stuttgart)
- */
-public class ProcessAndInstanceManagementMBean implements DynamicMBean {
-
-	private MBeanInfo _mbeanInfo;
-	private ProcessAndInstanceManagementImpl _pm;
-	
-	private static final List<String> __excludes = new ArrayList<String>();
-		static {
-		__excludes.add("hashCode");
-		__excludes.add("equals");
-		__excludes.add("getClass");
-		__excludes.add("wait");
-		__excludes.add("notify");
-		__excludes.add("notifyAll");
-		__excludes.add("toString");
-	}
-	
-	private final static Hashtable<String, Class<?>> primitives = new Hashtable<String, Class<?>>();
-	static {
-		primitives.put(Boolean.TYPE.toString(), Boolean.TYPE);
-		primitives.put(Character.TYPE.toString(), Character.TYPE);
-		primitives.put(Byte.TYPE.toString(), Byte.TYPE);
-		primitives.put(Short.TYPE.toString(), Short.TYPE);
-		primitives.put(Integer.TYPE.toString(), Integer.TYPE);
-		primitives.put(Long.TYPE.toString(), Long.TYPE);
-		primitives.put(Float.TYPE.toString(), Float.TYPE);
-		primitives.put(Double.TYPE.toString(), Double.TYPE);
-	}
-	
-	public ProcessAndInstanceManagementMBean(BpelServer server, ProcessStore store) {
-		this(new ProcessAndInstanceManagementImpl(server, store));
-	}
-	
-	/**
-	 */
-	public ProcessAndInstanceManagementMBean(ProcessAndInstanceManagementImpl pm) {
-		_pm = pm;
-		List<MBeanOperationInfo> exposedOperations = new ArrayList<MBeanOperationInfo>();
-		for (Method m : pm.getClass().getMethods()) {
-			if (!__excludes.contains(m.getName())) {
-				exposedOperations.add(new MBeanOperationInfo(m.getName(), m));
-			}
-		}
-
-		MBeanAttributeInfo[] attributes = new MBeanAttributeInfo[] {};
-		MBeanConstructorInfo[] constructors = new MBeanConstructorInfo[] {};
-		MBeanOperationInfo[] operations = new MBeanOperationInfo[exposedOperations.size()];
-		operations = (MBeanOperationInfo[]) exposedOperations.toArray(operations);
-		MBeanNotificationInfo[] notifications = new MBeanNotificationInfo[] {};
-		
-		_mbeanInfo = new MBeanInfo(getClass().getName(), "Process and Instance Management", 
-				attributes, constructors, operations, notifications);
-	}
-	
-	public Object getAttribute(String attribute)
-			throws AttributeNotFoundException, MBeanException,
-			ReflectionException {
-		throw new UnsupportedOperationException();
-	}
-
-	public AttributeList getAttributes(String[] attributes) {
-		throw new UnsupportedOperationException();
-	}
-
-	public MBeanInfo getMBeanInfo() {
-		return _mbeanInfo;
-	}
-
-	public Object invoke(String actionName, Object[] params, String[] signature)
-			throws MBeanException, ReflectionException {
-		try {
-			Method m = _pm.getClass().getMethod(actionName, findTypes(_pm.getClass().getClassLoader(), signature));
-			if (m == null) {
-				throw new ReflectionException(new NoSuchMethodException(actionName));
-			}
-			return m.invoke(_pm, params);
-		} catch (Exception e) {
-			throw new ReflectionException(e);
-		}
-	}
-
-	private Class[] findTypes(ClassLoader loader, String[] signature) throws ReflectionException {
-		if (signature == null)
-			return null;
-		final Class[] result = new Class[signature.length];
-		try {
-			for (int i = 0; i < signature.length; i++) {
-				result[i] = primitives.get(signature[i]);
-				if (result[i] == null) {
-					result[i] = Class.forName(signature[i], false, loader);
-				}
-			}
-		} catch (ClassNotFoundException e) {
-			throw new ReflectionException(e);
-		}
-		return result;
-	}
-	
-	public void setAttribute(Attribute attribute)
-			throws AttributeNotFoundException, InvalidAttributeValueException,
-			MBeanException, ReflectionException {
-		throw new UnsupportedOperationException();
-		
-	}
-
-	public AttributeList setAttributes(AttributeList attributes) {
-		throw new UnsupportedOperationException();
-	}
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.engine;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+import javax.management.Attribute;
+import javax.management.AttributeList;
+import javax.management.AttributeNotFoundException;
+import javax.management.DynamicMBean;
+import javax.management.InvalidAttributeValueException;
+import javax.management.MBeanAttributeInfo;
+import javax.management.MBeanConstructorInfo;
+import javax.management.MBeanException;
+import javax.management.MBeanInfo;
+import javax.management.MBeanNotificationInfo;
+import javax.management.MBeanOperationInfo;
+import javax.management.ReflectionException;
+
+import org.apache.ode.bpel.iapi.BpelServer;
+import org.apache.ode.bpel.iapi.ProcessStore;
+
+
+/**
+ * Standard MBean exposing ODE's process model and instance management API
+ * 
+ * @author Tammo van Lessen (University of Stuttgart)
+ */
+public class ProcessAndInstanceManagementMBean implements DynamicMBean {
+
+	private MBeanInfo _mbeanInfo;
+	private ProcessAndInstanceManagementImpl _pm;
+	
+	private static final List<String> __excludes = new ArrayList<String>();
+		static {
+		__excludes.add("hashCode");
+		__excludes.add("equals");
+		__excludes.add("getClass");
+		__excludes.add("wait");
+		__excludes.add("notify");
+		__excludes.add("notifyAll");
+		__excludes.add("toString");
+	}
+	
+	private final static Hashtable<String, Class<?>> primitives = new Hashtable<String, Class<?>>();
+	static {
+		primitives.put(Boolean.TYPE.toString(), Boolean.TYPE);
+		primitives.put(Character.TYPE.toString(), Character.TYPE);
+		primitives.put(Byte.TYPE.toString(), Byte.TYPE);
+		primitives.put(Short.TYPE.toString(), Short.TYPE);
+		primitives.put(Integer.TYPE.toString(), Integer.TYPE);
+		primitives.put(Long.TYPE.toString(), Long.TYPE);
+		primitives.put(Float.TYPE.toString(), Float.TYPE);
+		primitives.put(Double.TYPE.toString(), Double.TYPE);
+	}
+	
+	public ProcessAndInstanceManagementMBean(BpelServer server, ProcessStore store) {
+		this(new ProcessAndInstanceManagementImpl(server, store));
+	}
+	
+	/**
+	 */
+	public ProcessAndInstanceManagementMBean(ProcessAndInstanceManagementImpl pm) {
+		_pm = pm;
+		List<MBeanOperationInfo> exposedOperations = new ArrayList<MBeanOperationInfo>();
+		for (Method m : pm.getClass().getMethods()) {
+			if (!__excludes.contains(m.getName())) {
+				exposedOperations.add(new MBeanOperationInfo(m.getName(), m));
+			}
+		}
+
+		MBeanAttributeInfo[] attributes = new MBeanAttributeInfo[] {};
+		MBeanConstructorInfo[] constructors = new MBeanConstructorInfo[] {};
+		MBeanOperationInfo[] operations = new MBeanOperationInfo[exposedOperations.size()];
+		operations = (MBeanOperationInfo[]) exposedOperations.toArray(operations);
+		MBeanNotificationInfo[] notifications = new MBeanNotificationInfo[] {};
+		
+		_mbeanInfo = new MBeanInfo(getClass().getName(), "Process and Instance Management", 
+				attributes, constructors, operations, notifications);
+	}
+	
+	public Object getAttribute(String attribute)
+			throws AttributeNotFoundException, MBeanException,
+			ReflectionException {
+		throw new UnsupportedOperationException();
+	}
+
+	public AttributeList getAttributes(String[] attributes) {
+		throw new UnsupportedOperationException();
+	}
+
+	public MBeanInfo getMBeanInfo() {
+		return _mbeanInfo;
+	}
+
+	public Object invoke(String actionName, Object[] params, String[] signature)
+			throws MBeanException, ReflectionException {
+		try {
+			Method m = _pm.getClass().getMethod(actionName, findTypes(_pm.getClass().getClassLoader(), signature));
+			if (m == null) {
+				throw new ReflectionException(new NoSuchMethodException(actionName));
+			}
+			return m.invoke(_pm, params);
+		} catch (Exception e) {
+			throw new ReflectionException(e);
+		}
+	}
+
+	private Class[] findTypes(ClassLoader loader, String[] signature) throws ReflectionException {
+		if (signature == null)
+			return null;
+		final Class[] result = new Class[signature.length];
+		try {
+			for (int i = 0; i < signature.length; i++) {
+				result[i] = primitives.get(signature[i]);
+				if (result[i] == null) {
+					result[i] = Class.forName(signature[i], false, loader);
+				}
+			}
+		} catch (ClassNotFoundException e) {
+			throw new ReflectionException(e);
+		}
+		return result;
+	}
+	
+	public void setAttribute(Attribute attribute)
+			throws AttributeNotFoundException, InvalidAttributeValueException,
+			MBeanException, ReflectionException {
+		throw new UnsupportedOperationException();
+		
+	}
+
+	public AttributeList setAttributes(AttributeList attributes) {
+		throw new UnsupportedOperationException();
+	}
+
+}

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/evtproc/DebugBpelEventListener.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/evtproc/DebugBpelEventListener.java?rev=659307&r1=659306&r2=659307&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/evtproc/DebugBpelEventListener.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/evtproc/DebugBpelEventListener.java Thu May 22 16:25:57 2008
@@ -1,65 +1,65 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.ode.bpel.evtproc;
-
-import java.util.Properties;
-
-import org.apache.commons.lang.BooleanUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.ode.bpel.evt.BpelEvent;
-import org.apache.ode.bpel.iapi.BpelEventListener;
-
-/**
- * Example implementation of the {@link BpelEventListener} interface.
- * 
- * Dumps navigation events to a logging appender and optionally to stdout.
- * To use the DebugBpelEventListener add the following lines to your 
- * ode-xxx.properties file:
- * <code>
- * ode-jbi.event.listeners=org.apache.ode.bpel.common.evt.DebugBpelEventListener
- * debugeventlistener.dumpToStdOut=on/off
- * </code>
- * 
- * @author Tammo van Lessen (University of Stuttgart)
- */
-public class DebugBpelEventListener implements BpelEventListener {
-	private static final Log __log = LogFactory.getLog(BpelEventListener.class);
-
-	private static final String SYSOUT_KEY = "debugeventlistener.dumpToStdOut";
-	private boolean _dumpToStdOut = false;
-	
-	public void onEvent(BpelEvent bpelEvent) {
-		if (__log.isDebugEnabled()) {
-			__log.debug(bpelEvent.toString());
-		}
-	
-		if (_dumpToStdOut) {
-			System.out.println(bpelEvent.toString());
-		}
-	}
-
-	public void startup(Properties configProperties) {
-		if (configProperties != null) {
-			_dumpToStdOut = BooleanUtils.toBoolean(configProperties.getProperty(SYSOUT_KEY, "false"));
-		}
-	}
-
-	public void shutdown() {}
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.evtproc;
+
+import java.util.Properties;
+
+import org.apache.commons.lang.BooleanUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.bpel.evt.BpelEvent;
+import org.apache.ode.bpel.iapi.BpelEventListener;
+
+/**
+ * Example implementation of the {@link BpelEventListener} interface.
+ * 
+ * Dumps navigation events to a logging appender and optionally to stdout.
+ * To use the DebugBpelEventListener add the following lines to your 
+ * ode-xxx.properties file:
+ * <code>
+ * ode-jbi.event.listeners=org.apache.ode.bpel.common.evt.DebugBpelEventListener
+ * debugeventlistener.dumpToStdOut=on/off
+ * </code>
+ * 
+ * @author Tammo van Lessen (University of Stuttgart)
+ */
+public class DebugBpelEventListener implements BpelEventListener {
+	private static final Log __log = LogFactory.getLog(BpelEventListener.class);
+
+	private static final String SYSOUT_KEY = "debugeventlistener.dumpToStdOut";
+	private boolean _dumpToStdOut = false;
+	
+	public void onEvent(BpelEvent bpelEvent) {
+		if (__log.isDebugEnabled()) {
+			__log.debug(bpelEvent.toString());
+		}
+	
+		if (_dumpToStdOut) {
+			System.out.println(bpelEvent.toString());
+		}
+	}
+
+	public void startup(Properties configProperties) {
+		if (configProperties != null) {
+			_dumpToStdOut = BooleanUtils.toBoolean(configProperties.getProperty(SYSOUT_KEY, "false"));
+		}
+	}
+
+	public void shutdown() {}
+}

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EXTENSIONACTIVITY.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EXTENSIONACTIVITY.java?rev=659307&r1=659306&r2=659307&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EXTENSIONACTIVITY.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EXTENSIONACTIVITY.java Thu May 22 16:25:57 2008
@@ -1,74 +1,74 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.ode.bpel.runtime;
-
-import javax.xml.namespace.QName;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.ode.bpel.common.FaultException;
-import org.apache.ode.bpel.compiler.bom.ExtensibilityQNames;
-import org.apache.ode.bpel.o.OExtensionActivity;
-import org.apache.ode.bpel.runtime.extension.ExtensionContext;
-import org.apache.ode.bpel.runtime.extension.ExtensionOperation;
-import org.apache.ode.utils.DOMUtils;
-
-/**
- * JacobRunnable that delegates the work of the <code>extensionActivity</code> activity
- * to a registered extension implementation.
- * 
- * @author Tammo van Lessen (University of Stuttgart)
- */
-public class EXTENSIONACTIVITY extends ACTIVITY {
-	private static final long serialVersionUID = 1L;
-	private static final Log __log = LogFactory.getLog(EXTENSIONACTIVITY.class);
-
-    private OExtensionActivity _oext;
-    
-	public EXTENSIONACTIVITY(ActivityInfo self, ScopeFrame scopeFrame,
-			LinkFrame linkFrame) {
-        super(self, scopeFrame, linkFrame);
-        _oext = (OExtensionActivity) _self.o;
-	}
-
-    public final void run() {
-    	final ExtensionContext context = new ExtensionContextImpl(_self, _scopeFrame, getBpelRuntimeContext());
-    	final QName extensionId = DOMUtils.getElementQName(_oext.nestedElement.getElement());
-    	try {
-    		ExtensionOperation ea = getBpelRuntimeContext().createExtensionActivityImplementation(extensionId);
-    		if (ea == null) {
-    			if (_oext.getOwner().mustUnderstandExtensions.contains(extensionId.getNamespaceURI())) {
-    				__log.warn("Lookup of extension activity " + extensionId + " failed.");
-    				throw new FaultException(ExtensibilityQNames.UNKNOWN_EA_FAULT_NAME, "Lookup of extension activity " + extensionId + " failed. No implementation found.");
-    			} else {
-    				// act like <empty> - do nothing
-    				context.complete();
-    				return;
-    			}
-    		}
-
-    		ea.run(context, _oext.nestedElement.getElement());
-		} catch (FaultException fault) {
-            __log.error(fault);
-            context.completeWithFault(fault);
-		}
-
-    }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.runtime;
+
+import javax.xml.namespace.QName;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.bpel.common.FaultException;
+import org.apache.ode.bpel.compiler.bom.ExtensibilityQNames;
+import org.apache.ode.bpel.o.OExtensionActivity;
+import org.apache.ode.bpel.runtime.extension.ExtensionContext;
+import org.apache.ode.bpel.runtime.extension.ExtensionOperation;
+import org.apache.ode.utils.DOMUtils;
+
+/**
+ * JacobRunnable that delegates the work of the <code>extensionActivity</code> activity
+ * to a registered extension implementation.
+ * 
+ * @author Tammo van Lessen (University of Stuttgart)
+ */
+public class EXTENSIONACTIVITY extends ACTIVITY {
+	private static final long serialVersionUID = 1L;
+	private static final Log __log = LogFactory.getLog(EXTENSIONACTIVITY.class);
+
+    private OExtensionActivity _oext;
+    
+	public EXTENSIONACTIVITY(ActivityInfo self, ScopeFrame scopeFrame,
+			LinkFrame linkFrame) {
+        super(self, scopeFrame, linkFrame);
+        _oext = (OExtensionActivity) _self.o;
+	}
+
+    public final void run() {
+    	final ExtensionContext context = new ExtensionContextImpl(_self, _scopeFrame, getBpelRuntimeContext());
+    	final QName extensionId = DOMUtils.getElementQName(_oext.nestedElement.getElement());
+    	try {
+    		ExtensionOperation ea = getBpelRuntimeContext().createExtensionActivityImplementation(extensionId);
+    		if (ea == null) {
+    			if (_oext.getOwner().mustUnderstandExtensions.contains(extensionId.getNamespaceURI())) {
+    				__log.warn("Lookup of extension activity " + extensionId + " failed.");
+    				throw new FaultException(ExtensibilityQNames.UNKNOWN_EA_FAULT_NAME, "Lookup of extension activity " + extensionId + " failed. No implementation found.");
+    			} else {
+    				// act like <empty> - do nothing
+    				context.complete();
+    				return;
+    			}
+    		}
+
+    		ea.run(context, _oext.nestedElement.getElement());
+		} catch (FaultException fault) {
+            __log.error(fault);
+            context.completeWithFault(fault);
+		}
+
+    }
+
+}

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ExtensionContextImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ExtensionContextImpl.java?rev=659307&r1=659306&r2=659307&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ExtensionContextImpl.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ExtensionContextImpl.java Thu May 22 16:25:57 2008
@@ -1,177 +1,177 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.ode.bpel.runtime;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.ode.bpel.common.FaultException;
-import org.apache.ode.bpel.compiler.bom.Bpel20QNames;
-import org.apache.ode.bpel.evt.ScopeEvent;
-import org.apache.ode.bpel.evt.VariableModificationEvent;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OProcess.OProperty;
-import org.apache.ode.bpel.o.OScope.Variable;
-import org.apache.ode.bpel.runtime.channels.FaultData;
-import org.apache.ode.bpel.runtime.extension.ExtensionContext;
-import org.apche.ode.bpel.evar.ExternalVariableModuleException;
-import org.w3c.dom.Node;
-
-
-/**
- * @author Tammo van Lessen (University of Stuttgart)
- */
-public class ExtensionContextImpl implements ExtensionContext {
-	private static final Log __log = LogFactory.getLog(ExtensionContextImpl.class);
-	
-	private BpelRuntimeContext _context;
-	private ScopeFrame _scopeFrame;
-	private ActivityInfo _activityInfo;
-	
-	private boolean hasCompleted = false;
-
-	public ExtensionContextImpl(ActivityInfo activityInfo, ScopeFrame scopeFrame, BpelRuntimeContext context) {
-		_activityInfo = activityInfo;
-		_context = context;
-		_scopeFrame = scopeFrame;
-	}
-	
-	public Long getProcessId() {
-		return _context.getPid();
-	}
-
-	public Map<String, Variable> getVisibleVariables() throws FaultException {
-		Map<String, Variable> visVars = new HashMap<String, Variable>();
-		
-        OActivity current = _scopeFrame.oscope;
-        while (current != null) {
-            if (current instanceof OScope) {
-                for (String varName : ((OScope)current).variables.keySet()) {
-                	if (!visVars.containsKey(varName)) {
-                		visVars.put(varName, ((OScope)current).variables.get(varName));
-                	}
-                }
-            }
-            current = current.getParent();
-        }
-		
-		return visVars;
-	}
-
-	public String readMessageProperty(Variable variable, OProperty property)
-			throws FaultException {
-		VariableInstance vi = _scopeFrame.resolve(variable);
-		return _context.readProperty(vi, property);
-	}
-
-	public Node readVariable(Variable variable)
-			throws FaultException {
-		VariableInstance vi = _scopeFrame.resolve(variable);
-		return _scopeFrame.fetchVariableData(_context, vi, true);
-	}
-
-	public void writeVariable(String variableName, Node value)
-			throws FaultException, ExternalVariableModuleException {
-		VariableInstance vi = _scopeFrame.resolve(getVisibleVariable(variableName));
-		_scopeFrame.commitChanges(_context, vi, value);
-	}
-
-	public Node readVariable(String variableName) throws FaultException {
-		VariableInstance vi = _scopeFrame.resolve(getVisibleVariable(variableName));
-		return _scopeFrame.fetchVariableData(_context, vi, true);
-	}
-
-	public void writeVariable(Variable variable, Node value)
-			throws FaultException, ExternalVariableModuleException {
-		VariableInstance vi = _scopeFrame.resolve(variable);
-		_scopeFrame.commitChanges(_context, vi, value);
-        VariableModificationEvent vme = new VariableModificationEvent(variable.name);
-        vme.setNewValue(value);
-        sendEvent(vme);
-	}
-
-	private Variable getVisibleVariable(String varName) {
-    	return _scopeFrame.oscope.getVisibleVariable(varName);
-    }
-
-	public String getActivityName() {
-		return _activityInfo.o.name;
-	}
-
-	public OActivity getOActivity() {
-		return _activityInfo.o;
-	}
-
-	public BpelRuntimeContext getBpelRuntimeContext() {
-		return _context;
-	}
-	
-	public void sendEvent(ScopeEvent event) {
-        if (event.getLineNo() == -1 && _activityInfo.o.debugInfo != null) {
-        	event.setLineNo(_activityInfo.o.debugInfo.startLine);
-        }
-        _scopeFrame.fillEventInfo(event);
-        getBpelRuntimeContext().sendEvent(event);
-	}
-	
-	public void complete() {
-		if (!hasCompleted) {
-			_activityInfo.parent.completed(null, CompensationHandler.emptySet());
-			hasCompleted = true;
-		} else {
-			if (__log.isWarnEnabled()) {
-				__log.warn("Activity '" + _activityInfo.o.name + "' has already been completed.");
-			}
-		}
-	}
-	
-	public void completeWithFault(Throwable t) {
-		if (!hasCompleted) {
-			StringWriter sw = new StringWriter();
-			t.printStackTrace(new PrintWriter(sw));
-			FaultData fault = new FaultData(new QName(Bpel20QNames.NS_WSBPEL2_0, "subLanguageExecutionFault"), _activityInfo.o, sw.getBuffer().toString());
-	        _activityInfo.parent.completed(fault, CompensationHandler.emptySet());
-			hasCompleted = true;
-		} else {
-			if (__log.isWarnEnabled()) {
-				__log.warn("Activity '" + _activityInfo.o.name + "' has already been completed.");
-			}
-		}
-	}
-	
-	public void completeWithFault(FaultException ex) {
-		if (!hasCompleted) {
-			FaultData fault = new FaultData(ex.getQName(), _activityInfo.o, ex.getMessage());
-			_activityInfo.parent.completed(fault, CompensationHandler.emptySet());
-			hasCompleted = true;
-		} else {
-			if (__log.isWarnEnabled()) {
-				__log.warn("Activity '" + _activityInfo.o.name + "' has already been completed.");
-			}
-		}
-
-	}
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.runtime;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.bpel.common.FaultException;
+import org.apache.ode.bpel.compiler.bom.Bpel20QNames;
+import org.apache.ode.bpel.evt.ScopeEvent;
+import org.apache.ode.bpel.evt.VariableModificationEvent;
+import org.apache.ode.bpel.o.OActivity;
+import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.o.OProcess.OProperty;
+import org.apache.ode.bpel.o.OScope.Variable;
+import org.apache.ode.bpel.runtime.channels.FaultData;
+import org.apache.ode.bpel.runtime.extension.ExtensionContext;
+import org.apche.ode.bpel.evar.ExternalVariableModuleException;
+import org.w3c.dom.Node;
+
+
+/**
+ * @author Tammo van Lessen (University of Stuttgart)
+ */
+public class ExtensionContextImpl implements ExtensionContext {
+	private static final Log __log = LogFactory.getLog(ExtensionContextImpl.class);
+	
+	private BpelRuntimeContext _context;
+	private ScopeFrame _scopeFrame;
+	private ActivityInfo _activityInfo;
+	
+	private boolean hasCompleted = false;
+
+	public ExtensionContextImpl(ActivityInfo activityInfo, ScopeFrame scopeFrame, BpelRuntimeContext context) {
+		_activityInfo = activityInfo;
+		_context = context;
+		_scopeFrame = scopeFrame;
+	}
+	
+	public Long getProcessId() {
+		return _context.getPid();
+	}
+
+	public Map<String, Variable> getVisibleVariables() throws FaultException {
+		Map<String, Variable> visVars = new HashMap<String, Variable>();
+		
+        OActivity current = _scopeFrame.oscope;
+        while (current != null) {
+            if (current instanceof OScope) {
+                for (String varName : ((OScope)current).variables.keySet()) {
+                	if (!visVars.containsKey(varName)) {
+                		visVars.put(varName, ((OScope)current).variables.get(varName));
+                	}
+                }
+            }
+            current = current.getParent();
+        }
+		
+		return visVars;
+	}
+
+	public String readMessageProperty(Variable variable, OProperty property)
+			throws FaultException {
+		VariableInstance vi = _scopeFrame.resolve(variable);
+		return _context.readProperty(vi, property);
+	}
+
+	public Node readVariable(Variable variable)
+			throws FaultException {
+		VariableInstance vi = _scopeFrame.resolve(variable);
+		return _scopeFrame.fetchVariableData(_context, vi, true);
+	}
+
+	public void writeVariable(String variableName, Node value)
+			throws FaultException, ExternalVariableModuleException {
+		VariableInstance vi = _scopeFrame.resolve(getVisibleVariable(variableName));
+		_scopeFrame.commitChanges(_context, vi, value);
+	}
+
+	public Node readVariable(String variableName) throws FaultException {
+		VariableInstance vi = _scopeFrame.resolve(getVisibleVariable(variableName));
+		return _scopeFrame.fetchVariableData(_context, vi, true);
+	}
+
+	public void writeVariable(Variable variable, Node value)
+			throws FaultException, ExternalVariableModuleException {
+		VariableInstance vi = _scopeFrame.resolve(variable);
+		_scopeFrame.commitChanges(_context, vi, value);
+        VariableModificationEvent vme = new VariableModificationEvent(variable.name);
+        vme.setNewValue(value);
+        sendEvent(vme);
+	}
+
+	private Variable getVisibleVariable(String varName) {
+    	return _scopeFrame.oscope.getVisibleVariable(varName);
+    }
+
+	public String getActivityName() {
+		return _activityInfo.o.name;
+	}
+
+	public OActivity getOActivity() {
+		return _activityInfo.o;
+	}
+
+	public BpelRuntimeContext getBpelRuntimeContext() {
+		return _context;
+	}
+	
+	public void sendEvent(ScopeEvent event) {
+        if (event.getLineNo() == -1 && _activityInfo.o.debugInfo != null) {
+        	event.setLineNo(_activityInfo.o.debugInfo.startLine);
+        }
+        _scopeFrame.fillEventInfo(event);
+        getBpelRuntimeContext().sendEvent(event);
+	}
+	
+	public void complete() {
+		if (!hasCompleted) {
+			_activityInfo.parent.completed(null, CompensationHandler.emptySet());
+			hasCompleted = true;
+		} else {
+			if (__log.isWarnEnabled()) {
+				__log.warn("Activity '" + _activityInfo.o.name + "' has already been completed.");
+			}
+		}
+	}
+	
+	public void completeWithFault(Throwable t) {
+		if (!hasCompleted) {
+			StringWriter sw = new StringWriter();
+			t.printStackTrace(new PrintWriter(sw));
+			FaultData fault = new FaultData(new QName(Bpel20QNames.NS_WSBPEL2_0, "subLanguageExecutionFault"), _activityInfo.o, sw.getBuffer().toString());
+	        _activityInfo.parent.completed(fault, CompensationHandler.emptySet());
+			hasCompleted = true;
+		} else {
+			if (__log.isWarnEnabled()) {
+				__log.warn("Activity '" + _activityInfo.o.name + "' has already been completed.");
+			}
+		}
+	}
+	
+	public void completeWithFault(FaultException ex) {
+		if (!hasCompleted) {
+			FaultData fault = new FaultData(ex.getQName(), _activityInfo.o, ex.getMessage());
+			_activityInfo.parent.completed(fault, CompensationHandler.emptySet());
+			hasCompleted = true;
+		} else {
+			if (__log.isWarnEnabled()) {
+				__log.warn("Activity '" + _activityInfo.o.name + "' has already been completed.");
+			}
+		}
+
+	}
+}

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/extension/AbstractAsyncExtensionOperation.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/extension/AbstractAsyncExtensionOperation.java?rev=659307&r1=659306&r2=659307&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/extension/AbstractAsyncExtensionOperation.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/extension/AbstractAsyncExtensionOperation.java Thu May 22 16:25:57 2008
@@ -1,43 +1,43 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.ode.bpel.runtime.extension;
-
-import org.apache.ode.bpel.common.FaultException;
-import org.apache.ode.bpel.compiler.api.CompilationException;
-import org.apache.ode.bpel.compiler.api.CompilerContext;
-import org.apache.ode.bpel.compiler.api.ExtensionValidator;
-import org.apache.ode.bpel.compiler.bom.ExtensibleElement;
-import org.w3c.dom.Element;
-
-/**
- * Base class for creating new asynchronous extension implementations.
- * 
- * @author Tammo van Lessen (University of Stuttgart)
- */
-public abstract class AbstractAsyncExtensionOperation implements ExtensionValidator,
-															ExtensionOperation {
-
-	public void validate(CompilerContext context, ExtensibleElement element) throws CompilationException {
-		// default behavior: pass
-	}
-
-	public abstract void run(ExtensionContext context, Element element)
-			throws FaultException;
-	
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.runtime.extension;
+
+import org.apache.ode.bpel.common.FaultException;
+import org.apache.ode.bpel.compiler.api.CompilationException;
+import org.apache.ode.bpel.compiler.api.CompilerContext;
+import org.apache.ode.bpel.compiler.api.ExtensionValidator;
+import org.apache.ode.bpel.compiler.bom.ExtensibleElement;
+import org.w3c.dom.Element;
+
+/**
+ * Base class for creating new asynchronous extension implementations.
+ * 
+ * @author Tammo van Lessen (University of Stuttgart)
+ */
+public abstract class AbstractAsyncExtensionOperation implements ExtensionValidator,
+															ExtensionOperation {
+
+	public void validate(CompilerContext context, ExtensibleElement element) throws CompilationException {
+		// default behavior: pass
+	}
+
+	public abstract void run(ExtensionContext context, Element element)
+			throws FaultException;
+	
+}

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/extension/AbstractExtensionBundle.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/extension/AbstractExtensionBundle.java?rev=659307&r1=659306&r2=659307&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/extension/AbstractExtensionBundle.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/extension/AbstractExtensionBundle.java Thu May 22 16:25:57 2008
@@ -1,92 +1,92 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.ode.bpel.runtime.extension;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.ode.bpel.compiler.api.ExtensionValidator;
-
-/**
-* Abstract class that bundles and registers <code>&lt;extensionActivity&gt;</code> and
-* <code>&lt;extensionAssignOperation&gt;</code> implementations related to a particular namespace.
-*  
-* @author Tammo van Lessen (University of Stuttgart)
-*/
-public abstract class AbstractExtensionBundle {
-	private static Log __log = LogFactory.getLog(AbstractExtensionBundle.class);
-	private Map<String, Class<? extends ExtensionOperation>> extensionsByName = new HashMap<String, Class<? extends ExtensionOperation>>();
-
-	/**
-	 * Returns the extension namespace this bundle provides implementations for.
-	 * @return
-	 */
-	public abstract String getNamespaceURI();
-	
-	/**
-	 * Register extension operations.
-	 */
-	public abstract void registerExtensionActivities();
-
-	/**
-	 * Register an {@link ExtensionOperation} implementation as <code>&lt;extensionActivity&gt;</code>.
-	 *
-	 * @param localName
-	 * @param activity
-	 */
-	protected final void registerExtensionOperation(String localName, Class<? extends ExtensionOperation> operation) {
-		extensionsByName.put(localName, operation);
-	}
-	
-	/**
-	 * Returns a list of the local names of registered extension operations.
-	 */
-	public final Set<String> getExtensionOperationNames() {
-		return Collections.unmodifiableSet(extensionsByName.keySet());
-	}
-
-	public final Class<? extends ExtensionOperation> getExtensionOperationClass(String localName) {
-		return extensionsByName.get(localName);
-	}
-
-	public final ExtensionOperation getExtensionOperationInstance(String localName) throws InstantiationException, IllegalAccessException {
-		return getExtensionOperationClass(localName).newInstance();
-	}
-
-	public final Map<QName, ExtensionValidator> getExtensionValidators() {
-		Map<QName, ExtensionValidator> result = new HashMap<QName, ExtensionValidator>();
-		String ns = getNamespaceURI();
-		for (String localName : extensionsByName.keySet()) {
-			if (ExtensionValidator.class.isAssignableFrom(extensionsByName.get(localName))) {
-				try {
-					result.put(new QName(ns, localName), (ExtensionValidator)getExtensionOperationInstance(localName));
-				} catch (Exception e) {
-					__log.warn("Could not instantiate extension validator for '{" + ns + "}" + localName);
-				}
-			}
-		}
-		return result;
-	}
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.runtime.extension;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.bpel.compiler.api.ExtensionValidator;
+
+/**
+* Abstract class that bundles and registers <code>&lt;extensionActivity&gt;</code> and
+* <code>&lt;extensionAssignOperation&gt;</code> implementations related to a particular namespace.
+*  
+* @author Tammo van Lessen (University of Stuttgart)
+*/
+public abstract class AbstractExtensionBundle {
+	private static Log __log = LogFactory.getLog(AbstractExtensionBundle.class);
+	private Map<String, Class<? extends ExtensionOperation>> extensionsByName = new HashMap<String, Class<? extends ExtensionOperation>>();
+
+	/**
+	 * Returns the extension namespace this bundle provides implementations for.
+	 * @return
+	 */
+	public abstract String getNamespaceURI();
+	
+	/**
+	 * Register extension operations.
+	 */
+	public abstract void registerExtensionActivities();
+
+	/**
+	 * Register an {@link ExtensionOperation} implementation as <code>&lt;extensionActivity&gt;</code>.
+	 *
+	 * @param localName
+	 * @param activity
+	 */
+	protected final void registerExtensionOperation(String localName, Class<? extends ExtensionOperation> operation) {
+		extensionsByName.put(localName, operation);
+	}
+	
+	/**
+	 * Returns a list of the local names of registered extension operations.
+	 */
+	public final Set<String> getExtensionOperationNames() {
+		return Collections.unmodifiableSet(extensionsByName.keySet());
+	}
+
+	public final Class<? extends ExtensionOperation> getExtensionOperationClass(String localName) {
+		return extensionsByName.get(localName);
+	}
+
+	public final ExtensionOperation getExtensionOperationInstance(String localName) throws InstantiationException, IllegalAccessException {
+		return getExtensionOperationClass(localName).newInstance();
+	}
+
+	public final Map<QName, ExtensionValidator> getExtensionValidators() {
+		Map<QName, ExtensionValidator> result = new HashMap<QName, ExtensionValidator>();
+		String ns = getNamespaceURI();
+		for (String localName : extensionsByName.keySet()) {
+			if (ExtensionValidator.class.isAssignableFrom(extensionsByName.get(localName))) {
+				try {
+					result.put(new QName(ns, localName), (ExtensionValidator)getExtensionOperationInstance(localName));
+				} catch (Exception e) {
+					__log.warn("Could not instantiate extension validator for '{" + ns + "}" + localName);
+				}
+			}
+		}
+		return result;
+	}
+}

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/extension/AbstractSyncExtensionOperation.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/extension/AbstractSyncExtensionOperation.java?rev=659307&r1=659306&r2=659307&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/extension/AbstractSyncExtensionOperation.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/extension/AbstractSyncExtensionOperation.java Thu May 22 16:25:57 2008
@@ -1,53 +1,53 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.ode.bpel.runtime.extension;
-
-import org.apache.ode.bpel.common.FaultException;
-import org.apache.ode.bpel.compiler.api.CompilationException;
-import org.apache.ode.bpel.compiler.api.CompilerContext;
-import org.apache.ode.bpel.compiler.api.ExtensionValidator;
-import org.apache.ode.bpel.compiler.bom.ExtensibleElement;
-import org.w3c.dom.Element;
-
-/**
- * Base class for creating new extension implementations.
- * 
- * @author Tammo van Lessen (University of Stuttgart)
- */
-public abstract class AbstractSyncExtensionOperation implements ExtensionValidator,
-															ExtensionOperation {
-
-	public void validate(CompilerContext context, ExtensibleElement element) throws CompilationException {
-		// default behavior: pass
-	}
-
-	protected abstract void runSync(ExtensionContext context, Element element) throws FaultException;
-	
-	public void run(ExtensionContext context, Element element)
-			throws FaultException {
-		try {
-			runSync(context, element);
-			context.complete();
-		} catch (FaultException f) {
-			context.completeWithFault(f);
-		} catch (Exception e) {
-			context.completeWithFault(e);
-		}
-	}
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.runtime.extension;
+
+import org.apache.ode.bpel.common.FaultException;
+import org.apache.ode.bpel.compiler.api.CompilationException;
+import org.apache.ode.bpel.compiler.api.CompilerContext;
+import org.apache.ode.bpel.compiler.api.ExtensionValidator;
+import org.apache.ode.bpel.compiler.bom.ExtensibleElement;
+import org.w3c.dom.Element;
+
+/**
+ * Base class for creating new extension implementations.
+ * 
+ * @author Tammo van Lessen (University of Stuttgart)
+ */
+public abstract class AbstractSyncExtensionOperation implements ExtensionValidator,
+															ExtensionOperation {
+
+	public void validate(CompilerContext context, ExtensibleElement element) throws CompilationException {
+		// default behavior: pass
+	}
+
+	protected abstract void runSync(ExtensionContext context, Element element) throws FaultException;
+	
+	public void run(ExtensionContext context, Element element)
+			throws FaultException {
+		try {
+			runSync(context, element);
+			context.complete();
+		} catch (FaultException f) {
+			context.completeWithFault(f);
+		} catch (Exception e) {
+			context.completeWithFault(e);
+		}
+	}
+}

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/extension/ExtensionContext.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/extension/ExtensionContext.java?rev=659307&r1=659306&r2=659307&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/extension/ExtensionContext.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/extension/ExtensionContext.java Thu May 22 16:25:57 2008
@@ -1,131 +1,131 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.ode.bpel.runtime.extension;
-
-import java.util.Map;
-
-import org.apache.ode.bpel.common.FaultException;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OLink;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.runtime.BpelRuntimeContext;
-import org.apche.ode.bpel.evar.ExternalVariableModuleException;
-import org.w3c.dom.Node;
-
-
-/**
- * Context for executing extension activities or extension assign operations. 
- * Implementations of the {@link ExtensionOperation} class use this interface to access BPEL
- * variables, property sets and link status.
- * 
- * @author Tammo van Lessen (University of Stuttgart)
- */
-public interface ExtensionContext {
-
-	/**
-	 * Returns a list of variables visible in the current scope.
-	 * 
-	 * @return an unmodifiable list of visible variables.
-	 * @throws FaultException
-	 */
-	Map<String, OScope.Variable> getVisibleVariables() throws FaultException;
-	
-	/**
-     * Read the value of a BPEL variable.
-     *
-     * @param variable
-     *          variable to read
-     * @param part
-     *          the part (or <code>null</code>)
-     * @return the value of the variable, wrapped in a <code>Node</code>
-     */
-    Node readVariable(OScope.Variable variable) throws FaultException;
-    
-	/**
-     * Read the value of a BPEL variable.
-     *
-     * @param variableName
-     *          variable to read
-     * @param part
-     *          the part (or <code>null</code>)
-     * @return the value of the variable, wrapped in a <code>Node</code>
-     */
-    Node readVariable(String variableName) throws FaultException;
-
-    /**
-     * Write the value into a BPEL variable.
-     *
-     * @param variable
-     *          variable to write
-     * @param value
-     *          the value to be stored into the variable
-     * @return the value of the variable, wrapped in a <code>Node</code>
-     */
-    void writeVariable(OScope.Variable variable, Node value) throws FaultException, ExternalVariableModuleException;
-
-    /**
-     * Write the value into a BPEL variable.
-     *
-     * @param variableName
-     *          variable to write
-     * @param value
-     *          the value to be stored into the variable
-     * @return the value of the variable, wrapped in a <code>Node</code>
-     */
-    void writeVariable(String variableName, Node value) throws FaultException, ExternalVariableModuleException;
-
-    /**
-     * Read the value of a BPEL property.
-     *
-     * @param variable
-     *          variable containing property
-     * @param property
-     *          property to read
-     * @return value of the property
-     */
-    String readMessageProperty(OScope.Variable variable, OProcess.OProperty property)
-            throws FaultException;
-    
-    /**
-     * Reads the current process instance id.
-     * @return instance id
-     */
-    Long getProcessId();
-    
-    /**
-     * Returns the name of the invoking activity.
-     * @return activity name
-     */
-    String getActivityName();
-    
-    /**
-     * Low-level-method
-     */
-    OActivity getOActivity();
-    
-    BpelRuntimeContext getBpelRuntimeContext();
-    
-   
-    //ScopeFrame getScopeFrame();
-    void complete();
-    
-    void completeWithFault(Throwable t);
-    void completeWithFault(FaultException fault);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.runtime.extension;
+
+import java.util.Map;
+
+import org.apache.ode.bpel.common.FaultException;
+import org.apache.ode.bpel.o.OActivity;
+import org.apache.ode.bpel.o.OLink;
+import org.apache.ode.bpel.o.OProcess;
+import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.runtime.BpelRuntimeContext;
+import org.apche.ode.bpel.evar.ExternalVariableModuleException;
+import org.w3c.dom.Node;
+
+
+/**
+ * Context for executing extension activities or extension assign operations. 
+ * Implementations of the {@link ExtensionOperation} class use this interface to access BPEL
+ * variables, property sets and link status.
+ * 
+ * @author Tammo van Lessen (University of Stuttgart)
+ */
+public interface ExtensionContext {
+
+	/**
+	 * Returns a list of variables visible in the current scope.
+	 * 
+	 * @return an unmodifiable list of visible variables.
+	 * @throws FaultException
+	 */
+	Map<String, OScope.Variable> getVisibleVariables() throws FaultException;
+	
+	/**
+     * Read the value of a BPEL variable.
+     *
+     * @param variable
+     *          variable to read
+     * @param part
+     *          the part (or <code>null</code>)
+     * @return the value of the variable, wrapped in a <code>Node</code>
+     */
+    Node readVariable(OScope.Variable variable) throws FaultException;
+    
+	/**
+     * Read the value of a BPEL variable.
+     *
+     * @param variableName
+     *          variable to read
+     * @param part
+     *          the part (or <code>null</code>)
+     * @return the value of the variable, wrapped in a <code>Node</code>
+     */
+    Node readVariable(String variableName) throws FaultException;
+
+    /**
+     * Write the value into a BPEL variable.
+     *
+     * @param variable
+     *          variable to write
+     * @param value
+     *          the value to be stored into the variable
+     * @return the value of the variable, wrapped in a <code>Node</code>
+     */
+    void writeVariable(OScope.Variable variable, Node value) throws FaultException, ExternalVariableModuleException;
+
+    /**
+     * Write the value into a BPEL variable.
+     *
+     * @param variableName
+     *          variable to write
+     * @param value
+     *          the value to be stored into the variable
+     * @return the value of the variable, wrapped in a <code>Node</code>
+     */
+    void writeVariable(String variableName, Node value) throws FaultException, ExternalVariableModuleException;
+
+    /**
+     * Read the value of a BPEL property.
+     *
+     * @param variable
+     *          variable containing property
+     * @param property
+     *          property to read
+     * @return value of the property
+     */
+    String readMessageProperty(OScope.Variable variable, OProcess.OProperty property)
+            throws FaultException;
+    
+    /**
+     * Reads the current process instance id.
+     * @return instance id
+     */
+    Long getProcessId();
+    
+    /**
+     * Returns the name of the invoking activity.
+     * @return activity name
+     */
+    String getActivityName();
+    
+    /**
+     * Low-level-method
+     */
+    OActivity getOActivity();
+    
+    BpelRuntimeContext getBpelRuntimeContext();
+    
+   
+    //ScopeFrame getScopeFrame();
+    void complete();
+    
+    void completeWithFault(Throwable t);
+    void completeWithFault(FaultException fault);
+}

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/extension/ExtensionOperation.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/extension/ExtensionOperation.java?rev=659307&r1=659306&r2=659307&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/extension/ExtensionOperation.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/extension/ExtensionOperation.java Thu May 22 16:25:57 2008
@@ -1,40 +1,40 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.ode.bpel.runtime.extension;
-
-import org.apache.ode.bpel.common.FaultException;
-import org.w3c.dom.Element;
-
-/**
- * This is the basis interface for implementations of  
- * <code>&lt;extensionAssignOperation&gt;</code> and <code>&lt;extensionActivity&gt;</code>
- * nodes.
- * 
- * Implementations of this interface must provide a default constructor as they are created
- * using reflection.
- * 
- * @see AbstractExtensionBundle
- * 
- * @author Tammo van Lessen (University of Stuttgart)
- */
-public interface ExtensionOperation {
-
-	void run(ExtensionContext context, Element element) throws FaultException;
-	
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.runtime.extension;
+
+import org.apache.ode.bpel.common.FaultException;
+import org.w3c.dom.Element;
+
+/**
+ * This is the basis interface for implementations of  
+ * <code>&lt;extensionAssignOperation&gt;</code> and <code>&lt;extensionActivity&gt;</code>
+ * nodes.
+ * 
+ * Implementations of this interface must provide a default constructor as they are created
+ * using reflection.
+ * 
+ * @see AbstractExtensionBundle
+ * 
+ * @author Tammo van Lessen (University of Stuttgart)
+ */
+public interface ExtensionOperation {
+
+	void run(ExtensionContext context, Element element) throws FaultException;
+	
+}