]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/execution/ExecutionStep.java
Start new SLC project structure
[gpl/argeo-slc.git] / runtime / org.argeo.slc.specs / src / main / java / org / argeo / slc / execution / ExecutionStep.java
index 4cabeec097d6f5c2406c7d434cca6e238c0893cc..628a3b69dc6f1049253824729d2eeeb92504b4ef 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
- * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
  *\r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
@@ -13,7 +13,6 @@
  * See the License for the specific language governing permissions and\r
  * limitations under the License.\r
  */\r
-\r
 package org.argeo.slc.execution;\r
 \r
 import java.io.Serializable;\r
@@ -34,9 +33,9 @@ public class ExecutionStep implements Serializable {
        public final static String DEBUG = "DEBUG";\r
        public final static String TRACE = "TRACE";\r
 \r
-       /** @deprecated*/\r
+       /** @deprecated */\r
        public final static String START = "START";\r
-       /** @deprecated*/\r
+       /** @deprecated */\r
        public final static String END = "END";\r
 \r
        // TODO make the fields final and private when we don't need POJO support\r
@@ -47,27 +46,28 @@ public class ExecutionStep implements Serializable {
        protected Date timestamp;\r
        protected String log;\r
 \r
+       private String location;\r
+\r
        /** Empty constructor */\r
        public ExecutionStep() {\r
-               thread = Thread.currentThread().getName();\r
-       }\r
-\r
-       /** Creates a step at the current date of type INFO */\r
-       public ExecutionStep(String log) {\r
-               this(new Date(), INFO, log);\r
+               Thread currentThread = Thread.currentThread();\r
+               thread = currentThread.getName();\r
        }\r
 \r
        /** Creates a step at the current date */\r
-       public ExecutionStep(String type, String log) {\r
-               this(new Date(), type, log);\r
+       public ExecutionStep(String location, String type, String log) {\r
+               this(location, new Date(), type, log);\r
        }\r
 \r
        /** Creates a step of the given type. */\r
-       public ExecutionStep(Date timestamp, String type, String log) {\r
-               this(timestamp, type, log, Thread.currentThread().getName());\r
+       public ExecutionStep(String location, Date timestamp, String type,\r
+                       String log) {\r
+               this(location, timestamp, type, log, Thread.currentThread().getName());\r
        }\r
 \r
-       public ExecutionStep(Date timestamp, String type, String log, String thread) {\r
+       public ExecutionStep(String location, Date timestamp, String type,\r
+                       String log, String thread) {\r
+               this.location = location;\r
                this.type = type;\r
                this.timestamp = timestamp;\r
                this.thread = thread;\r
@@ -103,4 +103,9 @@ public class ExecutionStep implements Serializable {
                return "Execution step, thread=" + thread + ", type=" + type;\r
        }\r
 \r
+       /** Typically the logging category */\r
+       public String getLocation() {\r
+               return location;\r
+       }\r
+\r
 }\r