oodt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfos...@apache.org
Subject svn commit: r1052147 [8/12] - in /oodt/branches/wengine-branch/wengine: ./ src/ src/main/ src/main/assembly/ src/main/bin/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/oodt/ src/main/java/org/apache/oodt/cas/ src...
Date Thu, 23 Dec 2010 02:47:22 GMT
Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServer.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServer.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServer.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServer.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,466 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.oodt.cas.workflow.server.channel.rmi;
+
+//JDK imports
+import java.lang.management.ManagementFactory;
+import java.rmi.Naming;
+import java.rmi.RemoteException;
+import java.rmi.registry.LocateRegistry;
+import java.rmi.server.UnicastRemoteObject;
+import java.util.Comparator;
+import java.util.Map;
+import java.util.logging.Level;
+
+//JAVAX imports
+import javax.management.MBeanServer;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+
+//OODT imports
+import org.apache.oodt.cas.catalog.page.PageInfo;
+import org.apache.oodt.cas.catalog.query.QueryExpression;
+import org.apache.oodt.cas.metadata.Metadata;
+import org.apache.oodt.cas.workflow.event.WorkflowEngineEvent;
+import org.apache.oodt.cas.workflow.model.WorkflowGraph;
+import org.apache.oodt.cas.workflow.page.PageFilter;
+import org.apache.oodt.cas.workflow.page.QueryPage;
+import org.apache.oodt.cas.workflow.page.QueuePage;
+import org.apache.oodt.cas.workflow.priority.Priority;
+import org.apache.oodt.cas.workflow.server.channel.AbstractCommunicationChannelServer;
+import org.apache.oodt.cas.workflow.state.WorkflowState;
+
+/**
+ * 
+ * @author bfoster
+ *
+ */
+public class RmiCommunicationChannelServer extends AbstractCommunicationChannelServer implements RmiCommunicationChannelServerInterface, RmiCommunicationChannelServerMBean {
+
+	private String name;
+    private MBeanServer mbs;
+    private ObjectName objName;
+    
+	public RmiCommunicationChannelServer(int port, String name) throws MalformedObjectNameException, NullPointerException {
+		this.port = port;
+		this.name = name;
+	}
+
+	public void startup() throws Exception {
+
+		//register JMX
+        try {
+        	this.objName = new ObjectName(
+                    "org.apache.oodt.cas.workflow.server.channel.rmi:type=RmiCommunicationChannelServer");
+            LocateRegistry.createRegistry(this.port);
+            mbs = ManagementFactory.getPlatformMBeanServer();
+            mbs.registerMBean(this, objName);
+        } catch (Exception e) {
+            LOG.log(Level.SEVERE,
+                    "Failed to register DaemonLauncher as a MBean Object : "
+                            + e.getMessage(), e);
+        }
+		
+        //bind RMI
+		try {
+			Naming.bind("//localhost:" + this.port + "/" + name, UnicastRemoteObject.exportObject(this, this.port));
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new RemoteException("Failed to bind Workflow Engine to RMI registry at port "
+					+ this.port);
+		}		
+
+	}
+	
+	public int getPort() {
+		return this.port;
+	}
+
+	public void rmi_shutdown() throws RemoteException {
+		try {
+			this.shutdown();
+			Naming.unbind("//localhost:" + this.port + "/" + this.name);
+			this.mbs.unregisterMBean(this.objName);
+	        UnicastRemoteObject.unexportObject(this, true);
+			this.mbs = null;
+			this.objName = null;
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+	}
+	
+	public void rmi_pauseRunner() throws RemoteException {
+		try {
+			this.pauseRunner();
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+	}
+	
+	public void rmi_resumeRunner() throws RemoteException {
+		try {
+			this.resumeRunner();
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+	}
+	
+	public String rmi_getLaunchDate() throws RemoteException {
+		try {
+			return this.serializer.serializeObject(this.getLaunchDate());
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+	}
+	
+    public String rmi_startWorkflow_WithModel(String workflow, String metadata) throws RemoteException {
+		try {
+			return this.startWorkflow(this.serializer.deserializeObject(WorkflowGraph.class, workflow), this.serializer.deserializeObject(Metadata.class, metadata));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+
+    public String rmi_startWorkflow_WithModel(String workflow, String metadata, String priority) throws RemoteException {
+		try {
+			return this.startWorkflow(this.serializer.deserializeObject(WorkflowGraph.class, workflow), this.serializer.deserializeObject(Metadata.class, metadata), this.serializer.deserializeObject(Priority.class, priority));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+
+    public String rmi_startWorkflow_WithModelId(String modelId, String inputMetadata) throws RemoteException {
+		try {
+			return this.startWorkflow(modelId, this.serializer.deserializeObject(Metadata.class, inputMetadata));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+
+    public String rmi_startWorkflow_WithModelId(String modelId, String inputMetadata, String priority) throws RemoteException {
+		try {
+			return this.startWorkflow(modelId, this.serializer.deserializeObject(Metadata.class, inputMetadata), this.serializer.deserializeObject(Priority.class, priority));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+
+    public void rmi_deleteWorkflow(String instanceId) throws RemoteException {
+		try {
+			this.deleteWorkflow(instanceId);
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+    
+    public void rmi_stopWorkflow(String instanceId) throws RemoteException {
+		try {
+			this.stopWorkflow(instanceId);
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+
+    public void rmi_pauseWorkflow(String instanceId) throws RemoteException {
+		try {
+			this.pauseWorkflow(instanceId);
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+
+    public void rmi_resumeWorkflow(String instanceId) throws RemoteException {
+		try {
+			this.resumeWorkflow(instanceId);
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+    
+    public String rmi_getModel(String modelId) throws RemoteException {
+		try {
+			return this.serializer.serializeObject(this.getModel(modelId));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+
+    public String rmi_getWorkflowGraph(String modelId) throws RemoteException {
+		try {
+			return this.serializer.serializeObject(this.getWorkflowGraph(modelId));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+    
+    public String rmi_getSupportedProcessorIds() throws RemoteException {
+		try {
+			return this.serializer.serializeObject(this.getSupportedProcessorIds());
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+    
+    public String rmi_getModels() throws RemoteException {
+		try {
+			return this.serializer.serializeObject(this.getModels());
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+    
+    public String rmi_getWorkflowGraphs() throws RemoteException {
+		try {
+			return this.serializer.serializeObject(this.getWorkflowGraphs());
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+    
+    public String rmi_getProcessorInfo(String instanceId, String modelId) throws RemoteException {
+		try {
+			return this.serializer.serializeObject(this.getProcessorInfo(instanceId, modelId));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+
+    public String rmi_getInstanceRepository() throws RemoteException {
+		try {
+			return this.serializer.serializeObject(this.getInstanceRepository());
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+
+    public void rmi_updateWorkflowMetadata(String instanceId, String modelId, String metadata) throws RemoteException {
+		try {
+			this.updateWorkflowMetadata(instanceId, modelId, this.serializer.deserializeObject(Metadata.class, metadata));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+    
+    public void rmi_updateInstanceMetadata(String jobId, String metadata) throws RemoteException {
+		try {
+			this.updateInstanceMetadata(jobId, this.serializer.deserializeObject(Metadata.class, metadata));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+
+    public void rmi_updateWorkflowAndInstance(String instanceId, String modelId, String state, String metadata, String jobId, String instanceMetadata) throws RemoteException {
+		try {
+			this.updateWorkflowAndInstance(instanceId, modelId, this.serializer.deserializeObject(WorkflowState.class, state), this.serializer.deserializeObject(Metadata.class, metadata), jobId, this.serializer.deserializeObject(Metadata.class, instanceMetadata));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+    
+    public void rmi_setWorkflowState(String instanceId, String modelId, String state) throws RemoteException {
+		try {
+			this.setWorkflowState(instanceId, modelId, this.serializer.deserializeObject(WorkflowState.class, state));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+
+    public void rmi_setWorkflowPriority(String instanceId, String modelId, String priority) throws RemoteException {
+		try {
+			this.setWorkflowPriority(instanceId, modelId, this.serializer.deserializeObject(Priority.class, priority));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+    
+    public String rmi_getWorkflowMetadata(String instanceId, String modelId) throws RemoteException {
+		try {
+			return this.serializer.serializeObject(this.getWorkflowMetadata(instanceId, modelId));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+    
+    public String rmi_getInstanceMetadata(String jobId) throws RemoteException {
+		try {
+			return this.serializer.serializeObject(this.getInstanceMetadata(jobId));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+            
+    public void rmi_registerEvent(String event) throws RemoteException {
+		try {
+			this.registerEvent(this.serializer.deserializeObject(WorkflowEngineEvent.class, event));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+    
+    public void rmi_triggerEvent(String eventId, String inputMetadata) throws RemoteException {
+		try {
+			this.triggerEvent(eventId, this.serializer.deserializeObject(Metadata.class, inputMetadata));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+    
+    public String rmi_getRegisteredEvents() throws RemoteException {
+		try {
+			return this.serializer.serializeObject(this.getRegisteredEvents());
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+    
+    public String rmi_getSupportedStates() throws RemoteException {
+		try {
+			return this.serializer.serializeObject(this.getSupportedStates());
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+    
+    public String rmi_getNumOfLoadedProcessors() throws RemoteException {
+		try {
+			return this.serializer.serializeObject(new Integer(this.getNumOfLoadedProcessors()));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+    
+    public String rmi_getNumOfWorkflows() throws RemoteException {
+		try {
+			return this.serializer.serializeObject(new Integer(this.getNumOfWorkflows()));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+    
+    public String rmi_getExecutingPage(String pageInfo) throws RemoteException {
+		try {
+			return this.serializer.serializeObject(this.getExecutingPage(this.serializer.deserializeObject(PageInfo.class, pageInfo)));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+
+    public String rmi_getRunnablesPage(String pageInfo) throws RemoteException {
+		try {
+			return this.serializer.serializeObject(this.getRunnablesPage(this.serializer.deserializeObject(PageInfo.class, pageInfo)));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+    
+    public String rmi_getPage(String pageInfo) throws RemoteException {
+		try {
+			return this.serializer.serializeObject(this.getPage(this.serializer.deserializeObject(PageInfo.class, pageInfo)));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+
+    public String rmi_getPage_WithFilter(String pageInfo, String filter) throws RemoteException {
+		try {
+			return this.serializer.serializeObject(this.getPage(this.serializer.deserializeObject(PageInfo.class, pageInfo), this.serializer.deserializeObject(PageFilter.class, filter)));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+    
+    public String rmi_getPage_WithComparator(String pageInfo, String comparator) throws RemoteException {
+		try {
+			return this.serializer.serializeObject(this.getPage(this.serializer.deserializeObject(PageInfo.class, pageInfo), this.serializer.deserializeObject(Comparator.class, comparator)));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+     
+    public String rmi_getPage_WithState(String pageInfo, String state) throws RemoteException {
+		try {
+			return this.serializer.serializeObject(this.getPage(this.serializer.deserializeObject(PageInfo.class, pageInfo), this.serializer.deserializeObject(WorkflowState.class, state)));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+
+    public String rmi_getPage_WithCategory(String pageInfo, String category) throws RemoteException {
+		try {
+			return this.serializer.serializeObject(this.getPage(this.serializer.deserializeObject(PageInfo.class, pageInfo), this.serializer.deserializeObject(WorkflowState.Category.class, category)));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+
+    public String rmi_getPage_WithModelId(String pageInfo, String modelId) throws RemoteException {
+		try {
+			return this.serializer.serializeObject(this.getPage(this.serializer.deserializeObject(PageInfo.class, pageInfo), modelId));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+
+    public String rmi_getPage_WithMap(String pageInfo, String keyValPairs) throws RemoteException {
+		try {
+			return this.serializer.serializeObject(this.getPage(this.serializer.deserializeObject(PageInfo.class, pageInfo), this.serializer.deserializeObject(Map.class, keyValPairs)));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+    
+    public String rmi_getNextQueuePage(String page) throws RemoteException {
+		try {
+			return this.serializer.serializeObject(this.getNextPage(this.serializer.deserializeObject(QueuePage.class, page)));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+    
+    public String rmi_getWorkflow(String instanceId) throws RemoteException {
+		try {
+			return this.serializer.serializeObject(this.getWorkflow(instanceId));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+    }
+    
+	public String rmi_getNextQueryPage(String page) throws RemoteException {
+		try {
+			return this.serializer.serializeObject(this.getNextPage(this.serializer.deserializeObject(QueryPage.class, page)));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+	}
+	
+	public String rmi_getQueryPage(String pageInfo, String queryExpression) throws RemoteException {
+		try {
+			return this.serializer.serializeObject(this.getPage(this.serializer.deserializeObject(PageInfo.class, pageInfo), this.serializer.deserializeObject(QueryExpression.class, queryExpression)));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+	}
+	
+	public String rmi_getMetadata(String page) throws RemoteException {
+		try {
+			return this.serializer.serializeObject(this.getMetadata(this.serializer.deserializeObject(QueryPage.class, page)));
+		}catch (Exception e) {
+			throw new RemoteException(e.getMessage(), e);
+		}
+	}
+	
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServerFactory.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServerFactory.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServerFactory.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServerFactory.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.oodt.cas.workflow.server.channel.rmi;
+
+//JDK imports
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+//OODT imports
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineFactory;
+import org.apache.oodt.cas.workflow.server.channel.CommunicationChannelServerFactory;
+
+/**
+ * 
+ * @author bfoster
+ *
+ */
+public class RmiCommunicationChannelServerFactory implements
+		CommunicationChannelServerFactory {
+
+	private static final Logger LOG = Logger.getLogger(RmiCommunicationChannelServerFactory.class.getName());
+	
+	private int port;
+	private String name;
+	private WorkflowEngineFactory workflowEngineFactory;
+	
+	public RmiCommunicationChannelServer createCommunicationChannelServer() {
+		try {
+			RmiCommunicationChannelServer rmiServer = new RmiCommunicationChannelServer(this.port, this.name);
+			rmiServer.setWorkflowEngine(workflowEngineFactory.createEngine());
+			return rmiServer;
+		}catch (Exception e) {
+			LOG.log(Level.SEVERE, "Failed to create RMI server channel : " + e.getMessage(), e);
+			return null;
+		}
+	}
+
+	public int getPort() {
+		return this.port;
+	}
+
+	public void setPort(int port) {
+		this.port = port;
+	}
+	
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public void setWorkflowEngineFactory(
+			WorkflowEngineFactory workflowEngineFactory) {
+		this.workflowEngineFactory = workflowEngineFactory;
+	}
+
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServerInterface.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServerInterface.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServerInterface.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServerInterface.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,122 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.oodt.cas.workflow.server.channel.rmi;
+
+//JDK imports
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+/**
+ * 
+ * @author bfoster
+ *
+ */
+public interface RmiCommunicationChannelServerInterface extends Remote {
+
+	public void rmi_shutdown() throws RemoteException;
+	
+	public void rmi_pauseRunner() throws RemoteException;
+	
+	public void rmi_resumeRunner() throws RemoteException;
+	
+	public String rmi_getLaunchDate() throws RemoteException;
+	
+    public String rmi_startWorkflow_WithModel(String workflow, String metadata) throws RemoteException;
+
+    public String rmi_startWorkflow_WithModel(String workflow, String metadata, String priority) throws RemoteException;
+
+    public String rmi_startWorkflow_WithModelId(String modelId, String inputMetadata) throws RemoteException;
+
+    public String rmi_startWorkflow_WithModelId(String modelId, String inputMetadata, String priority) throws RemoteException;
+
+    public void rmi_deleteWorkflow(String instanceId) throws RemoteException;
+    
+    public void rmi_stopWorkflow(String instanceId) throws RemoteException;
+
+    public void rmi_pauseWorkflow(String instanceId) throws RemoteException;
+
+    public void rmi_resumeWorkflow(String instanceId) throws RemoteException;
+    
+    public String rmi_getModel(String modelId) throws RemoteException;
+
+    public String rmi_getWorkflowGraph(String modelId) throws RemoteException;
+    
+    public String rmi_getSupportedProcessorIds() throws RemoteException;
+    
+    public String rmi_getModels() throws RemoteException;
+    
+    public String rmi_getWorkflowGraphs() throws RemoteException;
+    
+    public String rmi_getProcessorInfo(String instanceId, String modelId) throws RemoteException;
+
+    public String rmi_getInstanceRepository() throws RemoteException;
+
+    public void rmi_updateWorkflowMetadata(String instanceId, String modelId, String metadata) throws RemoteException;
+    
+    public void rmi_updateInstanceMetadata(String jobId, String metadata) throws RemoteException;
+
+    public void rmi_updateWorkflowAndInstance(String instanceId, String modelId, String state, String metadata, String jobId, String instanceMetadata) throws RemoteException;
+
+    public void rmi_setWorkflowState(String instanceId, String modelId, String state) throws RemoteException;
+
+    public void rmi_setWorkflowPriority(String instanceId, String modelId, String priority) throws RemoteException;
+    
+    public String rmi_getWorkflowMetadata(String instanceId, String modelId) throws RemoteException;
+    
+    public String rmi_getInstanceMetadata(String jobId) throws RemoteException;
+            
+    public void rmi_registerEvent(String event) throws RemoteException;
+    
+    public void rmi_triggerEvent(String eventId, String inputMetadata) throws RemoteException;
+    
+    public String rmi_getRegisteredEvents() throws RemoteException;
+    
+    public String rmi_getSupportedStates() throws RemoteException;
+    
+    public String rmi_getNumOfLoadedProcessors() throws RemoteException;
+    
+    public String rmi_getNumOfWorkflows() throws RemoteException;
+    
+    public String rmi_getExecutingPage(String pageInfo) throws RemoteException;
+
+    public String rmi_getRunnablesPage(String pageInfo) throws RemoteException;
+    
+    public String rmi_getPage(String pageInfo) throws RemoteException;
+
+    public String rmi_getPage_WithFilter(String pageInfo, String filter) throws RemoteException;
+    
+    public String rmi_getPage_WithComparator(String pageInfo, String comparator) throws RemoteException;
+     
+    public String rmi_getPage_WithState(String pageInfo, String state) throws RemoteException ;
+
+    public String rmi_getPage_WithCategory(String pageInfo, String category) throws RemoteException;
+
+    public String rmi_getPage_WithModelId(String pageInfo, String modelId) throws RemoteException;
+
+    public String rmi_getPage_WithMap(String pageInfo, String keyValPairs) throws RemoteException;
+    
+    public String rmi_getNextQueuePage(String page) throws RemoteException;
+    
+    public String rmi_getWorkflow(String instanceId) throws RemoteException;
+    
+	public String rmi_getNextQueryPage(String page) throws RemoteException;
+	
+	public String rmi_getQueryPage(String pageInfo, String queryExpression) throws RemoteException;
+	
+	public String rmi_getMetadata(String page) throws RemoteException;
+	
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServerMBean.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServerMBean.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServerMBean.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/rmi/RmiCommunicationChannelServerMBean.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,141 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.oodt.cas.workflow.server.channel.rmi;
+
+//OODT imports
+import org.apache.oodt.cas.catalog.page.PageInfo;
+import org.apache.oodt.cas.catalog.query.QueryExpression;
+import org.apache.oodt.cas.metadata.Metadata;
+import org.apache.oodt.cas.workflow.event.WorkflowEngineEvent;
+import org.apache.oodt.cas.workflow.instance.repo.WorkflowInstanceRepository;
+import org.apache.oodt.cas.workflow.model.WorkflowGraph;
+import org.apache.oodt.cas.workflow.model.WorkflowModel;
+import org.apache.oodt.cas.workflow.page.PageFilter;
+import org.apache.oodt.cas.workflow.page.QueryPage;
+import org.apache.oodt.cas.workflow.page.QueuePage;
+import org.apache.oodt.cas.workflow.page.RunnablesPage;
+import org.apache.oodt.cas.workflow.priority.Priority;
+import org.apache.oodt.cas.workflow.processor.ProcessorInfo;
+import org.apache.oodt.cas.workflow.processor.ProcessorSkeleton;
+import org.apache.oodt.cas.workflow.processor.ProcessorStub;
+import org.apache.oodt.cas.workflow.state.WorkflowState;
+
+//JDK imports
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * 
+ * @author bfoster
+ *
+ */
+public interface RmiCommunicationChannelServerMBean {
+
+	public void shutdown() throws Exception;
+	
+	public void pauseRunner() throws Exception;
+	
+	public void resumeRunner() throws Exception;
+	
+	public Date getLaunchDate() throws Exception;
+	
+    public String startWorkflow(WorkflowGraph workflow, Metadata inputMetadata) throws Exception;
+
+    public String startWorkflow(WorkflowGraph workflow, Metadata inputMetadata, Priority priority) throws Exception;
+
+    public String startWorkflow(String modelId, Metadata inputMetadata) throws Exception;
+
+    public String startWorkflow(String modelId, Metadata inputMetadata, Priority priority) throws Exception;
+    
+    public void deleteWorkflow(String instanceId) throws Exception;
+    
+    public void stopWorkflow(String instanceId) throws Exception;
+
+    public void pauseWorkflow(String instanceId) throws Exception;
+
+    public void resumeWorkflow(String instanceId) throws Exception;
+    
+    public WorkflowModel getModel(String modelId) throws Exception;
+    
+    public Set<String> getSupportedProcessorIds() throws Exception;
+    
+    public List<WorkflowModel> getModels() throws Exception;
+    
+    public WorkflowGraph getWorkflowGraph(String modelId) throws Exception;
+
+    public List<WorkflowGraph> getWorkflowGraphs() throws Exception;
+    
+    public WorkflowInstanceRepository getInstanceRepository() throws Exception;
+
+    public ProcessorInfo getProcessorInfo(String instanceId, String modelId) throws Exception;
+    
+    public void updateWorkflowMetadata(String instanceId, String modelId, Metadata metadata) throws Exception;
+    
+    public void updateInstanceMetadata(String jobId, Metadata metadata) throws Exception;
+
+    public void setWorkflowState(String instanceId, String modelId, WorkflowState state) throws Exception;
+
+    public void setWorkflowPriority(String instanceId, String modelId, Priority priority) throws Exception;
+    
+    public Metadata getWorkflowMetadata(String instanceId, String modelId) throws Exception;
+    
+    public Metadata getInstanceMetadata(String jobId) throws Exception;
+        
+    public void registerEvent(WorkflowEngineEvent event) throws Exception;
+    
+    public void triggerEvent(String eventId, Metadata inputMetadata) throws Exception;
+    
+    public List<WorkflowEngineEvent> getRegisteredEvents() throws Exception;
+    
+    public List<WorkflowState> getSupportedStates() throws Exception;
+
+    public int getNumOfLoadedProcessors() throws Exception;
+    
+    public int getNumOfWorkflows() throws Exception;
+
+    public RunnablesPage getExecutingPage(PageInfo pageInfo) throws Exception;
+
+    public RunnablesPage getRunnablesPage(PageInfo pageInfo) throws Exception;
+    
+    public QueuePage getPage(PageInfo pageInfo) throws Exception;
+
+    public QueuePage getPage(PageInfo pageInfo, PageFilter filter) throws Exception;
+
+    public QueuePage getPage(PageInfo pageInfo, Comparator<ProcessorStub> comparator) throws Exception;
+     
+    public QueuePage getPage(PageInfo pageInfo, WorkflowState state) throws Exception;
+
+    public QueuePage getPage(PageInfo pageInfo, WorkflowState.Category category) throws Exception;
+
+    public QueuePage getPage(PageInfo pageInfo, String modelId) throws Exception;
+
+    public QueuePage getPage(PageInfo pageInfo, Map<String, List<String>> keyValPairs) throws Exception;
+    
+    public QueuePage getNextPage(QueuePage page) throws Exception;
+
+    public ProcessorSkeleton getWorkflow(String instanceId) throws Exception;
+
+	public QueryPage getNextPage(QueryPage page) throws Exception;
+	
+	public QueryPage getPage(PageInfo pageInfo, QueryExpression queryExpression) throws Exception;
+	
+	public List<Metadata> getMetadata(QueryPage page) throws Exception;
+	
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/xmlrpc/XmlRpcCommunicationChannelClient.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/xmlrpc/XmlRpcCommunicationChannelClient.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/xmlrpc/XmlRpcCommunicationChannelClient.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/xmlrpc/XmlRpcCommunicationChannelClient.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,414 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.oodt.cas.workflow.server.channel.xmlrpc;
+
+//JDK imports
+import java.io.IOException;
+import java.net.URL;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Vector;
+
+//APACHE imports
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.HttpMethodRetryHandler;
+import org.apache.commons.httpclient.params.HttpMethodParams;
+import org.apache.xmlrpc.CommonsXmlRpcTransport;
+import org.apache.xmlrpc.XmlRpcClient;
+import org.apache.xmlrpc.XmlRpcClientException;
+import org.apache.xmlrpc.XmlRpcTransport;
+import org.apache.xmlrpc.XmlRpcTransportFactory;
+
+//OODT imports
+import org.apache.oodt.cas.catalog.page.PageInfo;
+import org.apache.oodt.cas.catalog.query.QueryExpression;
+import org.apache.oodt.cas.metadata.Metadata;
+import org.apache.oodt.cas.workflow.event.WorkflowEngineEvent;
+import org.apache.oodt.cas.workflow.instance.repo.WorkflowInstanceRepository;
+import org.apache.oodt.cas.workflow.model.WorkflowGraph;
+import org.apache.oodt.cas.workflow.model.WorkflowModel;
+import org.apache.oodt.cas.workflow.page.PageFilter;
+import org.apache.oodt.cas.workflow.page.QueryPage;
+import org.apache.oodt.cas.workflow.page.QueuePage;
+import org.apache.oodt.cas.workflow.page.RunnablesPage;
+import org.apache.oodt.cas.workflow.priority.Priority;
+import org.apache.oodt.cas.workflow.processor.ProcessorInfo;
+import org.apache.oodt.cas.workflow.processor.ProcessorSkeleton;
+import org.apache.oodt.cas.workflow.processor.ProcessorStub;
+import org.apache.oodt.cas.workflow.server.channel.AbstractCommunicationChannelClient;
+import org.apache.oodt.cas.workflow.state.WorkflowState;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * XML-RPC communication channel client
+ * <p>
+ */
+public class XmlRpcCommunicationChannelClient extends
+		AbstractCommunicationChannelClient {
+
+	protected XmlRpcClient client;
+	protected int chunkSize;
+	
+	public XmlRpcCommunicationChannelClient(final URL serverUrl, final int connectionTimeout, final int requestTimeout, final int chunkSize, final int connectionRetries, final int connectionRetryIntervalSecs) {
+		super();
+		XmlRpcTransportFactory transportFactory = new XmlRpcTransportFactory() {
+
+			public XmlRpcTransport createTransport()
+					throws XmlRpcClientException {
+				HttpClient client = new HttpClient();
+				client.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, 
+						new HttpMethodRetryHandler() {
+
+					public boolean retryMethod(HttpMethod method, IOException e,
+							int count) {
+			    		if (count < connectionRetries) {
+			    			try {
+			    				Thread.sleep(connectionRetryIntervalSecs * 1000);
+			    				return true;
+			    			}catch (Exception e1) {}
+			    		}
+			    		return false;
+					}
+		        	
+		        });
+				CommonsXmlRpcTransport transport = new CommonsXmlRpcTransport(serverUrl, client);
+				transport.setConnectionTimeout(connectionTimeout * 60 * 1000);
+				transport.setTimeout(requestTimeout * 60 * 1000);
+
+				return transport;
+			}
+
+			public void setProperty(String arg0, Object arg1) {}
+
+        };       
+		this.client = new XmlRpcClient(serverUrl, transportFactory);
+		this.chunkSize = chunkSize;
+	}
+	
+	public void shutdown() throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_shutdown", args);
+	}
+	
+	public void pauseRunner() throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_pauseRunner", args);
+	}
+	
+	public void resumeRunner() throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_resumeRunner", args);
+	}
+	
+	public Date getLaunchDate() throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		return this.serializer.deserializeObject(Date.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getLaunchDate", args));
+	}
+	
+	public void deleteWorkflow(String instanceId)
+			throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(instanceId);
+		this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_deleteWorkflow", args);
+	}
+
+	public Metadata getInstanceMetadata(String jobId) throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(jobId);
+		return this.serializer.deserializeObject(Metadata.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getInstanceMetadata", args));
+	}
+
+	public WorkflowInstanceRepository getInstanceRepository() throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		return this.serializer.deserializeObject(WorkflowInstanceRepository.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getInstanceRepository", args));
+	}
+	
+	public Set<String> getSupportedProcessorIds() throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		return this.serializer.deserializeObject(Set.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getSupportedProcessorIds", args));
+	}
+
+	public WorkflowModel getModel(String modelId) throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(modelId);
+		return this.serializer.deserializeObject(WorkflowModel.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getModel", args));
+	}
+
+	public List<WorkflowModel> getModels() throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		return this.serializer.deserializeObject(List.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getModels", args));
+	}
+	
+	public WorkflowGraph getWorkflowGraph(String modelId) throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(modelId);
+		return this.serializer.deserializeObject(WorkflowGraph.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getWorkflowGraph", args));
+	}
+
+	public List<WorkflowGraph> getWorkflowGraphs() throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		return this.serializer.deserializeObject(List.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getWorkflowGraphs", args));
+	}
+	
+    public ProcessorInfo getProcessorInfo(String instanceId, String modelId) throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(instanceId);
+		args.add(modelId);
+		return this.serializer.deserializeObject(ProcessorInfo.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getProcessorInfo", args));
+    }
+
+	public Metadata getWorkflowMetadata(String instanceId,
+			String modelId) throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(instanceId);
+		args.add(modelId);
+		return this.serializer.deserializeObject(Metadata.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getWorkflowMetadata", args));
+	}
+
+	public void pauseWorkflow(String instanceId)
+			throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(instanceId);
+		this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_pauseWorkflow", args);
+	}
+
+	public void resumeWorkflow(String instanceId)
+			throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(instanceId);
+		this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_resumeWorkflow", args);
+	}
+
+	public void setWorkflowState(String instanceId,
+			String modelId, WorkflowState state) throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(instanceId);
+		args.add(modelId);
+		args.add(this.serializer.serializeObject(state));
+		this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_setWorkflowState", args);
+	}
+	
+	public void setWorkflowPriority(String instanceId,
+			String modelId, Priority priority) throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(instanceId);
+		args.add(modelId);
+		args.add(this.serializer.serializeObject(priority));
+		this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_setWorkflowPriority", args);
+	}
+
+	public String startWorkflow(WorkflowGraph workflow, Metadata metadata)
+			throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(this.serializer.serializeObject(workflow));
+		args.add(this.serializer.serializeObject(metadata));
+		return (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_startWorkflow", args);
+	}
+
+    public String startWorkflow(WorkflowGraph workflow, Metadata metadata, Priority priority) throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(this.serializer.serializeObject(workflow));
+		args.add(this.serializer.serializeObject(metadata));
+		args.add(this.serializer.serializeObject(priority));
+		return (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_startWorkflow", args);
+    }
+    
+	public String startWorkflow(String modelId, Metadata inputMetadata)
+			throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(modelId);
+		args.add(this.serializer.serializeObject(inputMetadata));
+		return (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_startWorkflow2", args);
+	}
+	
+	public String startWorkflow(String modelId, Metadata inputMetadata, Priority priority) throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(modelId);
+		args.add(this.serializer.serializeObject(inputMetadata));
+		args.add(this.serializer.serializeObject(priority));
+		return (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_startWorkflow2", args);
+	}
+
+	public void stopWorkflow(String instanceId)
+			throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(instanceId);
+		this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_stopWorkflow", args);
+	}
+
+	public void updateInstanceMetadata(String jobId, Metadata metadata)
+			throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(jobId);
+		args.add(this.serializer.serializeObject(metadata));
+		this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_updateInstanceMetadata", args);
+	}
+
+	public void updateWorkflowMetadata(String instanceId,
+			String modelId, Metadata metadata) throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(instanceId);
+		args.add(modelId);
+		args.add(this.serializer.serializeObject(metadata));
+		this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_updateWorkflowMetadata", args);
+	}
+	
+	public void updateWorkflowAndInstance(String instanceId,
+			String modelId, WorkflowState state, Metadata metadata, String jobId, Metadata instanceMetadata) throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(instanceId);
+		args.add(modelId);
+		args.add(this.serializer.serializeObject(state));
+		args.add(this.serializer.serializeObject(metadata));
+		args.add(jobId);
+		args.add(this.serializer.serializeObject(instanceMetadata));
+		this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_updateWorkflowAndInstance", args);
+	}
+    
+    public void registerEvent(WorkflowEngineEvent event) throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(this.serializer.serializeObject(event));
+		this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_registerEvent", args);
+    }
+    
+    public void triggerEvent(String eventId, Metadata inputMetadata) throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(eventId);
+		args.add(this.serializer.serializeObject(inputMetadata));
+		this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_triggerEvent", args);
+    }
+    
+    public List<WorkflowEngineEvent> getRegisteredEvents() throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		return this.serializer.deserializeObject(List.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getRegisteredEvents", args));
+    }
+    
+    public List<WorkflowState> getSupportedStates() throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		return this.serializer.deserializeObject(List.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getSupportedStates", args));
+    }
+    
+    public int getNumOfLoadedProcessors() throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		return this.serializer.deserializeObject(Integer.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getNumOfLoadedProcessors", args));
+    }
+    
+    public int getNumOfWorkflows() throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		return this.serializer.deserializeObject(Integer.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getNumOfWorkflows", args));
+    }
+    
+    public RunnablesPage getExecutingPage(PageInfo pageInfo) throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(this.serializer.serializeObject(pageInfo));
+		return this.serializer.deserializeObject(RunnablesPage.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getExecutingPage", args));
+    }
+    
+    public RunnablesPage getRunnablesPage(PageInfo pageInfo) throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(this.serializer.serializeObject(pageInfo));
+		return this.serializer.deserializeObject(RunnablesPage.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getRunnablesPage", args));
+    }
+    
+    public QueuePage getPage(PageInfo pageInfo) throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(this.serializer.serializeObject(pageInfo));
+		return this.serializer.deserializeObject(QueuePage.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getPage", args));
+    }
+    
+    public QueuePage getPage(PageInfo pageInfo, PageFilter filter) throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(this.serializer.serializeObject(pageInfo));
+		args.add(this.serializer.serializeObject(filter));
+		return this.serializer.deserializeObject(QueuePage.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getPage_filtered", args));
+    }
+
+    public QueuePage getPage(PageInfo pageInfo, Comparator<ProcessorStub> comparator) throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(this.serializer.serializeObject(pageInfo));
+		args.add(this.serializer.serializeObject(comparator));
+		return this.serializer.deserializeObject(QueuePage.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getPage2", args));
+    }
+     
+    public QueuePage getPage(PageInfo pageInfo, WorkflowState state) throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(this.serializer.serializeObject(pageInfo));
+		args.add(this.serializer.serializeObject(state));
+		return this.serializer.deserializeObject(QueuePage.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getPage3", args));
+    }
+
+    public QueuePage getPage(PageInfo pageInfo, WorkflowState.Category category) throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(this.serializer.serializeObject(pageInfo));
+		args.add(this.serializer.serializeObject(category));
+		return this.serializer.deserializeObject(QueuePage.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getPage4", args));    	
+    }
+
+    public QueuePage getPage(PageInfo pageInfo, String modelId) throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(this.serializer.serializeObject(pageInfo));
+		args.add(modelId);
+		return this.serializer.deserializeObject(QueuePage.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getPage5", args));  
+    }
+    
+    public QueuePage getPage(PageInfo pageInfo, Map<String, List<String>> keyValPairs) throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(this.serializer.serializeObject(pageInfo));
+		args.add(this.serializer.serializeObject(keyValPairs));
+		return this.serializer.deserializeObject(QueuePage.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getPage7", args));  
+    }
+
+    public QueuePage getNextPage(QueuePage page) throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(this.serializer.serializeObject(page));
+		return this.serializer.deserializeObject(QueuePage.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getNextPage", args));  
+    }
+	
+    public ProcessorSkeleton getWorkflow(String instanceId) throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(instanceId);
+		return this.serializer.deserializeObject(ProcessorSkeleton.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getWorkflow", args));
+    }
+
+	public List<Metadata> getMetadata(QueryPage page) throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(this.serializer.serializeObject(page));
+		return this.serializer.deserializeObject(List.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getMetadata", args));
+	}
+
+	public QueryPage getNextPage(QueryPage page) throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(this.serializer.serializeObject(page));
+		return this.serializer.deserializeObject(QueryPage.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getNextPage2", args));
+	}
+
+	public QueryPage getPage(PageInfo pageInfo, QueryExpression queryExpression)
+			throws Exception {
+		Vector<Object> args = new Vector<Object>();
+		args.add(this.serializer.serializeObject(pageInfo));
+		args.add(this.serializer.serializeObject(queryExpression));
+		return this.serializer.deserializeObject(QueryPage.class, (String) this.client.execute(XmlRpcCommunicationChannelServer.class.getSimpleName() + ".xmlrpc_getPage6", args));
+	}
+	
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/xmlrpc/XmlRpcCommunicationChannelClientFactory.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/xmlrpc/XmlRpcCommunicationChannelClientFactory.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/xmlrpc/XmlRpcCommunicationChannelClientFactory.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/xmlrpc/XmlRpcCommunicationChannelClientFactory.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.oodt.cas.workflow.server.channel.xmlrpc;
+
+//JDK imports
+import java.net.URL;
+
+//OODT imports
+import org.apache.oodt.cas.workflow.server.channel.CommunicationChannelClientFactory;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Factory for creating XML-RPC communication channel client
+ * <p>
+ */
+public class XmlRpcCommunicationChannelClientFactory implements
+		CommunicationChannelClientFactory {
+
+	private String serverUrl = "http://localhost:9000";
+	private int connectionTimeout = 60;
+	private int requestTimeout = 90;
+	private int chunkSize = 1024;
+	private int connectionRetries = 3;
+	private int connectionRetryIntervalSecs = 0;
+	
+	public XmlRpcCommunicationChannelClient createCommunicationChannelClient() {
+		try {
+			return new XmlRpcCommunicationChannelClient(new URL(this.serverUrl), this.connectionTimeout, this.requestTimeout, this.chunkSize, this.connectionRetries, this.connectionRetryIntervalSecs);
+		}catch (Exception e) {
+			e.printStackTrace();
+			return null;
+		}
+	}
+
+	public String getServerUrl() {
+		return this.serverUrl;
+	}
+
+	public void setServerUrl(String serverUrl) {
+		this.serverUrl = serverUrl;
+	}
+
+	public int getConnectionTimeout() {
+		return connectionTimeout;
+	}
+
+	public void setConnectionTimeout(int connectionTimeout) {
+		this.connectionTimeout = connectionTimeout;
+	}
+
+	public int getRequestTimeout() {
+		return requestTimeout;
+	}
+
+	public void setRequestTimeout(int requestTimeout) {
+		this.requestTimeout = requestTimeout;
+	}
+
+	public int getChunkSize() {
+		return chunkSize;
+	}
+
+	public void setChunkSize(int chunkSize) {
+		this.chunkSize = chunkSize;
+	}
+
+	public int getConnectionRetries() {
+		return connectionRetries;
+	}
+
+	public void setConnectionRetries(int connectionRetries) {
+		this.connectionRetries = connectionRetries;
+	}
+
+	public int getConnectionRetryIntervalSecs() {
+		return connectionRetryIntervalSecs;
+	}
+
+	public void setConnectionRetryIntervalSecs(int connectionRetryIntervalSecs) {
+		this.connectionRetryIntervalSecs = connectionRetryIntervalSecs;
+	}
+
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/xmlrpc/XmlRpcCommunicationChannelServer.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/xmlrpc/XmlRpcCommunicationChannelServer.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/xmlrpc/XmlRpcCommunicationChannelServer.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/xmlrpc/XmlRpcCommunicationChannelServer.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,263 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.oodt.cas.workflow.server.channel.xmlrpc;
+
+//JDK imports
+import java.util.Comparator;
+import java.util.Map;
+
+//APACHE imports
+import org.apache.xmlrpc.WebServer;
+
+//OODT imports
+import org.apache.oodt.cas.catalog.page.PageInfo;
+import org.apache.oodt.cas.catalog.query.QueryExpression;
+import org.apache.oodt.cas.metadata.Metadata;
+import org.apache.oodt.cas.workflow.event.WorkflowEngineEvent;
+import org.apache.oodt.cas.workflow.model.WorkflowGraph;
+import org.apache.oodt.cas.workflow.page.PageFilter;
+import org.apache.oodt.cas.workflow.page.QueryPage;
+import org.apache.oodt.cas.workflow.page.QueuePage;
+import org.apache.oodt.cas.workflow.priority.Priority;
+import org.apache.oodt.cas.workflow.server.channel.AbstractCommunicationChannelServer;
+import org.apache.oodt.cas.workflow.state.WorkflowState;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * XML-RPC communication channel server
+ * <p>
+ */
+public class XmlRpcCommunicationChannelServer extends
+		AbstractCommunicationChannelServer implements XmlRpcCommunicationServerInterface {
+
+	private WebServer webServer;
+	
+	public XmlRpcCommunicationChannelServer() {
+		super();
+	}
+
+	public void startup() throws Exception {
+		this.webServer = new WebServer(this.port);
+		this.webServer.addHandler(this.getClass().getSimpleName(), this);
+		this.webServer.start();
+	}
+
+	public boolean xmlrpc_shutdown() throws Exception {
+		this.shutdown();
+		this.webServer.shutdown();
+		this.webServer = null;
+		return true;
+	}
+
+	public boolean xmlrpc_pauseRunner() throws Exception {
+		this.pauseRunner();
+		return true;
+	}
+		
+	public boolean xmlrpc_resumeRunner() throws Exception {
+		this.resumeRunner();
+		return true;
+	}
+	
+	public String xmlrpc_getLaunchDate() throws Exception {
+		return this.serializer.serializeObject(this.getLaunchDate());
+	}
+	
+	public String xmlrpc_deleteWorkflow(String instanceId) throws Exception {
+		this.deleteWorkflow(instanceId);
+		return this.serializer.serializeObject(Boolean.TRUE);
+	}
+
+	public String xmlrpc_getInstanceMetadata(String jobId) throws Exception {
+		return this.serializer.serializeObject(this.getInstanceMetadata(jobId));
+	}
+
+	public String xmlrpc_getInstanceRepository() throws Exception {
+		return this.serializer.serializeObject(this.getInstanceRepository());
+	}
+
+	public String xmlrpc_getModel(String modelId) throws Exception {
+		return this.serializer.serializeObject(this.getModel(modelId));
+	}
+
+	public String xmlrpc_getModels() throws Exception {
+		return this.serializer.serializeObject(this.getModels());
+	}
+	
+	public String xmlrpc_getWorkflowGraph(String modelId) throws Exception {
+		return this.serializer.serializeObject(this.getWorkflowGraph(modelId));
+	}
+
+	public String xmlrpc_getWorkflowGraphs() throws Exception {
+		return this.serializer.serializeObject(this.getWorkflowGraphs());
+	}
+	
+	public String xmlrpc_getSupportedProcessorIds() throws Exception {
+		return this.serializer.serializeObject(this.xmlrpc_getSupportedProcessorIds());
+	}
+
+    public String xmlrpc_getProcessorInfo(String instanceId, String modelId) throws Exception {
+		return this.serializer.serializeObject(this.getProcessorInfo(instanceId, modelId));
+    }
+    
+	public String xmlrpc_getWorkflowMetadata(String instanceId, String modelId) throws Exception {
+		return this.serializer.serializeObject(this.getWorkflowMetadata(instanceId, modelId));
+	}
+
+	public String xmlrpc_pauseWorkflow(String instanceId) throws Exception {
+		this.pauseWorkflow(instanceId);
+		return this.serializer.serializeObject(Boolean.TRUE);
+	}
+
+	public String xmlrpc_resumeWorkflow(String instanceId) throws Exception {
+		this.resumeWorkflow(instanceId);
+		return this.serializer.serializeObject(Boolean.TRUE);
+	}
+
+	public String xmlrpc_setWorkflowState(String instanceId, String modelId, String state) throws Exception {
+		this.setWorkflowState(instanceId, modelId, this.serializer.deserializeObject(WorkflowState.class, state));
+		return this.serializer.serializeObject(Boolean.TRUE);
+	}
+	
+    public String xmlrpc_setWorkflowPriority(String instanceId, String modelId, String priority) throws Exception {
+    	this.setWorkflowPriority(instanceId, modelId, this.serializer.deserializeObject(Priority.class, priority));
+		return this.serializer.serializeObject(Boolean.TRUE);
+    }
+
+	public String xmlrpc_startWorkflow(String workflow, String metadata) throws Exception {
+		return this.startWorkflow(this.serializer.deserializeObject(WorkflowGraph.class, workflow), this.serializer.deserializeObject(Metadata.class, metadata));
+	}
+
+	public String xmlrpc_startWorkflow(String workflow, String metadata, String priority) throws Exception {
+		return this.startWorkflow(this.serializer.deserializeObject(WorkflowGraph.class, workflow), this.serializer.deserializeObject(Metadata.class, metadata), this.serializer.deserializeObject(Priority.class, priority));
+	}
+	
+	public String xmlrpc_startWorkflow2(String modelId, String inputMetadata) throws Exception {
+		return this.startWorkflow(modelId, this.serializer.deserializeObject(Metadata.class, inputMetadata));
+	}
+	
+	public String xmlrpc_startWorkflow2(String modelId, String inputMetadata, String priority) throws Exception {
+		return this.startWorkflow(modelId, this.serializer.deserializeObject(Metadata.class, inputMetadata), this.serializer.deserializeObject(Priority.class, priority));
+	}
+
+	public String xmlrpc_stopWorkflow(String instanceId) throws Exception {
+		this.stopWorkflow(instanceId);
+		return this.serializer.serializeObject(Boolean.TRUE);
+	}
+
+	public String xmlrpc_updateInstanceMetadata(String jobId, String metadata) throws Exception {
+		this.updateInstanceMetadata(jobId, this.serializer.deserializeObject(Metadata.class, metadata));
+		return this.serializer.serializeObject(Boolean.TRUE);
+	}
+	
+	public String xmlrpc_updateWorkflowMetadata(String instanceId, String modelId, String metadata)  throws Exception {
+		this.updateWorkflowMetadata(instanceId, modelId, this.serializer.deserializeObject(Metadata.class, metadata));
+		return this.serializer.serializeObject(Boolean.TRUE);
+	}
+	
+	public String xmlrpc_updateWorkflowAndInstance(String instanceId, String modelId, String state, String metadata, String jobId, String instanceMetadata)  throws Exception {
+		this.updateWorkflowAndInstance(instanceId, modelId, this.serializer.deserializeObject(WorkflowState.class, state), this.serializer.deserializeObject(Metadata.class, metadata), jobId, this.serializer.deserializeObject(Metadata.class, instanceMetadata));
+		return this.serializer.serializeObject(Boolean.TRUE);
+	}
+
+    public String xmlrpc_registerEvent(String event) throws Exception {
+    	this.registerEvent(this.serializer.deserializeObject(WorkflowEngineEvent.class, event));
+		return this.serializer.serializeObject(Boolean.TRUE);
+    }
+    
+    public String xmlrpc_triggerEvent(String eventId, String inputMetadata) throws Exception {
+    	this.triggerEvent(eventId, this.serializer.deserializeObject(Metadata.class, inputMetadata));
+		return this.serializer.serializeObject(Boolean.TRUE);
+    }
+
+	public String xmlrpc_getRegisteredEvents() throws Exception {
+		return this.serializer.serializeObject(this.getRegisteredEvents());
+	}
+	
+	public String xmlrpc_getSupportedStates() throws Exception {
+		return this.serializer.serializeObject(this.getSupportedStates());
+	}    
+
+    public String xmlrpc_getNumOfLoadedProcessors() throws Exception {
+		return this.serializer.serializeObject(Integer.valueOf(this.getNumOfLoadedProcessors()));
+    }
+    
+    public String xmlrpc_getNumOfWorkflows() throws Exception {
+    	return this.serializer.serializeObject(Integer.valueOf(this.getNumOfWorkflows()));
+    }
+    
+    public String xmlrpc_getExecutingPage(String pageInfo) throws Exception {
+    	return this.serializer.serializeObject(this.getExecutingPage(this.serializer.deserializeObject(PageInfo.class, pageInfo)));
+    }
+    
+    public String xmlrpc_getRunnablesPage(String pageInfo) throws Exception {
+    	return this.serializer.serializeObject(this.getRunnablesPage(this.serializer.deserializeObject(PageInfo.class, pageInfo)));
+    }
+    
+    public String xmlrpc_getPage(String pageInfo) throws Exception {
+    	return this.serializer.serializeObject(this.getPage(this.serializer.deserializeObject(PageInfo.class, pageInfo)));
+    }
+
+    public String xmlrpc_getPage_filtered(String pageInfo, String pageFilter) throws Exception {
+    	return this.serializer.serializeObject(this.getPage(this.serializer.deserializeObject(PageInfo.class, pageInfo), this.serializer.deserializeObject(PageFilter.class, pageFilter)));
+    }
+    
+    public String xmlrpc_getPage2(String pageInfo, String comparator) throws Exception {
+    	return this.serializer.serializeObject(this.getPage(this.serializer.deserializeObject(PageInfo.class, pageInfo), this.serializer.deserializeObject(Comparator.class, comparator)));
+    }
+    
+    public String xmlrpc_getPage3(String pageInfo, String state) throws Exception {
+    	return this.serializer.serializeObject(this.getPage(this.serializer.deserializeObject(PageInfo.class, pageInfo), this.serializer.deserializeObject(WorkflowState.class, state)));
+    }
+
+    public String xmlrpc_getPage4(String pageInfo, String category) throws Exception {
+    	return this.serializer.serializeObject(this.getPage(this.serializer.deserializeObject(PageInfo.class, pageInfo), this.serializer.deserializeObject(WorkflowState.Category.class, category)));
+    }
+
+    public String xmlrpc_getPage5(String pageInfo, String modelId) throws Exception {
+    	return this.serializer.serializeObject(this.getPage(this.serializer.deserializeObject(PageInfo.class, pageInfo), modelId));
+    }
+
+    public String xmlrpc_getPage7(String pageInfo, String keyValPairs) throws Exception {
+    	return this.serializer.serializeObject(this.getPage(this.serializer.deserializeObject(PageInfo.class, pageInfo), this.serializer.deserializeObject(Map.class, keyValPairs)));
+    }
+    
+    public String xmlrpc_getNextPage(String page) throws Exception {
+    	return this.serializer.serializeObject(this.getNextPage(this.serializer.deserializeObject(QueuePage.class, page)));
+    }
+	
+	public String xmlrpc_getWorkflow(String instanceId) throws Exception {
+		return this.serializer.serializeObject(this.getWorkflow(instanceId));
+	}
+
+	public String xmlrpc_getMetadata(String page) throws Exception {
+		return this.serializer.serializeObject(this.getMetadata(this.serializer.deserializeObject(QueryPage.class, page)));
+	}
+
+	public String xmlrpc_getNextPage2(String page) throws Exception {
+		return this.serializer.serializeObject(this.getNextPage(this.serializer.deserializeObject(QueryPage.class, page)));
+	}
+
+	public String xmlrpc_getPage6(String pageInfo, String queryExpression)
+			throws Exception {
+		return this.serializer.serializeObject(this.getPage(this.serializer.deserializeObject(PageInfo.class, pageInfo), this.serializer.deserializeObject(QueryExpression.class, queryExpression)));
+	}
+    
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/xmlrpc/XmlRpcCommunicationChannelServerFactory.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/xmlrpc/XmlRpcCommunicationChannelServerFactory.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/xmlrpc/XmlRpcCommunicationChannelServerFactory.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/xmlrpc/XmlRpcCommunicationChannelServerFactory.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.oodt.cas.workflow.server.channel.xmlrpc;
+
+//OODT imports
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineFactory;
+import org.apache.oodt.cas.workflow.server.channel.CommunicationChannelServerFactory;
+
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Factory for creating XML-RPC communication channel server
+ * <p>
+ */
+public class XmlRpcCommunicationChannelServerFactory implements
+		CommunicationChannelServerFactory {
+
+	private int port;
+	private WorkflowEngineFactory workflowEngineFactory;
+	
+	public XmlRpcCommunicationChannelServer createCommunicationChannelServer() {
+		XmlRpcCommunicationChannelServer xmlrpcServer = new XmlRpcCommunicationChannelServer();
+		xmlrpcServer.setPort(this.port);
+		xmlrpcServer.setWorkflowEngine(this.workflowEngineFactory.createEngine());
+		return xmlrpcServer;
+	}
+
+	public int getPort() {
+		return this.port;
+	}
+
+	public void setPort(int port) {
+		this.port = port;
+	}
+
+	public void setWorkflowEngineFactory(WorkflowEngineFactory workflowEngineFactory) {
+		this.workflowEngineFactory = workflowEngineFactory;
+	}
+
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/xmlrpc/XmlRpcCommunicationServerInterface.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/xmlrpc/XmlRpcCommunicationServerInterface.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/xmlrpc/XmlRpcCommunicationServerInterface.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/channel/xmlrpc/XmlRpcCommunicationServerInterface.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.oodt.cas.workflow.server.channel.xmlrpc;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * XML-RPC communication channel server interface
+ * <p>
+ */
+public interface XmlRpcCommunicationServerInterface {
+
+	public boolean xmlrpc_shutdown() throws Exception;
+	
+	public boolean xmlrpc_pauseRunner() throws Exception;
+	
+	public boolean xmlrpc_resumeRunner() throws Exception;
+	
+	public String xmlrpc_getLaunchDate() throws Exception;
+
+	public String xmlrpc_deleteWorkflow(String instanceId) throws Exception;
+
+	public String xmlrpc_getInstanceMetadata(String jobId) throws Exception;
+
+	public String xmlrpc_getInstanceRepository() throws Exception;
+
+	public String xmlrpc_getModel(String modelId) throws Exception;
+
+	public String xmlrpc_getModels() throws Exception;
+	
+	public String xmlrpc_getWorkflowGraph(String modelId) throws Exception;
+
+	public String xmlrpc_getWorkflowGraphs() throws Exception;
+
+    public String xmlrpc_getProcessorInfo(String instanceId, String modelId) throws Exception;
+	
+	public String xmlrpc_getWorkflowMetadata(String instanceId, String modelId) throws Exception;
+
+	public String xmlrpc_pauseWorkflow(String instanceId) throws Exception;
+
+	public String xmlrpc_resumeWorkflow(String instanceId) throws Exception;
+
+	public String xmlrpc_setWorkflowState(String instanceId, String modelId, String state) throws Exception;
+
+    public String xmlrpc_setWorkflowPriority(String instanceId, String modelId, String priority) throws Exception;
+	
+	public String xmlrpc_startWorkflow(String workflow, String metadata) throws Exception;
+	
+	public String xmlrpc_startWorkflow(String workflow, String metadata, String priority) throws Exception;
+
+	public String xmlrpc_startWorkflow2(String modelId, String inputMetadata) throws Exception;
+
+	public String xmlrpc_startWorkflow2(String modelId, String inputMetadata, String priority) throws Exception;
+
+	public String xmlrpc_stopWorkflow(String instanceId) throws Exception;
+
+	public String xmlrpc_updateInstanceMetadata(String jobId, String metadata) throws Exception;
+	
+	public String xmlrpc_updateWorkflowMetadata(String instanceId, String modelId, String metadata)  throws Exception;
+
+    public String xmlrpc_registerEvent(String event) throws Exception;
+    
+    public String xmlrpc_triggerEvent(String eventId, String inputMetadata) throws Exception;
+	
+    public String xmlrpc_getRegisteredEvents() throws Exception;
+
+    public String xmlrpc_getSupportedStates() throws Exception;
+    
+    public String xmlrpc_getNumOfLoadedProcessors() throws Exception;
+    
+    public String xmlrpc_getNumOfWorkflows() throws Exception;
+    
+    public String xmlrpc_getExecutingPage(String pageInfo) throws Exception;
+
+    public String xmlrpc_getRunnablesPage(String pageInfo) throws Exception;
+
+    public String xmlrpc_getPage(String pageInfo) throws Exception;
+
+    public String xmlrpc_getPage2(String pageInfo, String comparator) throws Exception;
+         
+    public String xmlrpc_getPage3(String pageInfo, String state) throws Exception;
+
+    public String xmlrpc_getPage4(String pageInfo, String category) throws Exception;
+
+    public String xmlrpc_getPage5(String pageInfo, String modelId) throws Exception;
+    
+    public String xmlrpc_getPage7(String pageInfo, String keyValPairs) throws Exception;
+    
+    public String xmlrpc_getNextPage(String page) throws Exception;
+    
+    public String xmlrpc_getWorkflow(String instanceId) throws Exception;
+    
+	public String xmlrpc_getNextPage2(String page) throws Exception;
+	
+	public String xmlrpc_getPage6(String pageInfo, String queryExpression) throws Exception;
+	
+	public String xmlrpc_getMetadata(String page) throws Exception;
+	
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/option/PrintSupportedActionsHandler.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/option/PrintSupportedActionsHandler.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/option/PrintSupportedActionsHandler.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/option/PrintSupportedActionsHandler.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.oodt.cas.workflow.server.option;
+
+//JDK imports
+import java.io.PrintStream;
+import java.util.List;
+import java.util.Map;
+
+//Spring imports
+import org.springframework.context.support.FileSystemXmlApplicationContext;
+
+//OODT imports
+import org.apache.oodt.cas.workflow.server.action.WorkflowEngineServerAction;
+import org.apache.oodt.cas.workflow.util.Serializer;
+import org.apache.oodt.commons.option.CmdLineOption;
+import org.apache.oodt.commons.option.CmdLineOptionInstance;
+import org.apache.oodt.commons.option.handler.CmdLineOptionHandler;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Command line handler for printing out support actions
+ * <p>
+ */
+public class PrintSupportedActionsHandler extends CmdLineOptionHandler {
+
+	protected String beanRepo;
+	
+	@Override
+	public String getCustomOptionUsage(CmdLineOption option) {
+		return "";
+	}
+
+	@Override
+	public void handleOption(CmdLineOption option, List<String> values) {
+		FileSystemXmlApplicationContext appContext = new FileSystemXmlApplicationContext(new String[] { this.beanRepo }, false);
+		appContext.setClassLoader(new Serializer().getClassLoader());
+		appContext.refresh();
+		PrintStream ps = new PrintStream(System.out);
+        ps.println("Actions:");
+        for (WorkflowEngineServerAction action : ((Map<String, WorkflowEngineServerAction>) appContext.getBeansOfType(WorkflowEngineServerAction.class)).values()) {
+            ps.println("  Action:");
+            ps.println("    Id: " + action.getId());
+            ps.println("    Description: " + action.getDescription());
+            ps.println();
+        }
+        ps.close();
+	}
+
+	public void setBeanRepo(String beanRepo) {
+		this.beanRepo = beanRepo;
+	}
+
+	@Override
+	public boolean affectsOption(CmdLineOptionInstance arg0) {
+		return false;
+	}
+	
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/option/PrintSupportedClientsHandler.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/option/PrintSupportedClientsHandler.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/option/PrintSupportedClientsHandler.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/option/PrintSupportedClientsHandler.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.oodt.cas.workflow.server.option;
+
+//JDK imports
+import java.io.PrintStream;
+import java.util.List;
+
+//Spring imports
+import org.springframework.context.support.FileSystemXmlApplicationContext;
+
+//OODT imports
+import org.apache.oodt.cas.workflow.engine.WorkflowEngineClientFactory;
+import org.apache.oodt.cas.workflow.util.Serializer;
+import org.apache.oodt.commons.option.CmdLineOption;
+import org.apache.oodt.commons.option.CmdLineOptionInstance;
+import org.apache.oodt.commons.option.handler.CmdLineOptionHandler;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Command line handler for printing out support clients
+ * <p>
+ */
+public class PrintSupportedClientsHandler extends CmdLineOptionHandler {
+
+	protected String beanRepo;
+	
+	@Override
+	public String getCustomOptionUsage(CmdLineOption option) {
+		return "";
+	}
+
+	@Override
+	public void handleOption(CmdLineOption option, List<String> values) {
+		FileSystemXmlApplicationContext appContext = new FileSystemXmlApplicationContext(new String[] { this.beanRepo }, false);
+		appContext.setClassLoader(new Serializer().getClassLoader());
+		appContext.refresh();
+		PrintStream ps = new PrintStream(System.out);
+        ps.println("ClientFactories:");
+        for (String clientId : appContext.getBeanNamesForType(WorkflowEngineClientFactory.class)) {
+        	WorkflowEngineClientFactory clientFactory = (WorkflowEngineClientFactory) appContext.getBean(clientId, WorkflowEngineClientFactory.class);
+            ps.println("  ClientFactory:");
+            ps.println("    Id: " + clientId);
+            ps.println("    URL: " + clientFactory.getServerUrl());
+            ps.println();
+        }
+        ps.close();
+	}
+
+	public void setBeanRepo(String beanRepo) {
+		this.beanRepo = beanRepo;
+	}
+	
+	@Override
+	public boolean affectsOption(CmdLineOptionInstance arg0) {
+		return false;
+	}
+	
+}

Added: oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/option/PrintSupportedServersHandler.java
URL: http://svn.apache.org/viewvc/oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/option/PrintSupportedServersHandler.java?rev=1052147&view=auto
==============================================================================
--- oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/option/PrintSupportedServersHandler.java (added)
+++ oodt/branches/wengine-branch/wengine/src/main/java/org/apache/oodt/cas/workflow/server/option/PrintSupportedServersHandler.java Thu Dec 23 02:47:16 2010
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.oodt.cas.workflow.server.option;
+
+//JDK imports
+import java.io.PrintStream;
+import java.util.List;
+
+//Spring imports
+import org.springframework.context.support.FileSystemXmlApplicationContext;
+
+//OODT imports
+import org.apache.oodt.cas.workflow.server.channel.CommunicationChannelServerFactory;
+import org.apache.oodt.cas.workflow.util.Serializer;
+import org.apache.oodt.commons.option.CmdLineOption;
+import org.apache.oodt.commons.option.CmdLineOptionInstance;
+import org.apache.oodt.commons.option.handler.CmdLineOptionHandler;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Command line handler for printing out support servers
+ * <p>
+ */
+public class PrintSupportedServersHandler extends CmdLineOptionHandler {
+
+	protected String beanRepo;
+	
+	@Override
+	public String getCustomOptionUsage(CmdLineOption option) {
+		return "";
+	}
+
+	@Override
+	public void handleOption(CmdLineOption option, List<String> values) {
+		FileSystemXmlApplicationContext appContext = new FileSystemXmlApplicationContext(new String[] { this.beanRepo }, false);
+		appContext.setClassLoader(new Serializer().getClassLoader());
+		appContext.refresh();
+		PrintStream ps = new PrintStream(System.out);
+        ps.println("ServerFactories:");
+        for (String serverId : appContext.getBeanNamesForType(CommunicationChannelServerFactory.class)) {
+        	CommunicationChannelServerFactory serverFactory = (CommunicationChannelServerFactory) appContext.getBean(serverId, CommunicationChannelServerFactory.class);
+            ps.println("  ServerFactory:");
+            ps.println("    Id: " + serverId);
+            ps.println("    Port: " + serverFactory.getPort());
+            ps.println();
+        }
+        ps.close();
+	}
+
+	public void setBeanRepo(String beanRepo) {
+		this.beanRepo = beanRepo;
+	}
+	
+	@Override
+	public boolean affectsOption(CmdLineOptionInstance arg0) {
+		return false;
+	}
+	
+}



Mime
View raw message