You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by ad...@apache.org on 2006/02/28 17:35:26 UTC

svn commit: r381694 [15/38] - in /incubator/ode/scratch: bpe/ ode/ ode/bpelTests/ ode/bpelTests/probeService/ ode/bpelTests/test1/ ode/bpelTests/test10/ ode/bpelTests/test12/ ode/bpelTests/test13/ ode/bpelTests/test14/ ode/bpelTests/test15/ ode/bpelTes...

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/PauseInstance.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/PauseInstance.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/PauseInstance.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/PauseInstance.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.cc.util.ops;
+
+import org.apache.ode.cc.client.CCException;
+import org.apache.ode.cc.client.IInstance;
+
+
+public class PauseInstance extends SingleInstanceOperationBase
+{
+    protected void invokeInstanceOperation(IInstance instance) throws CCException
+    {
+        instance.pause();
+    }
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/QueryEngine.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/QueryEngine.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/QueryEngine.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/QueryEngine.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.cc.util.ops;
+
+import java.io.OutputStream;
+
+import org.apache.ode.cc.client.IEngine;
+import org.apache.ode.cc.util.CCNode;
+import org.apache.ode.cc.util.CCReader;
+import org.apache.ode.cc.util.CCSerializer;
+
+
+public class QueryEngine extends CCOpBase
+{
+
+    public void invoke()
+    {
+        try
+        {
+            IEngine engine = m_util.getEngine();
+
+            CCReader ccs = new CCReader();
+            CCNode node;
+
+            node = ccs.readEngine(engine);
+
+            OutputStream output = m_util.getOutputStream();
+            CCSerializer serializer = new CCSerializer(output);
+            serializer.serializeTree(node);
+        } catch (Exception e)
+        {
+            throw new RuntimeException(e);
+        }
+    }
+
+ 
+
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/QueryInstance.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/QueryInstance.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/QueryInstance.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/QueryInstance.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.cc.util.ops;
+
+import java.io.OutputStream;
+
+import org.apache.ode.cc.client.IInstance;
+import org.apache.ode.cc.util.CCNode;
+import org.apache.ode.cc.util.CCReader;
+import org.apache.ode.cc.util.CCSerializer;
+
+
+public class QueryInstance extends SingleInstanceOperationBase
+{
+    protected void invokeInstanceOperation(IInstance instance) 
+    {
+		CCReader ccs = new CCReader( );
+		CCNode node;
+        try
+        {
+            node = ccs.readInstanceNode( instance, true );
+        } catch (Exception e)
+        {
+           throw new RuntimeException(e);
+        }
+        OutputStream output = m_util.getOutputStream();
+		CCSerializer serializer = new CCSerializer( output );
+		serializer.serializeTree(node);
+    }
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/RemoveAllDefinitions.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/RemoveAllDefinitions.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/RemoveAllDefinitions.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/RemoveAllDefinitions.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.cc.util.ops;
+
+import org.apache.ode.cc.client.CCException;
+import org.apache.ode.cc.client.IDefinition;
+
+
+public class RemoveAllDefinitions extends AllDefinitionOperationBase
+{
+
+    protected void invokePerDefinition(IDefinition definition)
+            throws CCException
+    {
+        definition.remove();
+    }
+
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/RemoveAllInstances.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/RemoveAllInstances.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/RemoveAllInstances.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/RemoveAllInstances.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.cc.util.ops;
+
+import org.apache.ode.cc.client.CCException;
+import org.apache.ode.cc.client.IInstance;
+
+
+public class RemoveAllInstances extends AllInstanceOperationBase
+{
+    protected void invokePerInstanceOperation(IInstance instance)
+            throws CCException
+    {
+        instance.remove();
+    }
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/ResumeAllInstances.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/ResumeAllInstances.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/ResumeAllInstances.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/ResumeAllInstances.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.cc.util.ops;
+
+import org.apache.ode.cc.client.CCException;
+import org.apache.ode.cc.client.IInstance;
+
+
+public class ResumeAllInstances extends AllInstanceOperationBase
+{
+
+    protected void invokePerInstanceOperation(IInstance instance) throws CCException
+    {
+       instance.resume();   
+    }
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/ResumeInstance.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/ResumeInstance.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/ResumeInstance.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/ResumeInstance.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.cc.util.ops;
+
+import org.apache.ode.cc.client.CCException;
+import org.apache.ode.cc.client.IInstance;
+
+
+public class ResumeInstance extends SingleInstanceOperationBase
+{
+    protected void invokeInstanceOperation(IInstance instance) throws CCException
+    {
+        instance.resume();
+    }
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/SingleInstanceOperationBase.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/SingleInstanceOperationBase.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/SingleInstanceOperationBase.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/SingleInstanceOperationBase.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+*/
+/*
+ * Created on Sep 27, 2004
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+package org.apache.ode.cc.util.ops;
+
+import org.apache.ode.cc.client.CCException;
+import org.apache.ode.cc.client.IInstance;
+
+/**
+ * @author blorenz
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+public abstract class SingleInstanceOperationBase extends CCOpBase
+{
+
+    public void invoke()
+    { 
+        IInstance instance = m_util.getInstance( getInstanceIDArg() );
+        try
+        {
+            invokeInstanceOperation( instance );
+            
+        } catch (CCException e)
+        {
+            throw new RuntimeException(e);
+        }
+    }
+    
+    protected abstract void invokeInstanceOperation(IInstance instance) 
+      throws CCException;
+
+    public String getUsage()
+    {
+        return "op."+ getName() + " instanceID.<someID>";
+    }
+    
+    public int getArgCount()
+    {
+        return 2;
+    }
+
+
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/TerminateAllInstances.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/TerminateAllInstances.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/TerminateAllInstances.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/util/ops/TerminateAllInstances.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.cc.util.ops;
+
+import org.apache.ode.cc.client.CCException;
+import org.apache.ode.cc.client.IInstance;
+
+
+public class TerminateAllInstances extends AllInstanceOperationBase
+{
+    protected void invokePerInstanceOperation(IInstance instance)
+            throws CCException
+    {
+        instance.terminate();
+    }
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/BPEClient.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/BPEClient.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/BPEClient.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/BPEClient.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client;
+
+import java.util.Properties;
+
+import org.apache.ode.client.exceptions.BPEClientInstantiationException;
+import org.apache.ode.client.exceptions.BPEUserException;
+import org.apache.ode.client.impl.def.DefaultBPEClientFactory;
+import org.apache.ode.client.spi.IBPEClientFactory;
+
+
+/**
+ * This class represents a connection to the BPE.
+ * 
+ * Currently the client gleans all the required connection 
+ * information from the environment, but a future version 
+ * will support programmatically passing connection information 
+ * to the BPEClient constructor. 
+ */
+public class BPEClient implements IBPEClient
+{
+	private IBPEClient m_impl = null;
+	private IBPEClientFactory m_factory = null;
+	private Properties m_spec = null;
+	
+	
+	/**
+	 * Constructor.
+	 * @throws BPEUserException
+	 */
+	public BPEClient() throws BPEUserException
+	{
+		m_spec = new Properties();
+		setup();
+	}
+	/**
+	 * Construct the client with the supplied connection
+	 * parameters.  No connection parameters are currently
+	 * supported.
+	 * 
+	 * @param spec
+	 * @throws BPEUserException
+	 */
+	public BPEClient( Properties spec ) throws BPEUserException
+	{
+		m_spec = spec;
+	
+			setup();
+		
+	}
+	private void setup() throws BPEUserException
+	{
+		
+		String factoryName = m_spec.getProperty(BPE_CLIENT_FACTORY);
+		if ( factoryName != null )
+		{
+			try
+			{
+				m_factory = ( IBPEClientFactory ) Class.forName( factoryName ).newInstance();
+			} catch (Exception e)
+			{
+				throw new BPEClientInstantiationException(e);
+			} 
+		}
+		else
+		{
+			m_factory = new DefaultBPEClientFactory();
+			
+		}
+		m_impl = m_factory.createBPEClient(m_spec);
+	}
+	
+
+
+	/**
+	 * @see org.apache.ode.client.IBPEClient#createMessage()
+	 */
+	public IBPEMessage createMessage()
+	{
+		return m_impl.createMessage();
+	}
+
+	/**
+	 * @see org.apache.ode.client.IBPEClient#createOperation(java.util.Properties)
+	 */
+	public IOperation createOperation(Properties spec)
+	{
+		return m_impl.createOperation(spec);
+	}
+	
+	/**
+	 * @see org.apache.ode.client.IBPEClient#createPart(java.lang.String, org.apache.ode.client.IDescribedValue)
+	 */
+	public IBPEMessagePart createPart(String name, IDescribedValue value)
+	{
+		return m_impl.createPart(name, value );
+	}
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/DescribedValue.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/DescribedValue.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/DescribedValue.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/DescribedValue.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,132 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client;
+
+import java.io.Serializable;
+import java.util.Properties;
+
+import org.w3c.dom.Document;
+
+import org.apache.ode.interaction.spiimpl.document.LazyDocument;
+import org.apache.ode.interaction.spiimpl.atomic.LazyObject;
+
+
+/**
+ * Holds a data object and optional format information.
+ */
+public class DescribedValue implements IDescribedValue
+{
+	
+    static final long serialVersionUID = 2872569307424875033L;
+    
+	private Object m_rawData;
+	private IFormat m_format;
+	private Properties m_contentType;
+	
+
+	/**
+	 * Constructor.
+	 * @param rawData
+	 * The data object ( e.g. byte[], Document, String )
+	 * @param format
+	 * Optional formatting information which may be required
+	 * to further specify data format.
+	 * @param contentType
+	 * Optional content type information which may be required
+	 * to identify an interaction factory.
+	 */
+	public DescribedValue( Object rawData, IFormat format, 
+			Properties contentType )
+	{
+		setRawData( rawData );
+		m_format = format;
+		m_contentType = contentType;
+
+	}
+	
+	protected void setRawData( Object rawData )
+	{
+		if ( ( rawData instanceof Document ) &&
+				! ( rawData instanceof Serializable ) )
+		{
+			m_rawData = new LazyDocument( ( Document ) ( rawData ) );
+		}
+		else if ( ! ( rawData instanceof Serializable ) )
+		{
+		    m_rawData = new LazyObject( rawData );
+		}
+		else
+		{
+			m_rawData = rawData;
+		}
+	}
+	/**
+	 * Constructor.
+	 * @param rawData
+	 * The data object ( e.g. byte[], Document, String )
+	 */
+	public DescribedValue(Object rawData )
+	{
+		setRawData(rawData);
+	}
+
+	/**
+	 * Constructor.
+	 * @param rawData
+	 * The data object ( e.g. byte[], Document, String )
+	 * @param format
+	 * Optional formatting information which may be required
+	 * to further specify data format.
+	 */
+	public DescribedValue(Object rawData, IFormat format)
+	{
+		
+		setRawData(rawData);
+		m_format = format;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.ode.client.IDescribedValue#getData()
+	 */
+	public Object getData()
+	{
+		if ( m_rawData instanceof LazyDocument )
+		{
+			return (( LazyDocument) ( m_rawData )).getDocument();
+		}
+		if ( m_rawData instanceof LazyObject )
+		{
+		    return ( ( LazyObject ) ( m_rawData ) ).getObject();
+		}
+		return m_rawData;
+	}
+	/* (non-Javadoc)
+	 * @see org.apache.ode.client.IDescribedValue#getFormat()
+	 */
+	public IFormat getFormat()
+	{
+		return m_format;
+	}
+	/* (non-Javadoc)
+	 * @see org.apache.ode.client.IDescribedValue#getContentType()
+	 */
+	public Properties getContentType()
+	{
+		return m_contentType;
+	}
+
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IBPEClient.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IBPEClient.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IBPEClient.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IBPEClient.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client;
+
+import java.util.Properties;
+
+
+/**
+ * A client uses this interface to send requests to the BPE.
+ */
+public interface IBPEClient
+{
+	public static final String 
+	  BPE_CLIENT_FACTORY = "BPEClientFactory";
+	public static final String
+		PACKAGE_NAME="packageName";
+	public static final String
+		BPED_LOCAL = "bpe_local";
+	
+	/**
+	 * Create a request message.
+	 * 
+	 * @return 
+	 * BPEClient message.
+	 */
+	public IBPEMessage createMessage();
+	
+	/**
+	 * Create an operation based on the operation specifiers.
+	 * @param spec
+	 * @return
+	 * An operation object.
+	 */
+	public IOperation createOperation( Properties spec );
+
+	/**
+	 * Create a part object.
+	 * @return
+	 * A new part.
+	 */
+	public IBPEMessagePart createPart(String name, 
+			IDescribedValue value);
+	
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IBPEMessage.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IBPEMessage.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IBPEMessage.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IBPEMessage.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client;
+
+import java.util.Collection;
+
+
+/**
+ * A request or response message.  Request messages are sent
+ * to the BPE via the BPEClient and returned in a result object.
+ */
+public interface IBPEMessage
+{
+	/**
+	 * @return
+	 * All the parts contained in the message.
+	 */
+	public Collection getParts();
+	
+	/**
+	 * Add a part to the message.
+	 * @param part
+	 * The part to add.
+	 */
+	public void addPart( IBPEMessagePart part );
+
+	/**
+	 * Get a part by name.
+	 * @param part
+	 */
+	public IBPEMessagePart getPart(String iName);
+
+
+	/**
+	 * Remove the named part from the message.
+	 * @param name
+	 */
+	public void removePart( String name );
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IBPEMessagePart.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IBPEMessagePart.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IBPEMessagePart.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IBPEMessagePart.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client;
+
+
+/**
+ * A part is a named object.  Messages are composed of several parts.
+ */
+public interface IBPEMessagePart
+{
+	
+	/**
+	 * Get the value object held by the part
+	 * @return
+	 * The part's associated value.
+	 */
+	public IFormattableValue getFormattableValue();
+	
+	
+	/**
+	 * Get the part's name.
+	 * @return
+	 */
+	public String getName();
+
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IDescribedValue.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IDescribedValue.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IDescribedValue.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IDescribedValue.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client;
+
+import java.io.Serializable;
+import java.util.Properties;
+
+/**
+ * Holds a data object and optional format information.
+ */
+public interface IDescribedValue extends Serializable
+{
+	
+	static final long serialVersionUID = -6364465447596296593L;
+
+	/**
+	 * Get the raw data object.
+	 * @return
+	 * Raw data object.
+	 */
+	public Object getData();
+
+	/**
+	 * Get the format of the raw data.
+	 * @return
+	 * The format of the raw data.
+	 */
+	public IFormat getFormat();
+
+	
+	/**
+	 * Get the content type of the value.
+	 * @return
+	 * The content type of the value.
+	 */
+	public Properties getContentType();
+
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IFormat.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IFormat.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IFormat.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IFormat.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client;
+
+import java.io.Serializable;
+
+
+/**
+ * Represents the format of a data object.  The format
+ * specifies the physical representation of logical content.
+ */
+public interface IFormat extends Serializable
+{
+	static final long serialVersionUID = -7048863611433131838L;
+	
+	/**
+	 * Ask if the supplied format is the same as 
+	 * this one.
+	 * @param format
+	 * @return
+	 */
+	public boolean isSameFormat( IFormat format );
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IFormattableValue.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IFormattableValue.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IFormattableValue.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IFormattableValue.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client;
+
+import java.io.Serializable;
+
+import org.apache.ode.client.exceptions.BPEUserException;
+
+
+/**
+ * A container for application data which exposes some
+ * reformatting capabilities. 
+ * 
+ * This type is passed as a part value to external actions.
+ * The external actions can request the format they need.
+ */
+public interface IFormattableValue extends Serializable
+{
+	static final long serialVersionUID = 2848553063039579726L;
+	
+
+	/**
+	 * Get the value in the requested representation.  
+	 * The format provides further specificity if the supplied
+	 * class parameter leaves ambiguity.  For example a
+	 * byte[] specifier for the class type leaves many possiblities
+	 * for the contents of the byte array.
+	 * @return
+	 * The value in the requested representation.
+	 * @throws BPEUserException
+	 */
+	public Object getValueAs( Class clazz, IFormat format );
+	
+	/**
+	 * Get the value in the requested representation.  
+	 * @return
+	 * The value in the requested representation.
+	 * @throws BPEUserException
+	 */
+	public Object getValueAs( Class clazz );
+	  
+	/**
+	 * Inquire if the specified representation is supported.
+	 * @return
+	 */
+	public boolean supportsGetValueAs( 
+			Class clazz, IFormat format );
+	/**
+	 * Inquire if the specified representation is supported.
+	 * @return
+	 */
+	public boolean supportsGetValueAs( 
+			Class clazz);
+	
+	/**
+	 * Get the contained value in its current format.
+	 */
+	public IDescribedValue getDescribedValue();
+	
+	/**
+	 * Convert the wrapped content into a string representation.
+	 * 
+	 * If the wrapped object is a simple type the string returned
+	 * should be the format returned from
+	 * Double.toString(), Integer.toString(), Boolean.toString(),
+	 * Short.toString(), Byte.toString()
+	 * 
+	 * If the wrapped content is a complex datatype the string
+	 * returned should be an xml document.
+	 */
+	public String toString();
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IOperation.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IOperation.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IOperation.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IOperation.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client;
+
+import org.apache.ode.client.exceptions.BPEUserException;
+import org.apache.ode.client.result.IResult;
+
+/**
+ * Represents an operation exposed by a business process.
+ */
+public interface IOperation
+{
+	public static final String	PORT_TYPE = "port.type";
+	public static final String	OPERATION = "operation";
+	public static final String	PORT_TYPE_NAMESPACE = "target.name.space";
+	/**
+	 * Send a synchronous request to the BPE.
+	 * 
+	 * @param request
+	 * Request message.
+	 * @return 
+	 * Result of the Request
+	 * @throws BPEUserException
+	 */
+	public IResult invoke( 
+			IBPEMessage request ) 
+		throws BPEUserException;
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IValueDescription.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IValueDescription.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IValueDescription.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/IValueDescription.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client;
+
+import java.util.Properties;
+
+
+
+public interface IValueDescription
+{
+	public Class getValueClass();
+	public IFormat getValueFormat();
+	public Properties getContentType();
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/BPEClientInstantiationException.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/BPEClientInstantiationException.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/BPEClientInstantiationException.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/BPEClientInstantiationException.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client.exceptions;
+
+
+/**
+ * An exception of this type indicates that the client
+ * was unable to instantiate its implementation.
+ */
+public class BPEClientInstantiationException extends BPEUserException
+{
+	static final long serialVersionUID = -4150885544671044717L;
+
+	public BPEClientInstantiationException( Exception e )
+	{
+		super(e);
+	}
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/BPEUserException.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/BPEUserException.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/BPEUserException.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/BPEUserException.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client.exceptions;
+
+import java.util.Properties;
+/**
+ * This is the base class for all exceptions thrown by the
+ * BPE client interface.
+ */
+public class BPEUserException extends Exception
+{
+	static final long serialVersionUID = -2888469780780690129L;
+	
+	protected Properties m_props;
+
+	protected BPEUserException()
+	{		
+	}
+	
+	protected BPEUserException( Exception e )
+	{
+		super( e );
+	}
+	
+	protected BPEUserException( String cause)
+	{
+		super(cause);
+	}
+	
+	public void setProperties(Properties props)
+	{
+		m_props = props;
+	}
+	
+	public Properties getProperties()
+	{
+		return m_props;
+	}
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/InvalidTargetException.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/InvalidTargetException.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/InvalidTargetException.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/InvalidTargetException.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client.exceptions;
+
+/**
+ * The BPE throws an exception of this type when a suitable
+ * target is not available to consume the request.  This
+ * exception is different from the ITargetNotReady result
+ * which indicates that the request may have arrived out of
+ * order and may be consumed at some point in the future.
+ * 
+ * This exception may be thrown if the BPE can not find
+ * an instance which is ready to consume the event at the
+ * current time and the instance is not configured to consume
+ * out of sequence requests.
+ */
+public class InvalidTargetException extends BPEUserException
+{
+	static final long serialVersionUID = 7692656540454047158L;
+	
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/SystemException.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/SystemException.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/SystemException.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/SystemException.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client.exceptions;
+
+
+/**
+ * The BPE throws an exception of this type when it encounters an
+ * unexpected exception such as one of the following:
+ * 
+ * ClassCastException
+ * NullPointerException
+ * ClassNotFoundException
+ * NamingException
+ * ConnectionFailure
+ * others...
+ * 
+ * The exception contains a reference to the low level exception
+ * which caused the problem.
+ * 
+ */
+public class SystemException 
+  extends BPEUserException
+{
+	static final long serialVersionUID = 7132578244522570446L;
+
+	
+	public SystemException( String iCause)
+	{
+		super(iCause);
+	}
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/TargetDefinitionPausedException.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/TargetDefinitionPausedException.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/TargetDefinitionPausedException.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/TargetDefinitionPausedException.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client.exceptions;
+
+/**
+ * The BPE client throws an exception of this type if the target
+ * definition is in a paused state.  The exception contains
+ * the target definition id.
+ * 
+ * The client which handles this request may choose to save
+ * the request so that it can be resubmitted when the process
+ * definition resumes.
+*/
+public class TargetDefinitionPausedException 
+  extends BPEUserException
+{
+	static final long serialVersionUID = -4780849624194293843L;
+	
+	private String m_definitionID;
+	private String m_definitionName;
+	public TargetDefinitionPausedException(
+	        String iDefinitionID,
+	        String iDefintionName )
+	{
+		m_definitionID = iDefinitionID;
+		m_definitionName = iDefintionName;
+	}
+	public String getDefinitionID()
+	{
+		return m_definitionID;
+	}
+	public String getDefinitionName()
+	{
+	    return m_definitionName;
+	}
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/TargetInstancePausedException.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/TargetInstancePausedException.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/TargetInstancePausedException.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/TargetInstancePausedException.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client.exceptions;
+
+/**
+ * The BPE throws and exception of this type if the target
+ * process instance is in a paused state.  The exception
+ * contains the id of the paused instance.
+ * 
+ * The client application which handles this exception
+ * may choose to save the request and resubmit it when
+ * the process instance resumes.
+ */
+public class TargetInstancePausedException
+  extends BPEUserException
+{
+	static final long serialVersionUID = 2369203027761479450L;
+
+	
+	private String m_instanceID;
+	public TargetInstancePausedException( String iInstanceID )
+	{
+		m_instanceID = iInstanceID;
+	}
+	public String getInstanceID()
+	{
+		return m_instanceID;
+	}
+	
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/UnknownRequestException.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/UnknownRequestException.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/UnknownRequestException.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/exceptions/UnknownRequestException.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client.exceptions;
+
+
+/**
+ * An exception this type indicates that the BPE could not
+ * identify a possible consumer of the event.  The BPE 
+ * throws this exception if it does not recognize the
+ * static key contained in the request.
+ */
+public class UnknownRequestException 
+  extends BPEUserException
+{
+	static final long serialVersionUID = -7059334972420522416L;
+	
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/formats/AtomicFormat.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/formats/AtomicFormat.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/formats/AtomicFormat.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/formats/AtomicFormat.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client.formats;
+
+import org.apache.ode.client.IFormat;
+
+
+/**
+* This format indicates data which can not be drilled into or modified in part.
+* Data in this format may be opaque to the BPE or it may be a simple
+* type which can be converted to a string and used in a conditional evaluation.
+*/
+class AtomicFormat implements INativeFormat
+{
+    static final long serialVersionUID = -5763679245311857446L;
+    
+	AtomicFormat()
+	{
+	}
+	
+	public boolean isSameFormat(IFormat format)
+	{
+		if ( format instanceof AtomicFormat ) 
+		{
+			return true;
+		}
+		return false;
+	}
+
+
+	/* (non-Javadoc)
+	 * @see java.lang.Object#equals(java.lang.Object)
+	 */
+	public boolean equals(Object obj) {
+		return obj instanceof AtomicFormat;
+	}
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/formats/INativeFormat.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/formats/INativeFormat.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/formats/INativeFormat.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/formats/INativeFormat.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client.formats;
+
+import org.apache.ode.client.IFormat;
+
+
+public interface INativeFormat extends IFormat
+{
+	static final long serialVersionUID = 5662454797021906703L;
+	
+
+	// Enumerated formats understood natively by the BPE.
+	public static final IFormat ATOMIC = new AtomicFormat();
+	public static final IFormat XML = new XMLFormat();
+
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/formats/XMLFormat.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/formats/XMLFormat.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/formats/XMLFormat.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/formats/XMLFormat.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client.formats;
+
+import org.apache.ode.client.IFormat;
+
+/**
+ * Data in this format is held a buffer which contains an
+ * XML document.
+ */
+public class XMLFormat implements INativeFormat
+{
+	
+    static final long serialVersionUID = 1693383337342530213L;
+    
+	XMLFormat()
+	{
+	}
+
+	public boolean isSameFormat(IFormat type)
+	{
+		if ( type instanceof XMLFormat )
+		{
+			return true;
+		}
+		else
+		{
+			return false;
+		}
+	}
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/IInternalMessage.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/IInternalMessage.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/IInternalMessage.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/IInternalMessage.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client.impl;
+
+import java.io.Serializable;
+import java.util.Map;
+
+
+public interface IInternalMessage extends Serializable
+{
+	static final long serialVersionUID = -4014012840029262085L;
+	
+	public Map getParts();
+	public void setParts( Map parts );
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/IInternalMessageAdapter.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/IInternalMessageAdapter.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/IInternalMessageAdapter.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/IInternalMessageAdapter.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client.impl;
+
+import org.apache.ode.event.IRequestMessageEvent;
+import org.apache.ode.event.IResponseMessage;
+
+/**
+ * Converts messages client messages to/from
+ * an engine consumable format.
+ * 
+ */
+public interface IInternalMessageAdapter
+{
+	/**
+	 * Create an internal message from a response message
+	 * produced by the BPE.
+	 * @param response
+	 * @return
+	 */
+	public IInternalMessage createInternalMessage( 
+			IResponseMessage response );
+	
+	/**
+	 * Create a request message from an internal
+	 * message.
+	 * @param internalMessage
+	 * @return
+	 */
+	public IRequestMessageEvent createRequestMessage(
+			IInternalMessage internalMessage);
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/IInternalRequestConsumer.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/IInternalRequestConsumer.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/IInternalRequestConsumer.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/IInternalRequestConsumer.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client.impl;
+
+import org.apache.ode.event.IStaticKey;
+
+
+public interface IInternalRequestConsumer
+{
+	public IInternalResult 
+	   sendRequest(IStaticKey staticKey, IInternalMessage internalRequest);
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/IInternalResult.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/IInternalResult.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/IInternalResult.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/IInternalResult.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client.impl;
+
+import java.io.Serializable;
+import java.util.Properties;
+
+
+public interface IInternalResult extends Serializable
+{
+	static final long serialVersionUID = -2941113714302271666L;
+	
+	public static final int 
+		FAULT_RESULT = 1;
+	public static final int 
+		SUCCESS_RESULT = 2;
+	public static final int 
+		SUCCESS_WITH_RESPONSE_RESULT = 3;
+	public static final int 
+		TARGET_NOT_READY_RESULT = 4;
+	public static final int
+		EXCEPTION_RESULT = 5;
+	
+	public static final int SYSTEM_EXCEPTION = 100;
+	public static final int TARGET_DEF_PAUSED_EXCEPTION = 101;
+	public static final int TARGET_INST_PAUSED_EXCEPTION = 102;
+	public static final int INVALID_TARGET_EXCEPTION = 103;
+	public static final int UNKNOWN_REQUEST_EXCEPTION = 104;
+	public static final int PAUSED_TARGET_INSTANCE_EXCEPTION = 105;
+	public static final int DEACTIVATED_TARGET_DEFINITION_EXCEPTION = 106;
+	
+	public int getResultType();
+	public IInternalMessage getSuccessfulResponse();
+	public IInternalMessage getFaultMessage();
+	public String getFaultName();
+	public String getFaultNamespace();
+	public String getID();
+	public void setID(String id);
+	public String getDefinitionName();
+	public void setDefinitionName(String definitionName );
+	
+	public String getExceptionName();
+	public StackTraceElement[] getExceptionStackTrace();
+	public String getExceptionString();
+	public Properties getExceptionProperties();
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/MessageConverter.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/MessageConverter.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/MessageConverter.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/MessageConverter.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,246 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client.impl;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.ode.client.DescribedValue;
+import org.apache.ode.client.IDescribedValue;
+import org.apache.ode.client.IFormattableValue;
+import org.apache.ode.client.impl.def.InternalMessage;
+import org.apache.ode.client.impl.def.InternalResult;
+import org.apache.ode.client.spi.interaction.ISPIInteraction;
+import org.apache.ode.engine.InactiveDefinitionException;
+import org.apache.ode.engine.ProcessInstancePausedException;
+import org.apache.ode.event.Fault;
+import org.apache.ode.event.IRequestMessageEvent;
+import org.apache.ode.event.IResponseMessage;
+import org.apache.ode.event.IStaticKey;
+import org.apache.ode.event.SimpleRequestMessageEvent;
+import org.apache.ode.interaction.IInteraction;
+import org.apache.ode.interaction.spiadapter.SPIAdapterInteraction;
+import org.apache.ode.interaction.spiimpl.MasterInteractionFactory;
+import org.apache.ode.scope.service.BPRuntimeException;
+import org.apache.ode.util.BPException;
+import org.apache.ode.action.external.ActionSystemException;
+
+/**
+ * @author blorenz
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+public class MessageConverter
+{
+
+	public IRequestMessageEvent createRequest(IStaticKey key, IInternalMessage internalRequest)
+	{
+		SimpleRequestMessageEvent srm = new SimpleRequestMessageEvent();
+		srm.setStaticKey(key);
+		Map requestParts = internalRequest.getParts();
+		Iterator iter = requestParts.entrySet().iterator();
+		while (iter.hasNext())
+		{
+			Entry entry = (Entry) iter.next();
+			String name = (String)( entry.getKey());
+			IDescribedValue dv = (IDescribedValue) entry.getValue();
+			ISPIInteraction spi = MasterInteractionFactory.newInstance()
+					.createInteraction(dv);
+			SPIAdapterInteraction spiai = 
+				new SPIAdapterInteraction( spi );
+			try
+			{
+				srm.setPart( name, spiai );
+			} catch (BPException e)
+			{
+				throw new RuntimeException(e);
+			}
+		}
+		return srm;
+	}
+	
+	static IInternalMessage createInternalMessage(Map parts)
+	{
+		InternalMessage im = new InternalMessage();
+		Iterator iter = parts.entrySet().iterator();
+		HashMap internalParts = new HashMap();
+		while (iter.hasNext())
+		{
+			Entry entry = (Entry) (iter.next());
+			String name = (String) (entry.getKey());
+			Object value = entry.getValue();
+			IFormattableValue fv = null;
+			if (value instanceof IInteraction)
+			{
+				IInteraction interaction = null;
+				interaction = (IInteraction) (entry.getValue());
+				
+				if (interaction != null
+						&& interaction instanceof SPIAdapterInteraction)
+				{
+					fv = ((SPIAdapterInteraction) (interaction)).getUserValue();
+				}
+			}
+			else
+			{
+				IDescribedValue describedValue = null;
+				if ( value instanceof IDescribedValue )
+				{
+					describedValue = ( IDescribedValue)( value );
+				}
+				else
+				{
+					describedValue = new DescribedValue( value );
+				}
+				ISPIInteraction interaction = 
+					MasterInteractionFactory.newInstance().createInteraction( describedValue );
+				fv = interaction.getValue();
+			}
+			internalParts.put(name, fv);
+		}
+		im.setParts(internalParts);
+		return im;
+	}
+
+	public IInternalResult createResult(IResponseMessage response)
+	{
+		Map map = response.getParts();
+			
+		InternalResult iresult = new InternalResult();
+		Fault fault;
+		Exception faultException = null;
+		try
+		{
+			fault = response.getFault();
+			if ( fault != null )
+			{
+				faultException = fault.getFaultException();
+			}
+		} catch (BPException e)
+		{
+			throw new RuntimeException(e);
+		}
+		
+		/*
+		 * 		catch( ProcessInstancePausedException pipe )
+		{
+		    InternalResult internalResult = new InternalResult();
+		    MessageConverter.PopulatePausedInstanceException(
+		            internalResult, pipe);
+		    iresult = internalResult;
+		}
+		catch( InactiveDefinitionException iade )
+		{
+		    InternalResult internalResult = new InternalResult();
+		    MessageConverter.PopulateInactiveDefinitionException(
+		            internalResult, iade );
+		    iresult = internalResult;
+		}
+		 * 
+		 * 
+		 * 
+		 */
+		if (faultException != null )
+		{
+			if (faultException instanceof BPRuntimeException)
+			{
+				PopulateBusinessProcessFaultResult( iresult,
+						( BPRuntimeException )( faultException ));
+			} 
+			else if( faultException instanceof ProcessInstancePausedException )
+			{
+				PopulatePausedInstanceException(iresult, 
+				        (ProcessInstancePausedException)faultException);		
+			}
+			else if( faultException instanceof InactiveDefinitionException)
+			{
+			    PopulateInactiveDefinitionException( iresult,
+			            (InactiveDefinitionException)faultException);
+			}
+			else
+			{
+			    PopulateSystemExceptionResult( iresult, faultException );
+			}
+		}
+		else
+		{
+			IInternalMessage im = createInternalMessage( map );	
+			iresult.setSuccessfulResponse(im);
+			iresult.setResultType(IInternalResult.SUCCESS_WITH_RESPONSE_RESULT);
+		}
+		
+		
+		return iresult;
+	}
+
+	/**
+	 * @param iresult
+	 * @param faultException
+	 */
+	public static void PopulateSystemExceptionResult(InternalResult iresult, Exception faultException)
+	{
+		iresult.setResultType(IInternalResult.SYSTEM_EXCEPTION);
+		iresult.setExceptionName( faultException.getClass().getName());
+		iresult.setExceptionStackTrace( faultException.getStackTrace());
+		iresult.setExceptionString( faultException.toString());
+		if (faultException instanceof ActionSystemException)
+		{
+			iresult.setExceptionProperties( ((ActionSystemException)faultException).getProperties());
+		}
+		
+	}
+
+	/**
+	 * @param internalResult
+	 * @param bpre
+	 */
+	public static void PopulateBusinessProcessFaultResult(InternalResult internalResult, BPRuntimeException bpre)
+	{
+		
+		HashMap faultParts = bpre.getMessageParts();
+		IInternalMessage im = createInternalMessage(faultParts);
+		internalResult.setFaultName(bpre.getName());
+		internalResult.setFaultNamespace(bpre.getNameSpace());
+		internalResult.setResultType( IInternalResult.FAULT_RESULT );
+		internalResult.setFaultMessage( im );
+	}
+
+    public static void PopulatePausedInstanceException(
+            InternalResult internalResult, 
+            ProcessInstancePausedException pipe)
+    {
+        internalResult.setResultType( 
+                IInternalResult.PAUSED_TARGET_INSTANCE_EXCEPTION);
+        internalResult.setID( 
+                pipe.getRootInstanceID() );
+        internalResult.setExceptionStackTrace(pipe.getStackTrace());
+    }
+
+    public static void PopulateInactiveDefinitionException(
+            InternalResult internalResult, 
+            InactiveDefinitionException iade)
+    {
+        internalResult.setResultType( 
+                IInternalResult.DEACTIVATED_TARGET_DEFINITION_EXCEPTION);
+        internalResult.setID( iade.getRootDefinitionID());
+        internalResult.setDefinitionName( iade.getProcessName());
+        internalResult.setExceptionStackTrace(iade.getStackTrace());
+    }
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/def/BPEClientDefaultImpl.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/def/BPEClientDefaultImpl.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/def/BPEClientDefaultImpl.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/def/BPEClientDefaultImpl.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client.impl.def;
+
+import java.util.Properties;
+
+import org.apache.ode.bped.EventDirectorFactory;
+import org.apache.ode.bped.EventDirector;
+import org.apache.ode.client.IBPEClient;
+import org.apache.ode.client.IBPEMessage;
+import org.apache.ode.client.IBPEMessagePart;
+import org.apache.ode.client.IDescribedValue;
+import org.apache.ode.client.IFormattableValue;
+import org.apache.ode.client.IOperation;
+import org.apache.ode.client.exceptions.BPEClientInstantiationException;
+import org.apache.ode.client.exceptions.BPEUserException;
+//import org.apache.ode.client.impl.IInternalMessageAdapter;
+import org.apache.ode.interaction.spiimpl.CannedFormattableValue;
+import org.apache.ode.util.BPException;
+import org.apache.ode.uo.util.ApplicationLocalStore;
+
+
+public class BPEClientDefaultImpl implements IBPEClient
+{
+//	private String m_iFactoryName;
+//	private IInternalMessageAdapter messageAdapter;
+	private EventDirector eventDirector;
+	
+	public BPEClientDefaultImpl( Properties spec ) throws BPEUserException
+	{
+		try
+		{
+			String pkgName = spec.getProperty(PACKAGE_NAME);
+			boolean remote = true;
+
+			String val = System.getProperty(EventDirectorFactory.JNFI);
+			if (val != null && val.compareTo(EventDirectorFactory.IMJNFI) == 0)
+				remote = false;
+			
+			if (remote)
+			{
+				if ( pkgName != null ) {
+					if ( spec.getProperty(BPED_LOCAL) == null ) {
+					eventDirector = 
+						EventDirectorFactory.createRemoteEventDirector(pkgName);
+					} else {
+						eventDirector = 
+							getLocalEventDirector(pkgName);
+					}
+				} else {
+					eventDirector = EventDirectorFactory.createRemoteEventDirector();
+				}
+			} 
+			else
+			{
+				eventDirector = EventDirectorFactory.createEventDirectorCached();	
+			}
+			
+		} catch (BPException e)
+		{
+			throw new BPEClientInstantiationException(e);
+		}
+	}
+	
+	private EventDirector getLocalEventDirector( String packageName ) 
+	  throws BPException
+	{
+	    String key = "BPED local interface for package " + packageName + 
+	      " with thread hashcode " + Thread.currentThread().hashCode();
+	    EventDirector returnValue = 
+	        (EventDirector)(ApplicationLocalStore.get(key));
+	    if( returnValue == null )
+	    {
+	        returnValue = 
+	            EventDirectorFactory.createRemoteEventDirector(packageName, true);
+	        ApplicationLocalStore.set(key, returnValue);
+	    }
+	    return returnValue;
+	}
+
+	public IBPEMessage createMessage()
+	{
+		return new Message( this );
+	}
+
+	public IFormattableValue createFormattableValue(IDescribedValue describedValue)
+	{
+		return new CannedFormattableValue( describedValue );
+	}
+
+	public IOperation createOperation(Properties spec)
+	{
+		Operation returnValue = 
+			new Operation(this, eventDirector, spec );
+		return returnValue;
+	}
+
+	public IBPEMessagePart createPart(String name, IDescribedValue value)
+	{
+		return new Part( this, name, value );
+	}
+	
+	public IBPEMessagePart createPart(String name, IFormattableValue value )
+	{
+		return new Part( (IBPEClient)this, name, value );
+	}
+	
+
+}
+

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/def/ClientObject.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/def/ClientObject.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/def/ClientObject.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/def/ClientObject.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client.impl.def;
+
+import org.apache.ode.client.IBPEClient;
+
+
+public abstract class ClientObject
+{
+	private IBPEClient m_client;
+	public ClientObject( IBPEClient client)
+	{
+		m_client = client;
+	}
+	public IBPEClient getClient()
+	{
+		return m_client;
+	}
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/def/DefaultBPEClientFactory.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/def/DefaultBPEClientFactory.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/def/DefaultBPEClientFactory.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/def/DefaultBPEClientFactory.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client.impl.def;
+
+import java.io.Serializable;
+import java.util.Properties;
+
+import org.apache.ode.client.IBPEClient;
+import org.apache.ode.client.exceptions.BPEUserException;
+import org.apache.ode.client.spi.IBPEClientFactory;
+
+
+public class DefaultBPEClientFactory 
+  implements IBPEClientFactory, Serializable
+{
+    static final long serialVersionUID = 4344269224482525761L;
+    
+	public DefaultBPEClientFactory()
+	{
+		
+	}
+	public IBPEClient createBPEClient(Properties spec) 
+	throws BPEUserException
+	{
+		return new BPEClientDefaultImpl( spec );
+	}
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/def/FaultResult.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/def/FaultResult.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/def/FaultResult.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/def/FaultResult.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client.impl.def;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+import org.apache.ode.cc.util.SerializationContext;
+import org.apache.ode.client.IBPEMessage;
+import org.apache.ode.client.result.IFaultResult;
+
+
+public class FaultResult implements IFaultResult
+{
+	private String faultName;
+	private String faultNamespace;
+	private IBPEMessage faultMessage;
+	
+	public FaultResult( String faultName, String faultNamespace,
+			IBPEMessage faultMessage )
+	{
+		this.faultName = faultName;
+		this.faultNamespace = faultNamespace;
+		this.faultMessage = faultMessage;
+	}
+	/* (non-Javadoc)
+	 * @see org.apache.ode.client.result.IFaultResult#getFaultMessage()
+	 */
+	public IBPEMessage getFaultMessage()
+	{
+		return faultMessage;
+	}
+	/* (non-Javadoc)
+	 * @see org.apache.ode.client.result.IFaultResult#getFaultName()
+	 */
+	public String getFaultName()
+	{
+		return faultName;
+	}
+	/* (non-Javadoc)
+	 * @see org.apache.ode.client.result.IFaultResult#getFaultNamespace()
+	 */
+	public String getFaultNamespace()
+	{
+		return faultNamespace;
+	}
+	
+	public void dump( SerializationContext sc )
+	{
+		sc.startTag("FaultResult", null, null );
+		
+			sc.startEndTag("FaultNamespace", 
+					this.getFaultNamespace());
+			
+			sc.startEndTag("FaultName", 
+					this.getFaultName());
+			
+			Message message =  ( Message ) this.getFaultMessage();
+			
+			message.dump( sc );
+		
+		sc.endTag("FaultResult");
+	}
+	
+	public String toString()
+	{
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		SerializationContext sc = new SerializationContext( baos );
+		this.dump( sc );
+		try
+		{
+			baos.close();
+		} catch (IOException e)
+		{
+			throw new RuntimeException(e);
+		}
+		return baos.toString();
+		
+	/*
+		StringBuffer buf = new StringBuffer("Fault Result:\n");
+		buf.append("Fault Namespace: " + this.getFaultNamespace() + "\n");
+		buf.append("Fault Name: " + this.getFaultName() + "\n");
+	
+		buf.append("Fault Message: ");
+		IBPEMessage faultMessage = this.getFaultMessage();
+		buf.append( faultMessage + "\n");
+
+		return buf.toString();
+		*/
+	}
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/def/InternalMessage.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/def/InternalMessage.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/def/InternalMessage.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/client/impl/def/InternalMessage.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.client.impl.def;
+
+import java.util.Map;
+
+import org.apache.ode.client.impl.IInternalMessage;
+
+
+public class InternalMessage implements IInternalMessage
+{
+    static final long serialVersionUID = 3831727989426495555L;
+    
+	private Map m_parts;
+	public Map getParts()
+	{
+		return m_parts;
+	}
+	public void setParts( Map parts )
+	{
+		m_parts = parts;
+	}
+}