001: /*
002: * <copyright>
003: *
004: * Copyright 2002-2004 BBNT Solutions, LLC
005: * under sponsorship of the Defense Advanced Research Projects
006: * Agency (DARPA).
007: *
008: * You can redistribute this software and/or modify it under the
009: * terms of the Cougaar Open Source License as published on the
010: * Cougaar Open Source Website (www.cougaar.org).
011: *
012: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
013: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
014: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
015: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
016: * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
017: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
018: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
019: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
020: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
021: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
022: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
023: *
024: * </copyright>
025: */
026: package org.cougaar.core.examples.mobility.ldm;
027:
028: import org.cougaar.core.util.UID;
029: import org.cougaar.core.util.UniqueObject;
030:
031: /**
032: * A Proc is a running Script -- it's short for "process",
033: * which is a classname that's already used by
034: * "java.lang.Process".
035: */
036: public interface Proc extends UniqueObject {
037:
038: /**
039: * UID support from unique-object.
040: */
041: UID getUID();
042:
043: /**
044: * Script UID, which is immutable.
045: */
046: UID getScriptUID();
047:
048: /**
049: * Start time of the proc.
050: * <p>
051: * Pause and timeout times starting with "@" are offset
052: * by this time; see ScriptParser for details.
053: */
054: long getStartTime();
055:
056: /**
057: * Get the time of the proc completion.
058: * <p>
059: * If the proc failed, the current script index will
060: * be less than the script size and the step uid
061: * will be non-null. If the proc succeeded, the
062: * current script index will be equal to the script
063: * size and the step uid will be null.
064: */
065: long getEndTime();
066:
067: /**
068: * Get the count of the total number of moves requested
069: * by this proc.
070: */
071: int getMoveCount();
072:
073: /**
074: * Current Step UID, which changes as the script is
075: * proc.
076: */
077: UID getStepUID();
078:
079: /**
080: * Current index in the script, which changes as the
081: * script is proc. I.e. program-counter.
082: */
083: int getScriptIndex();
084:
085: // add Map for proc-global variables?
086:
087: /**
088: * For infrastructure use only!. Set the end time.
089: */
090: void setEndTime(long time);
091:
092: /**
093: * For infrastructure use only!. Set the move count.
094: */
095: void setMoveCount(int count);
096:
097: /**
098: * For infrastructure use only!. Set the current step.
099: */
100: void setStepUID(UID uid);
101:
102: /**
103: * For infrastructure use only!. Set the current index.
104: */
105: void setScriptIndex(int index);
106:
107: }
|