Author: mattmann
Date: Sat Apr 28 04:04:14 2012
New Revision: 1331678

URL: http://svn.apache.org/viewvc?rev=1331678&view=rev
Log:
- OODT-310 and OODT-215: WIP: cleaning up ConditionProcessor, and 
ParallelProcessor. Will work SequentialProcessor next.
Then will likely comment out implementations of engines, just so I can start 
building and working on unit testing the
WorkflowLifecycleManager per OODT-421.

Added:
    
oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/ChangeType.java
   (with props)
    
oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/ConditionProcessor.java
   (with props)
    
oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/ParallelProcessor.java
   (with props)

Added: 
oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/ChangeType.java
URL: 
http://svn.apache.org/viewvc/oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/ChangeType.java?rev=1331678&view=auto
==============================================================================
--- 
oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/ChangeType.java
 (added)
+++ 
oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/ChangeType.java
 Sat Apr 28 04:04:14 2012
@@ -0,0 +1,58 @@
+/*
+ * 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.engine;
+
+/**
+ * @author bfoster
+ * @version $Revision$
+ *
+ * <p>
+ * Different Listener Message Categories
+ * <p>
+ */
+public class ChangeType {
+
+       public static final ChangeType STATE = new ChangeType("State");
+       public static final ChangeType DYN_MET = new 
ChangeType("DynamicMetadata");
+       public static final ChangeType STATIC_MET = new 
ChangeType("StaticMetadata");
+       public static final ChangeType LISTENERS = new ChangeType("Listeners");
+       public static final ChangeType PRIORITY = new ChangeType("Priority");
+       public static final ChangeType EXCUSED_WPS = new 
ChangeType("ExcusedWorkflowProcessors");
+
+       private String name;
+       
+       public ChangeType(String name) {
+               this.name = name;
+       }
+       
+       public String getName() {
+               return this.name;
+       }
+       
+       public boolean equals(Object obj) {
+               if (obj instanceof ChangeType) {
+                       return this.name.equals(((ChangeType) obj).name);
+               }else {
+                       return false;
+               }
+       }
+       
+       public int hashCode() {
+               return this.getName().hashCode();
+       }
+       
+}

Propchange: 
oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/ChangeType.java
------------------------------------------------------------------------------
    svn:executable = *

Added: 
oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/ConditionProcessor.java
URL: 
http://svn.apache.org/viewvc/oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/ConditionProcessor.java?rev=1331678&view=auto
==============================================================================
--- 
oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/ConditionProcessor.java
 (added)
+++ 
oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/ConditionProcessor.java
 Sat Apr 28 04:04:14 2012
@@ -0,0 +1,52 @@
+/**
+ * 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.engine;
+
+//OODT import
+import org.apache.oodt.cas.workflow.structs.Priority;
+
+/**
+ * 
+ * @author bfoster
+ * @version $Revision$
+ * 
+ * <p>
+ * WorkflowProcessor which handles Workflow Pre/Post Conditions
+ * </p>.
+ */
+public class ConditionProcessor extends TaskProcessor {
+
+       public ConditionProcessor() {
+               super();
+               this.setIsConditionProcessor(true);
+       }
+       
+       public void setPriority(Priority priority) {
+               super.setPriority(Priority.getPriority(priority.getValue() - 
0.1));
+       }
+       
+       @Override
+       public void setPreConditions(WorkflowProcessor preConditions) {
+               //not allowed
+       }
+       
+       @Override
+       public void setPostConditions(WorkflowProcessor postConditions) {
+               //not allowed
+       }
+       
+}

Propchange: 
oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/ConditionProcessor.java
------------------------------------------------------------------------------
    svn:executable = *

Added: 
oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/ParallelProcessor.java
URL: 
http://svn.apache.org/viewvc/oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/ParallelProcessor.java?rev=1331678&view=auto
==============================================================================
--- 
oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/ParallelProcessor.java
 (added)
+++ 
oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/ParallelProcessor.java
 Sat Apr 28 04:04:14 2012
@@ -0,0 +1,52 @@
+/*
+ * 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.engine;
+
+//JDK imports
+import java.util.List;
+
+//OODT imports
+import org.apache.oodt.cas.workflow.lifecycle.WorkflowLifecycleManager;
+import org.apache.oodt.cas.workflow.util.WorkflowUtils;
+
+/**
+ * 
+ * WorkflowProcessor which handles running sub-workflow processors in parallel.
+ * 
+ * @author bfoster
+ * @author mattmann
+ * @version $Revision$
+ * 
+ */
+public class ParallelProcessor extends WorkflowProcessor {
+
+  private WorkflowUtils wutils;
+
+  public ParallelProcessor(WorkflowLifecycleManager lifecycle) {
+    this.wutils = new WorkflowUtils(lifecycle);
+  }
+
+  public List<WorkflowProcessor> getRunnableSubProcessors() {
+    return this.getSubProcessors();
+  }
+
+  public void handleSubProcessorMetadata(WorkflowProcessor workflowProcessor) {
+    this.setDynamicMetadata(wutils.mergeMetadata(this.getDynamicMetadata(),
+        workflowProcessor.getPassThroughDynamicMetadata()));
+  }
+
+}

Propchange: 
oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/ParallelProcessor.java
------------------------------------------------------------------------------
    svn:executable = *


Reply via email to