org/objectweb/proactive/ext/scilab/monitor/SciTaskInfo.java

00001 /* 
00002  * ################################################################
00003  * 
00004  * ProActive: The Java(TM) library for Parallel, Distributed, 
00005  *            Concurrent computing with Security and Mobility
00006  * 
00007  * Copyright (C) 1997-2007 INRIA/University of Nice-Sophia Antipolis
00008  * Contact: proactive@objectweb.org
00009  * 
00010  * This library is free software; you can redistribute it and/or
00011  * modify it under the terms of the GNU Lesser General Public
00012  * License as published by the Free Software Foundation; either
00013  * version 2.1 of the License, or any later version.
00014  *  
00015  * This library is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  * Lesser General Public License for more details.
00019  * 
00020  * You should have received a copy of the GNU Lesser General Public
00021  * License along with this library; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
00023  * USA
00024  *  
00025  *  Initial developer(s):               The ProActive Team
00026  *                        http://www.inria.fr/oasis/ProActive/contacts.html
00027  *  Contributor(s): 
00028  * 
00029  * ################################################################
00030  */ 
00031 package org.objectweb.proactive.ext.scilab.monitor;
00032 
00033 import java.io.File;
00034 
00035 import org.objectweb.proactive.ext.scilab.SciResult;
00036 import org.objectweb.proactive.ext.scilab.SciTask;
00037 
00041 public class SciTaskInfo {
00042 
00043         public static final int LOW=0, NORMAL=1, HIGH=2;
00044         public static final int SUCCEEDED = 0, 
00045                                                         ABORTED = 1, 
00046                                                         PENDING = 2, 
00047                                                         RUNNING = 3, 
00048                                                         KILLED = 4, 
00049                                                         CANCELLED = 5,
00050                                                         REMOVED = 6;
00051         
00052         private int priority = NORMAL;
00053         
00054         private int state;
00055         private String idEngine;
00056         private File fileScript;
00057         private SciTask sciTask;
00058         private SciResult sciResult;
00059         private long dateStart;
00060         private long dateEnd;
00061         
00062         public SciTaskInfo(SciTask sciTask){
00063                 this.sciTask = sciTask;
00064                 this.dateStart = System.currentTimeMillis();
00065         }
00066         public int getPriority() {
00067                 return priority;
00068         }
00069         public void setPriority(int priority) {
00070                 this.priority = priority;
00071         }
00072         
00073         public SciTask getSciTask() {
00074                 return sciTask;
00075         }
00076         public SciResult getSciResult() {
00077                 return sciResult;
00078         }
00079         public void setSciResult(SciResult sciResult) {
00080                 this.sciResult = sciResult;
00081         }
00082         public String getIdTask() {
00083                 return sciTask.getId();
00084         }
00085         public int getState() {
00086                 return state;
00087         }
00088         public void setState(int state) {
00089                 this.state = state;
00090         }
00091         public String getIdEngine() {
00092                 return idEngine;
00093         }
00094         public void setIdEngine(String idEngine) {
00095                 this.idEngine = idEngine;
00096         }
00097         
00098         public void setDateEnd(){
00099                 this.dateEnd = System.currentTimeMillis();
00100         }
00101         
00102         public long getTimeGlobal(){
00103                 return this.dateEnd - this.dateStart;
00104         }
00105         
00106         public long getTimeExecution(){
00107                 return this.sciResult.getTimeExecution();
00108         }
00109         public long getDateStart() {
00110                 return dateStart;
00111         }
00112         public String getPathScript() {
00113                 return fileScript.getAbsolutePath();
00114         }
00115         
00116         public String getNameScript() {
00117                 return fileScript.getName();
00118         }
00119 
00120         public void setFileScript(File fileScript) {
00121                 this.fileScript = fileScript;
00122         }
00123 }

Generated on Mon Jan 22 15:16:10 2007 for ProActive by  doxygen 1.5.1