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 [13/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/base/DataExtractor.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/base/DataExtractor.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/base/DataExtractor.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/base/DataExtractor.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,164 @@
+/*
+ * 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.base;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedList;
+
+import org.apache.ode.cc.client.DefinitionState;
+import org.apache.ode.cc.client.EngineState;
+import org.apache.ode.cc.client.InstanceState;
+import org.apache.ode.cc.data.DefinitionData;
+import org.apache.ode.cc.data.EngineData;
+import org.apache.ode.cc.data.InstanceData;
+import org.apache.ode.cc.data.OperationData;
+import org.apache.ode.definition.IPMDOperation;
+import org.apache.ode.definition.IPMDRoot;
+import org.apache.ode.enginestate.service.IEngineState;
+import org.apache.ode.event.BPELStaticKey;
+import org.apache.ode.instance.IPMIProcess;
+import org.apache.ode.util.BPException;
+public class DataExtractor
+{
+	public static Collection getDefinitionData(Collection defs)
+			throws BPException
+	{
+		Collection dataCollection = new LinkedList();
+		Iterator iter = defs.iterator();
+		while (iter.hasNext())
+		{
+			IPMDRoot rootDef = (IPMDRoot) (iter.next());
+			DefinitionData dd = getDefinitionData( rootDef );
+			dataCollection.add( dd );
+		}
+		return dataCollection;
+	}
+	public static DefinitionData getDefinitionData(IPMDRoot def)
+			throws BPException
+	{
+		DefinitionData dd = new DefinitionData();
+		dd.setID(def.getProcess().getKey().getValue());
+		dd.setName(def.getLabel());
+		DefinitionState defState = createDefinitionState(def.getState());
+		dd.setState( defState );
+		return dd;
+	}
+	public static DefinitionState createDefinitionState(int iState)
+	{
+		if (DefinitionState.ACTIVE.intValue() == iState)
+		{
+			return DefinitionState.ACTIVE;
+		} else if (DefinitionState.INACTIVE.intValue() == iState)
+		{
+			return DefinitionState.INACTIVE;
+		}
+		return DefinitionState.UNKNOWN;
+	}
+	public static Collection getInstanceData(Collection instances) throws BPException
+	{
+		Iterator iter = instances.iterator();
+		LinkedList returnValue = new LinkedList();
+		while( iter.hasNext() )
+		{
+			IPMIProcess instance = ( IPMIProcess ) ( iter.next() );
+			InstanceData instanceData = getInstanceData( instance );
+			returnValue.add(instanceData);
+		}
+		return returnValue;
+	}
+	
+	public static InstanceData getInstanceData( IPMIProcess instance ) throws BPException
+	{
+		InstanceData instanceData = new InstanceData();
+		String id = instance.getKey();
+		instanceData.setID( id );
+		instanceData.setState( createInstanceState( instance.getState() ) );
+		return instanceData;
+	}
+	
+	public static EngineData getEngineData( IEngineState engine ) throws BPException
+	{
+		EngineData engineData = new EngineData();
+		String id = engine.getId();
+		engineData.setID( id );
+		engineData.setState( createEngineState( engine.getState() ) );
+		return engineData;
+	}
+	
+	public  static InstanceState createInstanceState(int state)
+	{
+	    switch( state )
+	    {
+	    	case( InstanceState.FINISHED_CONST):
+	    	{
+	    	    return InstanceState.FINISHED;
+	    	}
+	    	case( InstanceState.STARTED_CONST):
+	    	{
+	    	    return InstanceState.STARTED;
+	    	}
+	    	case( InstanceState.PAUSED_CONST):
+	    	{
+	    	    return InstanceState.PAUSED;
+	    	}
+	    	case( InstanceState.RUNNING_CONST):
+	    	{
+	    	    return InstanceState.RUNNING;
+	    	}
+	    	case( InstanceState.TERMINATED_CONST):
+	    	{
+	    	    return InstanceState.TERMINATED;
+	    	}
+	    	default:
+	    	{
+	    	    return InstanceState.UNKNOWN;
+	    	}
+	    }
+	
+	}
+	
+	public  static EngineState createEngineState(String state)
+	{
+		if (EngineState.PAUSED.equals(state)) 
+		{
+			return EngineState.PAUSED;
+		} else
+		{
+			return EngineState.RUNNING;
+		}
+	
+	}
+    public static Collection createOperationData(Collection operations)
+    {
+        Iterator iter = operations.iterator();
+        LinkedList returnCollection = new LinkedList();
+        while( iter.hasNext() )
+        {
+            IPMDOperation pmdOperation = ( IPMDOperation )( iter.next() );
+            returnCollection.add( createOperationData( pmdOperation ));
+        }       
+        return returnCollection;
+    }
+    
+    public static OperationData createOperationData( IPMDOperation operation )
+    {
+        BPELStaticKey key = ( BPELStaticKey )( operation.getKey() );
+        OperationData data = new OperationData(key.getTargetNamespace(),
+                key.getPortType(), key.getOperation(), key.toString() );
+        return data;
+        
+    }
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/BPELBundle.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/BPELBundle.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/BPELBundle.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/BPELBundle.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,71 @@
+/*
+ * 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.client;
+
+import java.io.InputStream;
+import java.io.Serializable;
+//import java.util.logging.Logger;
+
+
+public class BPELBundle implements IBPELBundle, Serializable
+{
+	
+    static final long serialVersionUID = -7999904011331733849L;
+    
+//	private static Logger logger = 
+//		Logger.getLogger(BPELBundle.class.getName());
+	
+	private String name;
+	private String resourcePath;
+	private InputStream jarStream;
+		
+	public BPELBundle()
+	{
+	}
+	
+	public BPELBundle( String name, InputStream file)
+	{
+		this.name = name;
+		this.jarStream = file;
+
+	}
+	
+	public BPELBundle( String name, String resourcePath)
+	{
+		this.name = name;
+		this.resourcePath = resourcePath;
+	}
+	
+	public String getName()
+	{
+		return name;
+	}
+
+	public InputStream getAsInputStream()
+	{
+		return jarStream;
+	}
+
+	public boolean isStream() {
+		return resourcePath == null;
+	}
+
+	public String getResourcePath() {
+		return resourcePath;
+	}
+
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/CCClient.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/CCClient.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/CCClient.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/CCClient.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.cc.client;
+
+import java.util.HashMap;
+
+import org.apache.ode.cc.client.impl.EngineFactory;
+
+
+public class CCClient implements ICCClient
+{
+	public CCClient() throws CCException
+	{
+	
+	}
+	public IEngine getEngine() throws CCException
+	{
+		HashMap config = new HashMap();
+		return getEngine(config);
+	}
+	public IEngine getEngine(HashMap config) throws CCException
+	{
+		IEngine engine = EngineFactory.createEngine( config );
+		return engine;
+	}
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/CCException.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/CCException.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/CCException.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/CCException.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.client;
+
+import java.io.Serializable;
+
+public class CCException extends Exception implements Serializable
+{
+    static final long serialVersionUID = 7888638787959868908L;
+    
+	public CCException()
+	{
+	}
+	public CCException( Exception e )
+	{
+		super(e);
+	}
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/DefinitionQuery.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/DefinitionQuery.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/DefinitionQuery.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/DefinitionQuery.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,34 @@
+/*
+ * 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.client;
+
+import java.util.Properties;
+
+
+public class DefinitionQuery implements IDefinitionQuery
+{
+	private Properties queryProperties;
+	public DefinitionQuery(Properties queryProperties )
+	{
+		this.queryProperties = queryProperties;
+	}
+	
+	public Properties getQueryProperties()
+	{
+		return queryProperties;
+	}
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/DefinitionState.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/DefinitionState.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/DefinitionState.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/DefinitionState.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,80 @@
+/*
+ * 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.client;
+
+import java.io.ObjectStreamException;
+import java.io.Serializable;
+
+
+/**
+ * Represents enumerated states of the process definition.
+ */
+public class DefinitionState implements Serializable
+{
+	
+    static final long serialVersionUID = -8196810743841034766L;
+    
+	private final String m_state;
+	private final int m_intState;
+	private DefinitionState( String iState, int iIntState )
+	{
+		m_state = iState;
+		m_intState = iIntState;
+	}
+	
+	public String toString()
+	{
+		return m_state;
+	}
+	
+	public int intValue()
+	{
+		return m_intState;
+	}
+	
+	private static final int ACTIVE_CONST = 0;
+	private static final int INACTIVE_CONST = 1;
+	private static final int UNKNOWN_CONST = 2;
+	
+	public static final DefinitionState ACTIVE = 
+		new DefinitionState( "Active", ACTIVE_CONST);
+	public static final DefinitionState INACTIVE = 
+		new DefinitionState("Inactive", INACTIVE_CONST);
+	public static final DefinitionState UNKNOWN = 
+		new DefinitionState("Unknown", UNKNOWN_CONST);
+	
+	private Object readResolve() throws 
+	  ObjectStreamException
+	  {
+	    	switch( m_intState )
+	    	{
+	    		case(ACTIVE_CONST):
+	    		{
+	    		    return ACTIVE;
+	    		}
+	    		case(INACTIVE_CONST):
+	    		{
+	    		    return INACTIVE;
+	    		}
+	    		case(UNKNOWN_CONST):
+	    		{
+	    		    return UNKNOWN;
+	    		}
+	    	}
+	    	return UNKNOWN;    	
+	  }
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/EngineState.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/EngineState.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/EngineState.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/EngineState.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,57 @@
+/*
+ * 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.client;
+
+import java.io.ObjectStreamException;
+import java.io.Serializable;
+
+
+/**
+ * Represents enumerated states of the process engine.
+ */
+public class EngineState implements Serializable
+{
+    static final long serialVersionUID = 2782690805200091637L;
+    
+		private final String m_state;
+		private EngineState( String iState )
+		{
+			m_state = iState;
+		}
+		
+		public String toString()
+		{
+			return m_state;
+		}
+		
+		public static final EngineState RUNNING = 
+			new EngineState( "Running");
+		public static final EngineState PAUSED = 
+			new EngineState("Paused");
+		
+		private Object readResolve() throws ObjectStreamException
+    {
+
+        if (m_state.equals("Running"))
+        {
+            return RUNNING;
+        }
+
+        return PAUSED;
+
+    }
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IBPELBundle.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IBPELBundle.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IBPELBundle.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IBPELBundle.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.client;
+
+import java.io.InputStream;
+
+
+public interface IBPELBundle extends IBundle
+{
+	
+	static final long serialVersionUID = -3166595740402622949L;
+	
+	public boolean isStream();
+	public InputStream getAsInputStream();
+	public String getResourcePath();
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IBundle.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IBundle.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IBundle.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IBundle.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,27 @@
+/*
+ * 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.client;
+
+import java.io.Serializable;
+
+
+public interface IBundle extends Serializable
+{
+	static final long serialVersionUID = -5646689444725258493L;
+	
+	public String getName();
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/ICCClient.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/ICCClient.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/ICCClient.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/ICCClient.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,25 @@
+/*
+ * 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.client;
+
+import java.util.HashMap;
+
+
+public interface ICCClient
+{
+	public IEngine getEngine() throws CCException;
+	public IEngine getEngine(HashMap env) throws CCException;
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IChildScope.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IChildScope.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IChildScope.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IChildScope.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.cc.client;
+
+
+public interface IChildScope extends IScope
+{
+	/**
+	 * Get a handle to the parent scope.
+	 * @return
+	 * @throws CCException
+	 */
+	public IScope getParentScope() throws CCException;
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IDefinition.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IDefinition.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IDefinition.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IDefinition.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,83 @@
+/*
+ * 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.client;
+
+import java.util.Collection;
+
+/**
+ * Exposes business process definition level command
+ * and control operations.
+ */
+public interface IDefinition extends IStatistical
+{
+	/**
+	 * Deactivate the definition.  Deactivated definitions
+	 * do not create new bp instances.
+	 * @throws CCException
+	 */
+	public void deactivate() throws CCException;
+	/**
+	 * Activate the definition.
+	 * @throws CCException
+	 */
+	public void activate() throws CCException;
+	/**
+	 * Remove the business process definition.
+	 * @throws CCException
+	 */
+	public void remove() throws CCException;
+	/**
+	 * Get the state of the business process definition.
+	 * @return
+	 * @throws CCException
+	 */
+	public DefinitionState getState() throws CCException;
+	/**
+	 * Get the active business process instances spawned from
+	 * this definition.
+	 * @return
+	 * The state of the definition.
+	 * @throws CCException
+	 */
+	public Collection getInstances() throws CCException;	
+	/**
+	 * Get the human readable name of the definition.
+	 * @return
+	 * @throws CCException
+	 */
+	public String getName() throws CCException;
+	/**
+	 * Get the definition id.
+	 * @return
+	 * @throws CCException
+	 */
+	public String getID() throws CCException;
+	/**
+	 * Get a handle to the engine which contains the definition.
+	 * @return
+	 * A handle to the engine.
+	 * @throws CCException
+	 */
+	public IEngine getEngine() throws CCException;
+	
+	/**
+	 * Get a collection of IProcessCreatingOperations
+	 * @return
+	 * A collection of IProcessCreatingOperations.
+	 * @throws CCException
+	 */
+	public Collection getProcessCreatingOperations() throws CCException;
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IDefinitionQuery.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IDefinitionQuery.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IDefinitionQuery.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IDefinitionQuery.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.cc.client;
+
+import java.util.Properties;
+
+
+public interface IDefinitionQuery
+{
+	public static final String DEFINITION_NAME = "DefinitionName";
+	public Properties getQueryProperties();
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IEngine.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IEngine.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IEngine.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IEngine.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,119 @@
+/*
+ * 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.client;
+
+import java.util.Collection;
+import java.util.Date;
+
+
+/**
+ * Exposes engine level command and control operations.
+ */
+public interface IEngine extends IStatistical
+{
+	/**
+	 * Key into the config HashMap to find the engine name.
+	 */
+	public final String ENGINE_NAME = "ENGINE_NAME";
+	/**
+	 * Pause the engine instance.
+	 * @throws CCException
+	 */
+	public void pause() throws CCException;
+	/**
+	 * Unpause the engine instance.
+	 * @throws CCException
+	 */
+	public void resume() throws CCException;
+	/**
+	 * Get the state of the engine instance ( running, paused, etc. )
+	 * @return
+	 * The engine state.
+	 * @throws CCException
+	 */
+	public EngineState getState() throws CCException;
+	/**
+	 * Get a collection of the defintions deployed to the engine instance.
+	 * @return
+	 * @throws CCException
+	 */
+	public Collection getDefinitions() throws CCException;
+	
+	public void deployBundle(IBundle bundle) throws CCException;
+
+	public void cleanup( Date completionDate ) throws CCException;
+	/**
+	 * Cleanup all complete business process objects now.
+	 * @throws CCException
+	 */
+	public void cleanupNow() throws CCException;
+	/**
+	 * Get a handle to a business process instanced based on a supplied id.
+	 * @param iInstanceID
+	 * Business process instance id
+	 * @return
+	 * Handle to a business process instance useful for instance level
+	 * command and control.
+	 * @throws CCException
+	 */
+	public IInstance getInstance( String instanceID ) throws CCException;
+	/**
+	 * Get a handle to a deployed business process definition based on a supplied
+	 * id.
+	 * @param iDefinitionID
+	 * Business process definition id.
+	 * @return
+	 * Handle to a business process definition.
+	 * @throws CCException
+	 */
+	public IDefinition getDefinition( IDefinitionQuery query ) throws CCException;
+	/**
+	 * Get the engine's human readable name.
+	 * @return
+	 * The name of the engine.
+	 * @throws CCException
+	 */
+	public String getName() throws CCException;
+	/**
+	 * Get the engine's unique id.
+	 * @return
+	 * The engine's unique id.
+	 * @throws CCException
+	 */
+	public String getID() throws CCException;
+	
+	/**
+	 * Specify whether or not the engine should automatically
+	 * clean up completed instance data.
+	 * @param iAutomaticCleanup
+	 */
+	public void setAutomaticCleanup( boolean automaticCleanup ) 
+	  throws CCException;
+	
+	/**
+	 * Get the engine's automatic cleanup flag.
+	 * @return
+	 */
+	public boolean getAutomaticCleanup();
+	
+	/**
+	 * Returns true if the engine has already undergone
+	 * the bootstrapping process.
+	 * @throws CCException
+	 */
+	public boolean isBootstrapped() throws CCException;
+
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IInstance.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IInstance.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IInstance.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IInstance.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,93 @@
+/*
+ * 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.client;
+
+import java.util.Collection;
+
+
+
+/**
+ * @author blorenz
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+/**
+ * Exposes business process instance level command 
+ * and control operations.
+ */
+public interface IInstance extends IStatistical
+{
+	/**
+	 * Pause the business process instance.
+	 * @throws CCException
+	 */
+	public void pause() throws CCException;
+	/**
+	 * Terminate the business process instance.
+	 * @throws CCException
+	 */
+	public void terminate() throws CCException;
+	/**
+	 * Unpause the business process instance.
+	 * @throws CCException
+	 */
+	public void resume() throws CCException;
+	/**
+	 * Remove the business process instance.
+	 * @throws CCException
+	 */
+	public void remove() throws CCException;
+	/**
+	 * Get the state of the business process instance.
+	 * @return
+	 * The state of the bp instance.
+	 * @throws CCException
+	 */
+	public InstanceState getState() throws CCException;
+
+	/**
+	 * Get the business process instnace id.
+	 * @return
+	 * @throws CCException
+	 */
+	public String getID() throws CCException;
+	/**
+	 * Get the instance's associated definition.
+	 * @return
+	 * @throws CCException
+	 */
+	public IDefinition getDefinition() throws CCException;
+	
+	/**
+	 * Get the business process instance's context.
+	 * @return
+	 * A handle to the process context.
+	 * @throws CCException
+	 */
+	public IScope getRootContext() throws CCException;
+	
+	/**
+	 * Get the instance's active registrations.
+	 * 
+	 * @return
+	 * @throws CCException
+	 */
+	public Collection getRegistrations() throws CCException;
+	
+	
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IProcessCreatingOperation.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IProcessCreatingOperation.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IProcessCreatingOperation.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IProcessCreatingOperation.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,25 @@
+/*
+ * 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.client;
+
+public interface IProcessCreatingOperation
+{
+    public String getPortType();
+    public String getOperationName();
+    public String getPortTypeNamespace();
+    public String getStaticKey();
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IRegistration.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IRegistration.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IRegistration.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IRegistration.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.cc.client;
+
+
+public interface IRegistration
+{
+	public String getPortType();
+	public String getOperation();
+	public String getTargetNamespace();
+	public String getDynamicKey();
+	public String getName();
+	public IInstance getInstance();
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IScope.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IScope.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IScope.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IScope.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,56 @@
+/*
+ * 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.client;
+
+import java.util.Collection;
+
+
+/**
+ *Exposes context level command and control operations.
+ */
+public interface IScope
+{
+	/**
+	 * Get a collection of child scopes.
+	 * @return
+	 * A collection of child scope handles.
+	 * @throws CCException
+	 */
+	public Collection getChildScopes() throws CCException;
+	/**
+	 * Get handles to the variables contained in this scope.
+	 * @return
+	 * A collection of variable handles.
+	 * @throws CCException
+	 */
+	public Collection getVariables() throws CCException;
+
+	/**
+	 * Get a handle to the bp instance that contains the scope.
+	 * @return
+	 * Handle to the bp instance that contains the scope.
+	 * @throws CCException
+	 */
+	public IInstance getBPInstance() throws CCException;
+	/**
+	 * Get the name of the scope.
+	 * @return
+	 * The name of the scope.
+	 * @throws CCException
+	 */
+	public String getName()throws CCException;
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IStatistical.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IStatistical.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IStatistical.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IStatistical.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.cc.client;
+
+import java.util.Map;
+
+/**
+ *  Objects which implement this interface have statistics
+ *  which can be harvested.
+ */
+public interface IStatistical
+{
+	public Map getStatistics() throws CCException;
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IVariable.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IVariable.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IVariable.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IVariable.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,47 @@
+/*
+ * 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.client;
+
+import java.util.Collection;
+
+
+/**
+ * Exposes variable level command and control operations.
+ */
+public interface IVariable
+{
+	/**
+	 * Get a collection of handles to parts contained in the variable.
+	 * @return
+	 * A collection of parts.
+	 * @throws CCException
+	 */
+	public Collection getParts() throws CCException;
+	/**
+	 * Get a handle to the scope that contains the variable.
+	 * @return
+	 * @throws CCException
+	 */
+	public IScope getScope() throws CCException;
+	/**
+	 * Get the name of the variable.
+	 * @return
+	 * The name of the variable.
+	 * @throws CCException
+	 */
+	public String getName() throws CCException;
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IVariablePart.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IVariablePart.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IVariablePart.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/IVariablePart.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.cc.client;
+
+
+
+/**
+ * Exposes variable part level operations.
+ */
+public interface IVariablePart
+{
+	/**
+	 * Get the value contained in the part.
+	 * @return
+	 * The value object.
+	 * @throws CCException
+	 */
+	public Object getValue() throws CCException;
+	/**
+	 * Get the name of the variable part.
+	 * @return
+	 * The name of the variable part.
+	 * @throws CCException
+	 */
+	public String getName() throws CCException;
+	/**
+	 * Get a handle to the variable that contains the part.
+	 * @return
+	 * @throws CCException
+	 */
+	public IVariable getVariable() throws CCException;
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/InstanceState.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/InstanceState.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/InstanceState.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/InstanceState.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,109 @@
+/*
+ * 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.client;
+
+import java.io.ObjectStreamException;
+import java.io.Serializable;
+
+
+/**
+ * Represents enumerated states of the process instance.
+ */
+public class InstanceState implements Serializable
+{
+    static final long serialVersionUID = 4860370316474738334L;
+    
+	private final String m_state;
+	private final int m_intState;
+	private InstanceState( String iState, int iIntState )
+	{
+		m_state = iState;
+		m_intState = iIntState;
+	}
+	
+	public String toString()
+	{
+		return m_state;
+	}
+	
+	public int toInt()
+	{
+		return m_intState;
+	}
+	
+	/*
+	   private static final int STARTED_INT = 1;
+	   private static final int UNSTARTED_INT = 2;
+	   private static final int PAUSED_INT = 3;
+	   private static final int FINISHED_INT = 4;
+	   private static final int TERMINATED_INT = 5;
+	   private static final int RUNNING_INT = 6;
+	   */
+	
+	public static final int STARTED_CONST = 1;
+	public static final int PAUSED_CONST = 3;
+	public static final int FINISHED_CONST = 4;
+	public static final int TERMINATED_CONST = 5;
+	public static final int RUNNING_CONST = 6;
+	public static final int UNKNOWN_CONST = -1;
+	
+	public static final InstanceState STARTED = 
+		new InstanceState( "Started", STARTED_CONST);
+	public static final InstanceState RUNNING = 
+		new InstanceState( "Running", RUNNING_CONST);
+	public static final InstanceState PAUSED = 
+		new InstanceState("Paused", PAUSED_CONST);
+	public static final InstanceState FINISHED = 
+		new InstanceState("Finished", FINISHED_CONST);
+	public static final InstanceState TERMINATED =
+	    new InstanceState("Terminated", TERMINATED_CONST);
+	public static final InstanceState UNKNOWN =
+		new InstanceState("Unknown", UNKNOWN_CONST);
+	
+	private Object readResolve() throws 
+	  ObjectStreamException
+	  {
+	    	switch( m_intState )
+	    	{
+	    		case(STARTED_CONST):
+	    		{
+	    		    return STARTED;
+	    		}
+	    		case(RUNNING_CONST):
+	    		{
+	    		    return RUNNING;
+	    		}
+	    		case(PAUSED_CONST):
+	    		{
+	    		    return PAUSED;
+	    		}
+	    		case(FINISHED_CONST):
+	    		{
+	    		    return FINISHED;
+	    		}
+	    		case(TERMINATED_CONST):
+	    		{
+	    		    return TERMINATED;
+	    		}
+	    		case(UNKNOWN_CONST):
+	    		{
+	    		    return UNKNOWN;
+	    		}
+	    	}
+	    	return UNKNOWN;    	
+	  }
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/UnsupportedBundleException.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/UnsupportedBundleException.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/UnsupportedBundleException.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/UnsupportedBundleException.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,27 @@
+/*
+ * 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.client;
+
+
+public class UnsupportedBundleException extends CCException
+{
+	static final long serialVersionUID = 1836839893097971493L;
+	
+	public UnsupportedBundleException()
+	{
+	}
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/ejbproxy/CCClientProxyBean.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/ejbproxy/CCClientProxyBean.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/ejbproxy/CCClientProxyBean.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/ejbproxy/CCClientProxyBean.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,491 @@
+/*
+ * 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.client.ejbproxy;
+
+import java.rmi.RemoteException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBException;
+import javax.ejb.SessionBean;
+import javax.ejb.SessionContext;
+
+import org.apache.ode.cc.client.CCClient;
+import org.apache.ode.cc.client.CCException;
+import org.apache.ode.cc.client.IDefinition;
+import org.apache.ode.cc.client.IEngine;
+import org.apache.ode.cc.client.IInstance;
+
+/**
+ * This bean is a flattened abstraction of the Command and Control
+ * client's "tiered facade" class hierarchy.  This bean is intended
+ * to support JMX exposure of its management operations, and thus
+ * does not implement server-side interfaces nor utilize complex
+ * parameter data types in its public API.
+ * 
+ * @ejb:bean 
+ *		description="CCClient proxy implemented as an EJB"
+ *		jndi-name="BPE/CCClientProxy"
+ *		name="CCClientProxy"
+ *		type="Stateless"
+ *		view-type="both"
+ *		local-jndi-name="BPE/CCClientProxyLocal"
+ * 
+ * @ejb.transaction type="Required"
+ **/
+public class CCClientProxyBean implements SessionBean
+{
+	static final long serialVersionUID = -577190264022194039L;
+	
+	/** The logger. **/
+	private static Logger ms_logger = Logger.getLogger(
+			CCClientProxyBean.class.getName() );
+	
+	/** Session context. **/
+//	private SessionContext m_context = null;
+
+	/** ctor **/
+	public CCClientProxyBean()
+	{
+	}
+
+	//========================================================================
+	// Session bean methods
+	//========================================================================
+
+	/**
+	 * Create EJB.
+	 * @ejb.create-method
+	 **/
+	public void ejbCreate()
+		throws CreateException
+	{
+	}
+
+	/**
+	 * Remove EJB.
+	 **/
+	public void ejbRemove()
+		throws EJBException, RemoteException
+	{
+	}
+
+	/**
+	 * Activate EJB.
+	 **/
+	public void ejbActivate()
+		throws EJBException, RemoteException
+	{
+	}
+
+	/**
+	 * Passivate EJB.
+	 **/
+	public void ejbPassivate()
+		throws EJBException, RemoteException
+	{
+	}
+
+	/**
+	 * Set EJB session context.
+	 **/
+	public void setSessionContext( SessionContext ctx )
+		throws EJBException, RemoteException
+	{
+//		m_context = ctx;
+	}
+
+	//========================================================================
+	// Private methods
+	//========================================================================
+
+	/**
+	 * Get BP engine associated with specified package/engine name.
+	 * 
+	 * @param pkgName Package name of engine.
+	 * 
+	 * @return BP engine associated with specified package name.
+	 * 
+	 * @throws CCException on error.
+	 **/
+	private IEngine getEngine( String pkgName )
+		throws CCException
+	{
+		ms_logger.log( Level.FINEST, "Obtaining reference to BP engine \""
+				+ pkgName + "\"" );
+
+		CCClient client = new CCClient();
+
+		HashMap props = new HashMap();
+		props.put( IEngine.ENGINE_NAME, pkgName );
+
+		return client.getEngine( props );
+	}
+
+	/**
+	 * Get specified BP definition.
+	 * 
+	 * @param engine BP engine to query.
+	 * @param name BP definition name.
+	 * 
+	 * @return BP definition or null if specified definition
+	 * name was not found.
+	 * 
+	 * @throws CCException on error.
+	 **/
+	private IDefinition getDefinition( IEngine engine, String name )
+		throws CCException
+	{
+		// Note: IEngine.getDefinition() not yet implemented!
+		
+		Collection definitions = engine.getDefinitions();
+		for ( Iterator i = definitions.iterator(); i.hasNext(); )
+		{
+			IDefinition def = (IDefinition) i.next();
+			if ( def.getName().equals(name) )
+				return def;
+		}
+		
+		return null;
+	}
+
+	//========================================================================
+	// Business methods
+	//========================================================================
+
+	/**
+	 * Return human-readable name of BP engine associated
+	 * with specified package name.
+	 * 
+	 * @param pkgName Package name of engine.
+	 * @return BP engine human-readable name string.
+	 * @throws Exception on CC Client system error.
+	 * 
+	 * @ejb.interface-method
+	 **/
+	public String getName( String pkgName )
+		throws Exception
+	{
+		try
+		{
+			return getEngine( pkgName ).getName();
+		}
+		catch ( CCException e )
+		{
+			String msg = "Failed to get name of BP Engine \""
+					+ pkgName + "\"";
+			ms_logger.log( Level.SEVERE, msg, e );
+			throw new Exception( msg + ". Exception: " + e
+					+ ", Cause: " +	e.getCause() );
+		}
+	}
+	
+	/**
+	 * Return state of BP engine associated with
+	 * specified package name.
+	 * 
+	 * @param pkgName Package name of engine.
+	 * @return BP engine state string.
+	 * @throws Exception on CC Client system error.
+	 * 
+	 * @ejb.interface-method
+	 **/
+	public String getState( String pkgName )
+		throws Exception
+	{
+		try
+		{
+			return getEngine( pkgName ).getState().toString();
+		}
+		catch ( CCException e )
+		{
+			String msg = "Failed to get state of BP Engine \""
+					+ pkgName + "\"";
+			ms_logger.log( Level.SEVERE, msg, e );
+			throw new Exception( msg + ". Exception: " + e
+					+ ", Cause: " +	e.getCause() );
+		}
+	}
+	
+	/**
+	 * Return statistics of BP engine associated with
+	 * specified package name.
+	 * 
+	 * @param pkgName Package name of engine.
+	 * @return BP engine statistics map.
+	 * @throws Exception on CC Client system error.
+	 * 
+	 * @ejb.interface-method
+	 **/
+	public Map getStatistics( String pkgName )
+		throws Exception
+	{
+		try
+		{
+			return getEngine( pkgName ).getStatistics();
+		}
+		catch ( CCException e )
+		{
+			String msg = "Failed to get statistics of BP Engine \""
+					+ pkgName + "\"";
+			ms_logger.log( Level.SEVERE, msg, e );
+			throw new Exception( msg + ". Exception: " + e
+					+ ", Cause: " +	e.getCause() );
+		}
+	}
+
+	/**
+	 * Pause BP engine associated with specified package name.
+	 * 
+	 * @param pkgName Package name of engine.
+	 * @throws Exception on CC Client system error.
+	 * 
+	 * @ejb.interface-method
+	 **/
+	public void pause( String pkgName )
+		throws Exception
+	{
+		try
+		{
+			getEngine( pkgName ).pause();
+		}
+		catch ( CCException e )
+		{
+			String msg = "Failed to pause BP Engine \"" + pkgName + "\"";
+			ms_logger.log( Level.SEVERE, msg, e );
+			throw new CreateException( msg + ". Exception: " + e
+					+ ", Cause: " +	e.getCause() );
+		}
+	}
+
+	/**
+	 * Resume BP engine associated with specified package name.
+	 * 
+	 * @param pkgName Package name of engine.
+	 * @throws Exception on CC Client system error.
+	 * 
+	 * @ejb.interface-method
+	 **/
+	public void resume( String pkgName )
+		throws Exception
+	{
+		try
+		{
+			getEngine( pkgName ).resume();
+		}
+		catch ( CCException e )
+		{
+			String msg = "Failed to resume BP Engine \"" + pkgName + "\"";
+			ms_logger.log( Level.SEVERE, msg, e );
+			throw new Exception( msg + ". Exception: " + e
+					+ ", Cause: " +	e.getCause() );
+		}
+	}
+	
+	/**
+	 * Return names of all BP definitions hosted by the BP engine
+	 * associated with specified package name.
+	 * 
+	 * @param pkgName Package name of engine.
+	 * @return Collection of BP definition name strings.
+	 * @throws Exception on CC Client system error.
+	 * 
+	 * @ejb.interface-method
+	 **/
+	public Collection getDefinitions( String pkgName )
+		throws Exception
+	{
+		Collection names = new ArrayList();
+		
+		try
+		{
+			Collection definitions = getEngine( pkgName ).getDefinitions();
+			for ( Iterator i = definitions.iterator(); i.hasNext(); )
+			{
+				IDefinition def = (IDefinition) i.next();
+				names.add( def.getName() );
+			}
+		}
+		catch ( CCException e )
+		{
+			String msg = "Failed to get BP Definitions from BP Engine \""
+					+ pkgName + "\"";
+			ms_logger.log( Level.SEVERE, msg, e );
+			throw new Exception( msg + ". Exception: " + e
+					+ ", Cause: " +	e.getCause() );
+		}
+		
+		return names;
+	}
+
+	/**
+	 * Pause/deactivate the specified BP definition of the
+	 * BP engine associated with the given package name.
+	 * 
+	 * @param pkgName Package name of engine.
+	 * @param defName Name of BP definition to pause.
+	 * @throws Exception on CC Client system error.
+	 * 
+	 * @ejb.interface-method
+	 **/
+	public void pauseDefinition( String pkgName, String defName )
+		throws Exception
+	{
+		try
+		{
+			IEngine engine = getEngine( pkgName );
+			IDefinition def = getDefinition( engine, defName );
+			def.deactivate();
+		}
+		catch ( CCException e )
+		{
+			String msg = "Failed to pause BP Definition \"" + defName + "\""
+					+ " of BP Engine \"" + pkgName + "\"";
+			ms_logger.log( Level.SEVERE, msg, e );
+			throw new Exception( msg + ". Exception: " + e
+					+ ", Cause: " +	e.getCause() );
+		}
+	}
+
+	/**
+	 * Resume/activate the specified BP definition of the
+	 * BP engine associated with the specifed package name.
+	 * 
+	 * @param pkgName Package name of engine.
+	 * @param defName Name of BP definition to resume.
+	 * @throws Exception on CC Client system error.
+	 * 
+	 * @ejb.interface-method
+	 **/
+	public void resumeDefinition( String pkgName, String defName )
+		throws Exception
+	{
+		try
+		{
+			IEngine engine = getEngine( pkgName );
+			IDefinition def = getDefinition( engine, defName );
+			def.deactivate();
+		}
+		catch ( CCException e )
+		{
+			String msg = "Failed to resume BP Definition \"" + defName + "\""
+					+ " of BP Engine \"" + pkgName + "\"";
+			ms_logger.log( Level.SEVERE, msg, e );
+			throw new Exception( msg + ". Exception: " + e
+					+ ", Cause: " +	e.getCause() );
+		}
+	}
+
+	/**
+	 * Return all instances of specified BP definition of
+	 * BP engine associated with given package name.
+	 *
+	 * @param pkgName Package name of engine.
+	 * @param defName Name of BP definition to query.
+	 * @return Collection of BP instance ID strings.
+	 * 
+	 * @ejb.interface-method
+	 **/
+	public Collection getInstances( String pkgName, String defName )
+		throws Exception
+	{
+		Collection ids = new ArrayList();
+	
+		try
+		{
+			IEngine engine = getEngine( pkgName );
+			IDefinition def = getDefinition( engine, defName );
+
+			Collection instances = def.getInstances();
+			for ( Iterator i = instances.iterator(); i.hasNext(); )
+			{
+				IInstance inst = (IInstance) i.next();
+				ids.add( inst.getID() );
+			}
+		}
+		catch ( CCException e )
+		{
+			String msg = "Failed to get instances of BP Definition \""
+					+ defName + "\" from BP Engine \"" + pkgName + "\"";
+			ms_logger.log( Level.SEVERE, msg, e );
+			throw new Exception( msg + ". Exception: " + e
+					+ ", Cause: " +	e.getCause() );
+		}
+		
+		return ids;
+	}
+
+	/**
+	 * Pause the specified BP instance of the BP Engine associated
+	 * with the given package name.
+	 * 
+	 * @param pkgName Package name of engine.
+	 * @param id ID of instance to pause.
+	 * @throws Exception on CC Client system error.
+	 * 
+	 * @ejb.interface-method
+	 **/
+	public void pauseInstance( String pkgName, String id )
+		throws Exception
+	{
+		try
+		{
+			IInstance inst = getEngine( pkgName ).getInstance( id );
+			inst.pause();
+		}
+		catch ( CCException e )
+		{
+			String msg = "Failed to pause BP Instance \"" + id + "\""
+					+ " of BP Engine \"" + pkgName + "\"";
+			ms_logger.log( Level.SEVERE, msg, e );
+			throw new Exception( msg + ". Exception: " + e
+					+ ", Cause: " +	e.getCause() );
+		}
+	}
+
+	/**
+	 * Resume the specified BP instance.
+	 * 
+	 * @param pkgName Package name of engine.
+	 * @param id ID of instance to resume.
+	 * @throws Exception on CC Client system error.
+	 * 
+	 * @ejb.interface-method
+	 **/
+	public void resumeInstance( String pkgName, String id )
+		throws Exception
+	{
+		try
+		{
+			IInstance inst = getEngine( pkgName ).getInstance( id );
+			inst.resume();
+		}
+		catch ( CCException e )
+		{
+			String msg = "Failed to resume BP Instance \"" + id + "\""
+					+ " of BP Engine \"" + pkgName + "\"";
+			ms_logger.log( Level.SEVERE, msg, e );
+			throw new Exception( msg + ". Exception: " + e
+					+ ", Cause: " +	e.getCause() );
+		}
+	}
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/ChildScope.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/ChildScope.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/ChildScope.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/ChildScope.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.cc.client.impl;
+
+import org.apache.ode.cc.client.CCException;
+import org.apache.ode.cc.client.IChildScope;
+import org.apache.ode.cc.client.IInstance;
+import org.apache.ode.cc.client.IScope;
+import org.apache.ode.cc.data.ScopeData;
+import org.apache.ode.cc.service.ICCService;
+
+
+public class ChildScope extends Scope implements IChildScope
+{
+	private IScope m_parentScope;
+
+	public ChildScope(ICCService service, IInstance instance, IScope parentScope, ScopeData cdata)
+	{
+		super(service, instance, cdata);
+		m_parentScope = parentScope;
+	}
+
+	public IScope getParentScope() throws CCException
+	{
+		return m_parentScope;
+	}
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/Definition.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/Definition.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/Definition.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/Definition.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,115 @@
+/*
+ * 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.client.impl;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Map;
+
+import org.apache.ode.cc.client.CCException;
+import org.apache.ode.cc.client.DefinitionState;
+import org.apache.ode.cc.client.IDefinition;
+import org.apache.ode.cc.client.IEngine;
+import org.apache.ode.cc.data.DefinitionData;
+import org.apache.ode.cc.data.InstanceData;
+import org.apache.ode.cc.data.OperationData;
+import org.apache.ode.cc.service.ICCService;
+
+
+public class Definition extends ServiceNode implements IDefinition
+{
+	private DefinitionData m_data;
+//	private ICCService m_ccservice;
+	private IEngine m_engine;
+
+	public Definition(ICCService service, Engine engine, DefinitionData ddata)
+	{
+		super( service );
+		m_engine = engine;
+		m_data = ddata;
+
+	}
+	public void deactivate() throws CCException
+	{
+		getService().deactivateDefinition( m_data );
+	}
+	public void activate() throws CCException
+	{
+		getService().activateDefinition( m_data );
+	}
+	public void remove() throws CCException
+	{
+		getService().removeDefinition( m_data );
+	}
+	public DefinitionState getState() throws CCException
+	{
+		return m_data.getState();
+	}
+	public Collection getInstances() throws CCException
+	{
+		Collection instances = getService().getInstancesData( 
+				m_data.getID() );
+		Iterator instanceIter = instances.iterator();
+		LinkedList instancelist = new LinkedList();
+		while( instanceIter.hasNext() )
+		{
+			InstanceData instanceData = 
+				( InstanceData )( instanceIter.next());
+			instanceData.setDefinitionID(m_data.getID());
+			
+			Instance newInstance = 
+				new Instance( getService(), this, instanceData );
+			instancelist.add( newInstance );
+		}
+		return instancelist;
+	}
+	public String getName() throws CCException
+	{
+		return m_data.getName();
+	}
+	public String getID() throws CCException
+	{
+		return m_data.getID();
+	}
+	public IEngine getEngine() throws CCException
+	{
+		return m_engine;
+	}
+	public Map getStatistics() throws CCException
+	{
+		Map statistics = 
+			getService().getDefinitionStatistics(m_data);
+		return statistics;
+	}
+    public Collection getProcessCreatingOperations() throws CCException
+    {
+        LinkedList returnCollection = new LinkedList();
+        Collection operationData = 
+            getService().getProcessCreatingOperations(m_data);
+        
+        Iterator iter = operationData.iterator();
+        while( iter.hasNext() )
+        {
+            OperationData opData = (OperationData )(iter.next());
+            ProcessCreatingOperation pco = 
+                new ProcessCreatingOperation(opData);
+            returnCollection.add(pco);
+        }
+        return returnCollection;
+    }
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/Engine.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/Engine.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/Engine.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/Engine.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,220 @@
+/*
+ * 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.client.impl;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Map;
+
+import org.apache.ode.bped.DeployTypeEnum;
+import org.apache.ode.bped.EventDirector;
+import org.apache.ode.bped.EventDirectorFactory;
+import org.apache.ode.bped.IDeployer;
+import org.apache.ode.cc.client.CCException;
+import org.apache.ode.cc.client.EngineState;
+import org.apache.ode.cc.client.IBPELBundle;
+import org.apache.ode.cc.client.IBundle;
+import org.apache.ode.cc.client.IDefinition;
+import org.apache.ode.cc.client.IDefinitionQuery;
+import org.apache.ode.cc.client.IEngine;
+import org.apache.ode.cc.client.IInstance;
+import org.apache.ode.cc.client.UnsupportedBundleException;
+import org.apache.ode.cc.data.DefinitionData;
+import org.apache.ode.cc.data.EngineData;
+import org.apache.ode.cc.data.InstanceData;
+import org.apache.ode.cc.service.CCServiceFactory;
+import org.apache.ode.cc.service.ICCService;
+import org.apache.ode.util.BPException;
+
+public class Engine implements IEngine
+{
+	private ICCService m_CCService = null;
+	private EngineData m_data = null;
+	private HashMap iCreationalParameters;
+	
+	Engine( HashMap iCreationalParameters ) throws CCException
+	{
+		this.iCreationalParameters = iCreationalParameters;
+		String engineName = (String)iCreationalParameters.get(ENGINE_NAME);
+		if (engineName != null ) {
+			m_CCService = 
+				CCServiceFactory.newInstance().createCCService(engineName);			
+		} else {
+			m_CCService = 
+				CCServiceFactory.newInstance().createCCService();
+		}
+		m_data = getService().getEngineData();
+	}
+	
+	ICCService getService()
+	{
+		return m_CCService;
+	}
+	
+	
+	public void pause() throws CCException
+	{
+		getService().pauseEngine();
+	}
+
+	public void resume() throws CCException
+	{
+		getService().resumeEngine();
+	}
+	
+	public EngineState getState() throws CCException
+	{
+		return m_data.getState();
+	}
+	
+	public Collection getDefinitions() throws CCException
+	{
+		Collection defData = getService().getDefinitionData();
+		Iterator defDataIter = defData.iterator();
+		LinkedList definitions = new LinkedList();
+		while( defDataIter.hasNext())
+		{
+			Definition newDef = new Definition( getService(), this, ( DefinitionData ) 
+					( defDataIter.next()));
+			definitions.add(newDef);
+		}
+		return definitions;
+	}
+	
+	public void deployBundle(IBundle source) throws CCException
+	{
+		// TODO: We should really move this deployment in closer to the
+		// core of the engine.  For now simply forward the request
+		// to the existing interfaces.
+//		Collection keys;
+		try
+		{ 
+			EventDirector eventDirector;
+			if ( iCreationalParameters != null && 
+					iCreationalParameters.get(ENGINE_NAME) != null ) {
+				eventDirector = EventDirectorFactory
+					.createEventDirectorCached((String)iCreationalParameters.get(ENGINE_NAME));
+			} else {
+				eventDirector = EventDirectorFactory
+				.createEventDirectorCached();		
+			}
+			
+			if ( source instanceof IBPELBundle )
+			{
+				IBPELBundle bpelBundle = ( IBPELBundle ) ( source );
+				IDeployer deployer = eventDirector.getDeployer(DeployTypeEnum.BPEL);
+				if ( bpelBundle.isStream() ) {
+					deployer.loadDefinition(bpelBundle.getAsInputStream(), false);
+				} 
+				else 
+				{
+					deployer.loadDefinition(bpelBundle.getResourcePath(), false);
+				}
+			}
+			else
+			{
+				throw new UnsupportedBundleException();
+			}
+		}
+		catch (BPException e)
+		{
+			throw new CCException(e);
+		}
+	}
+	
+	public void cleanupNow() throws CCException
+	{
+		getService().cleanupNow();
+	}
+	
+	public IInstance getInstance(String iInstanceID) throws CCException
+	{
+		InstanceData instanceData =  
+			getService().getInstanceData( iInstanceID );
+		DefinitionData dd = 
+			getService().getDefinitionForInstance( iInstanceID );
+		Definition def = new Definition( getService(), this, dd );
+		Instance instance = new Instance(getService(), 
+				def, instanceData);
+		return instance;
+	}
+
+	
+	public String getName() throws CCException
+	{
+		String engineName = m_data.getName();
+		return engineName;
+	}
+	
+	public String getID() throws CCException
+	{
+		String id = m_data.getID();
+		return id;
+	}
+
+	public IDefinition getDefinition(IDefinitionQuery query) throws CCException
+	{
+		// TODO: propagate the query structure down further into the CC layer.
+		String definitionName = 
+			query.getQueryProperties().
+			  getProperty(IDefinitionQuery.DEFINITION_NAME);
+		
+		DefinitionData defData = getService().getDefinitionData( definitionName );
+		Definition newDef = new Definition( getService(), this, defData );
+		return newDef;
+	}
+
+	public void cleanup(Date iCompletionDate) throws CCException
+	{
+		getService().cleanCompletedSince( iCompletionDate );
+		
+	}
+
+	public void setAutomaticCleanup(boolean iAutomaticCleanup) throws CCException
+	{
+		getService().setAutomaticCleanup( iAutomaticCleanup );
+		
+	}
+
+	public boolean getAutomaticCleanup()
+	{
+		// TODO Auto-generated method stub
+		return m_data.getAutomaticCleanup();
+	}
+
+	public Map getStatistics() throws CCException
+	{
+		Map statistics = getService().getEngineStatistics( m_data);
+		return statistics;
+	}
+
+    public boolean isBootstrapped() throws CCException
+    {
+        Collection defs = getDefinitions();
+        if ( defs.size() > 0 )
+        {
+            return true;
+        }
+        else
+        {
+            return false;
+        }      
+    }
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/EngineFactory.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/EngineFactory.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/EngineFactory.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/EngineFactory.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.cc.client.impl;
+
+import java.util.HashMap;
+
+import org.apache.ode.cc.client.CCException;
+import org.apache.ode.cc.client.IEngine;
+
+public class EngineFactory
+{
+	public static IEngine createEngine(HashMap iCreationalParameters)
+	  throws CCException
+	{
+		return new Engine( iCreationalParameters );
+	}
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/Instance.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/Instance.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/Instance.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/Instance.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,107 @@
+/*
+ * 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.client.impl;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Map;
+
+import org.apache.ode.cc.client.CCException;
+import org.apache.ode.cc.client.IDefinition;
+import org.apache.ode.cc.client.IInstance;
+import org.apache.ode.cc.client.IScope;
+import org.apache.ode.cc.client.InstanceState;
+import org.apache.ode.cc.data.InstanceData;
+import org.apache.ode.cc.data.RegistrationData;
+import org.apache.ode.cc.data.ScopeData;
+import org.apache.ode.cc.service.ICCService;
+
+
+public class Instance extends ServiceNode implements IInstance
+{
+	IDefinition m_definition;
+	InstanceData m_data;
+	
+	public Instance(ICCService service, Definition definition, 
+			InstanceData instanceData)
+	{
+		super( service );
+		m_definition = definition;
+		m_data = instanceData;
+	}
+	public void pause() throws CCException
+	{
+		getService().pauseInstance( m_data );
+	}
+	public void terminate() throws CCException
+	{
+		getService().terminateInstance(m_data);
+	}
+	public void resume() throws CCException
+	{
+		getService().resumeInstance(m_data);
+	}
+	public void remove() throws CCException
+	{
+		getService().removeInstance( m_data );
+	}
+	public InstanceState getState() throws CCException
+	{
+		return m_data.getState();
+	}
+	public String getID() throws CCException
+	{
+		return m_data.getID();
+	}
+	public IDefinition getDefinition() throws CCException
+	{
+		return m_definition;
+	}
+	public IScope getRootContext() throws CCException
+	{
+		ScopeData cdata = getService().getContextScopeData
+		  (m_data);
+		if ( cdata == null ) { return null; }
+		Scope newScope = new Scope( getService(), this, 
+			cdata);
+		return newScope;
+	}
+	public Collection getRegistrations() throws CCException
+	{
+		Collection registrations = 
+			getService().getRegistrations( m_data );
+		
+		LinkedList regList = new LinkedList();
+		Iterator iter = registrations.iterator();
+		while( iter.hasNext() )
+		{
+			RegistrationData rd = ( RegistrationData )
+			  ( iter.next() );
+			Registration newRegistration = 
+				new Registration( this, rd );
+			regList.add( newRegistration );
+		}
+		return regList;
+	}
+	public Map getStatistics() throws CCException
+	{
+		Map statistics = 
+			getService().getInstanceStatistics( m_data );
+		return statistics;
+	}
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/Part.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/Part.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/Part.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/Part.java Tue Feb 28 08:31:48 2006
@@ -0,0 +1,50 @@
+/*
+ * 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.client.impl;
+
+import org.apache.ode.cc.client.CCException;
+import org.apache.ode.cc.client.IVariable;
+import org.apache.ode.cc.client.IVariablePart;
+import org.apache.ode.cc.data.PartData;
+import org.apache.ode.cc.service.ICCService;
+
+
+public class Part extends ServiceNode implements IVariablePart
+{
+	private PartData m_data;
+	private IVariable m_variable;
+	public Part( ICCService iService, IVariable iVariable, PartData iData )
+	{
+		super( iService );
+		m_variable = iVariable;
+		m_data = iData;
+	}
+	public Object getValue() throws CCException
+	{
+		Object object = getService().getPartValue(
+				m_data);
+		return object;
+	}
+	public String getName() throws CCException
+	{
+		return m_data.getName();
+	}
+	public IVariable getVariable() throws CCException
+	{
+		return m_variable;
+	}
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/ProcessCreatingOperation.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/ProcessCreatingOperation.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/ProcessCreatingOperation.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/ProcessCreatingOperation.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.client.impl;
+
+import org.apache.ode.cc.client.IProcessCreatingOperation;
+import org.apache.ode.cc.data.OperationData;
+
+
+public class ProcessCreatingOperation implements 
+  IProcessCreatingOperation 
+{
+    private OperationData m_data;
+    public ProcessCreatingOperation( OperationData data )
+    {
+        m_data = data;
+    }
+
+    public String getPortType()
+    {
+        return m_data.getPortType();
+    }
+
+    public String getOperationName()
+    {
+        return m_data.getOperation();
+    }
+
+    public String getPortTypeNamespace()
+    {
+        return m_data.getPortTypeNamespace();
+    }
+
+    public String getStaticKey()
+    {
+        return m_data.getStaticKey();
+    }
+
+}

Added: incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/Registration.java
URL: http://svn.apache.org/viewcvs/incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/Registration.java?rev=381694&view=auto
==============================================================================
--- incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/Registration.java (added)
+++ incubator/ode/scratch/ode/src/main/java/org/apache/ode/cc/client/impl/Registration.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.cc.client.impl;
+
+import org.apache.ode.cc.client.IInstance;
+import org.apache.ode.cc.client.IRegistration;
+import org.apache.ode.cc.data.RegistrationData;
+
+
+public class Registration implements IRegistration
+{
+	private RegistrationData m_data;
+	private IInstance m_instance;
+	
+	public Registration( IInstance iInstance, 
+			RegistrationData iData)
+	{
+		m_instance = iInstance;
+		m_data = iData;
+	}
+	public String getPortType()
+	{
+		return m_data.getPortType();
+	}
+	public String getOperation()
+	{
+		return m_data.getOperation();
+	}
+	public String getTargetNamespace()
+	{
+		return m_data.getTargetNamespace();
+	}
+	public String getDynamicKey()
+	{
+		return m_data.getDynamicKey();
+	}
+	public IInstance getInstance()
+	{
+		return m_instance;
+	}
+	public String getName()
+	{
+		return m_data.getName();
+	}
+}