]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/execution/ExecutionFlowDescriptor.java
Start new SLC project structure
[gpl/argeo-slc.git] / runtime / org.argeo.slc.specs / src / main / java / org / argeo / slc / execution / ExecutionFlowDescriptor.java
index 77cc268169f81d0845b0f083f23049e357f02b69..e3eea046f5147c110b5c5c159080745c1aec518d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
+ * Copyright (C) 2007-2012 Argeo GmbH
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.argeo.slc.execution;
 
 import java.io.Serializable;
+import java.util.HashMap;
 import java.util.Map;
 
 /**
@@ -40,7 +40,7 @@ import java.util.Map;
  * Generally, values object are either a <code>PrimitiveAccessor</code> or a
  * <code>RefValue</code> but can be other objects.
  */
-public class ExecutionFlowDescriptor implements Serializable {
+public class ExecutionFlowDescriptor implements Serializable, Cloneable {
        private static final long serialVersionUID = 7101944857038041216L;
        private String name;
        private String description;
@@ -51,19 +51,26 @@ public class ExecutionFlowDescriptor implements Serializable {
        public ExecutionFlowDescriptor() {
        }
 
-       public ExecutionFlowDescriptor(String name, Map<String, Object> values,
-                       ExecutionSpec executionSpec) {
+       public ExecutionFlowDescriptor(String name, String description,
+                       Map<String, Object> values, ExecutionSpec executionSpec) {
                this.name = name;
                this.values = values;
                this.executionSpec = executionSpec;
        }
 
+       /** The referenced {@link ExecutionSpec} is NOT cloned. */
+       @Override
+       protected Object clone() throws CloneNotSupportedException {
+               return new ExecutionFlowDescriptor(name, description,
+                               new HashMap<String, Object>(values), executionSpec);
+       }
+
        public String getName() {
                return name;
        }
 
        /**
-        * @deprecated will be removed in SLC 2.0, the path should be the part of
+        * @deprecated will be removed in SLC 2.x, the path should be the part of
         *             the name with '/'
         */
        public String getPath() {