X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.specs%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fexecution%2FExecutionStep.java;h=628a3b69dc6f1049253824729d2eeeb92504b4ef;hb=d4bd245768d2e2b3f94928b3db5a01380857e8b8;hp=df2d805a897712a38c7b439bac184813ca679010;hpb=0e2ff188c2e8ffac85739cccc3925e8bd82d7be9;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/execution/ExecutionStep.java b/runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/execution/ExecutionStep.java index df2d805a8..628a3b69d 100644 --- a/runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/execution/ExecutionStep.java +++ b/runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/execution/ExecutionStep.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Mathieu Baudier + * 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. @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.argeo.slc.execution; import java.io.Serializable; @@ -26,8 +25,6 @@ import java.util.Date; public class ExecutionStep implements Serializable { private static final long serialVersionUID = 798640526532912161L; - // public final static String START = "START"; - // public final static String END = "END"; public final static String PHASE_START = "PHASE_START"; public final static String PHASE_END = "PHASE_END"; public final static String ERROR = "ERROR"; @@ -36,6 +33,11 @@ public class ExecutionStep implements Serializable { public final static String DEBUG = "DEBUG"; public final static String TRACE = "TRACE"; + /** @deprecated */ + public final static String START = "START"; + /** @deprecated */ + public final static String END = "END"; + // TODO make the fields final and private when we don't need POJO support // anymore (that // is when SlcExecutionStep is removed) @@ -44,27 +46,28 @@ public class ExecutionStep implements Serializable { protected Date timestamp; protected String log; + private String location; + /** Empty constructor */ public ExecutionStep() { - thread = Thread.currentThread().getName(); - } - - /** Creates a step at the current date of type INFO */ - public ExecutionStep(String log) { - this(new Date(), INFO, log); + Thread currentThread = Thread.currentThread(); + thread = currentThread.getName(); } /** Creates a step at the current date */ - public ExecutionStep(String type, String log) { - this(new Date(), type, log); + public ExecutionStep(String location, String type, String log) { + this(location, new Date(), type, log); } /** Creates a step of the given type. */ - public ExecutionStep(Date timestamp, String type, String log) { - this(timestamp, type, log, Thread.currentThread().getName()); + public ExecutionStep(String location, Date timestamp, String type, + String log) { + this(location, timestamp, type, log, Thread.currentThread().getName()); } - public ExecutionStep(Date timestamp, String type, String log, String thread) { + public ExecutionStep(String location, Date timestamp, String type, + String log, String thread) { + this.location = location; this.type = type; this.timestamp = timestamp; this.thread = thread; @@ -100,4 +103,9 @@ public class ExecutionStep implements Serializable { return "Execution step, thread=" + thread + ", type=" + type; } + /** Typically the logging category */ + public String getLocation() { + return location; + } + }