|
From: <das...@us...> - 2008-10-29 20:33:16
|
Revision: 1184
http://vlab.svn.sourceforge.net/vlab/?rev=1184&view=rev
Author: dasil014
Date: 2008-10-29 20:33:14 +0000 (Wed, 29 Oct 2008)
Log Message:
-----------
Lightweight class with fewer methods, but it still needs to be smaller.
Modified Paths:
--------------
trunk/vlab/services/project-executor/src/main/java/org/vlab/services/ProjectExecutor.java
Modified: trunk/vlab/services/project-executor/src/main/java/org/vlab/services/ProjectExecutor.java
===================================================================
--- trunk/vlab/services/project-executor/src/main/java/org/vlab/services/ProjectExecutor.java 2008-10-29 20:14:14 UTC (rev 1183)
+++ trunk/vlab/services/project-executor/src/main/java/org/vlab/services/ProjectExecutor.java 2008-10-29 20:33:14 UTC (rev 1184)
@@ -50,26 +50,26 @@
public static Receipt phaseReceipt5; /*HiPT Thermo*/
public static Receipt phaseReceipt6; /*HiPT Cij*/
- private static List ListPhaseReceipt = null;
- private static List ListTaskReceipt = null;
+ //private static List ListPhaseReceipt = null;
+ public static List ListTaskReceipt = null;
- private static String ENV_PACKAGE_DIR;
+ public static String ENV_PACKAGE_DIR;
private String ENV_LOG_DIR; /* ENV_LOG_DIR + ProjectId_ + ProjectName*/
- private String ENV_SCRIPT;
- private String zipFileName;
+ public static String ENV_SCRIPT;
+ public static String zipFileName;
private String logFileName;
- private static String dirEPName;
- private static String projectId;
- private static String projectName;
+ public static String dirEPName;
+ public static String projectId;
+ public static String projectName;
public static String projectType; /* These types can be single, Equation of State(Fast Refine & Long Refine) & Cij*/
- private static String projectUserName;
+ public static String projectUserName;
- private static String dbFlavor;
- private static String dbDriver;
- private static String dbHostName;
- private static String dbPortNumber;
- private static String dbUserName;
- private static String dbPassword;
+ public static String dbFlavor;
+ public static String dbDriver;
+ public static String dbHostName;
+ public static String dbPortNumber;
+ public static String dbUserName;
+ public static String dbPassword;
private String compound;
//private TaskDistributor disp = null;
@@ -78,22 +78,22 @@
private ElasPwscfBean ComplexCalcInput = null;
private String initialInput = null;
- private String stringResultFit = "";
+ private static String stringResultFit = "";
private String stringCijOutput = "";
private String filetodb = "";
public static final String INPUT_GENERIC = "GenericInput";
private int qtdpackages;
- private String crystalType;
+ private static String crystalType;
private String fullpathproject;
private String newInputEdited;
- private String tablesemaphore;
- private String numofupdate;
- private String receiptStringFromDb;
+ private static String tablesemaphore;
+ private static String numofupdate;
+ private static String receiptStringFromDb;
private String kindPhase;
private String esgUrl;
- private static String tdUrl;
+ public static String tdUrl;
public static int taskFinishedP = 0;
public static String batchMode;
@@ -105,19 +105,19 @@
public ProjectExecutor(){
projectReceipt = new Receipt();
-
+ /*
phaseReceipt1 = new Receipt();
phaseReceipt2 = new Receipt();
phaseReceipt3 = new Receipt();
phaseReceipt4 = new Receipt();
phaseReceipt5 = new Receipt();
phaseReceipt6 = new Receipt();
-
- ListPhaseReceipt = new Vector();
+ */
-
loadProperties();
+ ListTaskReceipt = new Vector();
+
}
// SETTERS
@@ -133,7 +133,6 @@
this.pesdataexecutionpackage = newPesdataexecutionpackage;
}
-
public static void setDirEPName(){
dirEPName = projectId + "_" + projectName + "/";
}
@@ -254,7 +253,7 @@
} catch (Exception ae){
System.err.println("[ProjectExecutor::loadProperties] Error loading resource properties => "+ae.getMessage());
ae.printStackTrace();
- System.exit(-1);
+ //System.exit(-1);
}
this.dbFlavor = proper.getProperty("DBFLAV");
@@ -292,697 +291,7 @@
System.out.println("DBUSERNAME => " + dbUserName);
System.out.println("DBPASS => " + dbPassword);
}
-
- public static synchronized void setProjectReceipt(){
-
- /*Set the right path for Project*/
- setDirEPName();
- /*if (projectType.equals("1"))
- ListPhaseReceipt1 = new ArrayList();
- else if (projectType.equals("2") && phaseOption.booleanValue()==false)
- ListPhaseReceipt2 = new ArrayList();
- else if (projectType.equals("2") && phaseOption.booleanValue()==true)
- ListPhaseReceipt3 = new ArrayList();
- else{
- ListPhaseReceipt4 = new ArrayList();
- }*/
-
- List bdataContentProject = new Vector();
- Bdata bdataData = null;
-
- try{
- /*Project Receipt*/
- projectReceipt.setCode("001");
- projectReceipt.setKind("Project");
- projectReceipt.setProjectid(getProjectId());
- projectReceipt.setProjectname(getProjectName());
- System.out.println("\nHere I set the inittial projectReceipt\n");
-
- bdataData = new Bdata();
- bdataData.setId("009");
- bdataData.setCode("EnvLogDir");
- bdataData.setKeyword("ENVLOGDIR");
- bdataData.setSvalue(ENV_PACKAGE_DIR + dirEPName);
- bdataContentProject.add(bdataData);
-
- bdataData = new Bdata();
- bdataData.setId("ReceiptId");
- bdataData.setCode("015");
- bdataData.setKeyword("RECEIPTID");
- bdataData.setSvalue(projectId + "." + projectName + "." + projectUserName);
- bdataContentProject.add(bdataData);
-
- System.out.println("\nHere I set the bdata for the ProjectReceipt\n");
-
- projectReceipt.setContent(bdataContentProject);
- } catch (Exception ae){
- System.err.println("[ProjectExecutor::setProjectReceipt] Error defining the Project Receipt: "+ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
-
- }
-
- public static synchronized void setPhaseReceipt(){
- System.out.println("\n Here I start the Project Phase Receipt\n");
-
- Bdata bdataData = null;
- List bdataContentPhase = new Vector();
-
- ListTaskReceipt = new Vector();
-
- try{
- if (projectType.equals("1")){
- /* Phase Receipt For Single Calculation */
- phaseReceipt1.setCode("002");
- phaseReceipt1.setKind("Single Phase");
- phaseReceipt1.setProjectid(getProjectId());
- phaseReceipt1.setProjectname(getProjectName());
- System.out.println("YOU CHOOSE SINGLE CALCULATION");
- setPhaseOption(new Boolean(false));
-
- /*Setting ID value for phaseReceipt*/
- // bdataData = new Bdata();
- // bdataData.setId("ReceiptId");
- // bdataData.setCode("015");
- // bdataData.setKeyword("RECEIPTID");
- // bdataData.setSvalue("01"+"."+ projectId + "." + projectName + "." + projectUserName);
- // bdataContentPhase.add(bdataData);
-
- // phaseReceipt1.setContent(bdataContentPhase);
- }
- } catch (Exception ae){
- System.err.println("[ProjectExecutor::setPhaseReceipt()] Error defining Phase Receipt for Single Calculation: "+ ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
-
-
- try{
- if (projectType.equals("2") && phaseOption.booleanValue()==true){
- /* Phase Receipt For Fast Refine */
- phaseReceipt2.setCode("002");
- phaseReceipt2.setKind("Approximate EOS");
- phaseReceipt2.setProjectid(getProjectId());
- phaseReceipt2.setProjectname(getProjectName());
- System.out.println("YOU CHOOSE FAST REFINE");
-
- // if (phaseReceipt2.getContent() == null){
- // /*Setting ID value for phaseReceipt*/
- // bdataData = new Bdata();
- // bdataData.setId("ReceiptId");
- // bdataData.setCode("015");
- // bdataData.setKeyword("RECEIPTID");
- // bdataData.setSvalue("02"+"."+ projectId + "." + projectName + "." + projectUserName);
- // bdataContentPhase.add(bdataData);
- //
- // phaseReceipt2.setContent(bdataContentPhase);
- // }
-
- }else if (projectType.equals("2") && phaseOption.booleanValue()==false){
- /* Phase Receipt Receipt For Long Refine */
- phaseReceipt3.setCode("002");
- phaseReceipt3.setKind("EOS Refinement");
- phaseReceipt3.setProjectid(getProjectId());
- phaseReceipt3.setProjectname(getProjectName());
- System.out.println("YOU CHOOSE LONG REFINE");
-
- // if (phaseReceipt3.getContent() == null){
- // /*Setting ID value for phaseReceipt*/
- // bdataData = new Bdata();
- // bdataData.setId("ReceiptId");
- // bdataData.setCode("015");
- // bdataData.setKeyword("RECEIPTID");
- // bdataData.setSvalue("03"+"."+ projectId + "." + projectName + "." + projectUserName);
- // bdataContentPhase.add(bdataData);
- //
- // phaseReceipt3.setContent(bdataContentPhase);
- // }
-
- }
- } catch (Exception ae){
- System.err.println("[ProjectExecutor::setPhaseReceipt()] Error defining Phase receipt for EOS Calculation: "+ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
-
- try{
- /*This if means I am using Cij Calculation*/
- if (phaseOption.booleanValue()==false && projectType.equals("3")){
- phaseReceipt4.setCode("003");
- phaseReceipt4.setKind("Cij Calculation");
- phaseReceipt4.setProjectid(getProjectId());
- phaseReceipt4.setProjectname(getProjectName());
- System.out.println("YOU ARE RUNNING CIJ CALCULATION");
-
- // if (phaseReceipt4.getContent() == null){
- // /*Setting ID value for phaseReceipt*/
- // bdataData = new Bdata();
- // bdataData.setId("ReceiptId");
- // bdataData.setCode("015");
- // bdataData.setKeyword("RECEIPTID");
- // bdataData.setSvalue("04"+"."+ projectId + "." + projectName + "." + projectUserName);
- // bdataContentPhase.add(bdataData);
-
- // phaseReceipt4.setContent(bdataContentPhase);
- // }
- }
- } catch (Exception ae){
- System.err.println("[ProjectExecutor::setPhaseReceipt()] Error defining Phase receipt for Cij Calculation: "+ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
-
-
- try{
- /*Project Type for HiPT Thermo*/
- if (phaseOption.booleanValue()==false && projectType.equals("4")){
- phaseReceipt5.setCode("004");
- phaseReceipt5.setKind("HiPT Thermo");
- phaseReceipt5.setProjectid(getProjectId());
- phaseReceipt5.setProjectname(getProjectName());
- System.out.println("YOU ARE RUNNING HIPT THERMO");
-
- //if (phaseReceipt5.getContent() == null){
- // /*Setting ID value for phaseReceipt*/
- // bdataData = new Bdata();
- // bdataData.setId("ReceiptId");
- // bdataData.setCode("015");
- // bdataData.setKeyword("RECEIPTID");
- // bdataData.setSvalue("05"+"."+ projectId + "." + projectName + "." + projectUserName);
- // bdataContentPhase.add(bdataData);
- //
- // phaseReceipt5.setContent(bdataContentPhase);
- // }
- }
- } catch(Exception ae){
- System.err.println("[ProjectExecutor::setPhaseReceipt()] Error defining the Hipt Thermo project: "+ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
-
- try{
- /*Project Type for HiPT Cij*/
- if (phaseOption.booleanValue()==false && projectType.equals("5")){
- phaseReceipt6.setCode("005");
- phaseReceipt6.setKind("HiPT Cij");
- phaseReceipt6.setProjectid(getProjectId());
- phaseReceipt6.setProjectname(getProjectName());
- System.out.println("YOU ARE RUNNING HIPT CIJ");
-
- //if (phaseReceipt6.getContent() == null){
- /*Setting ID value for phaseReceipt*/
- // bdataData = new Bdata();
- //bdataData.setId("ReceiptId");
- // bdataData.setCode("015");
- // bdataData.setKeyword("RECEIPTID");
- // bdataData.setSvalue("06"+"."+ projectId + "." + projectName + "." + projectUserName);
- // bdataContentPhase.add(bdataData);
-
- // phaseReceipt6.setContent(bdataContentPhase);
- //}
- }
- } catch (Exception ae){
- System.err.println("[ProjectExecutor::setPhaseReceipt()] Error defininf Hipt Cij project: " +ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
- }
-
- public static synchronized void setTaskReceipt(String ThreadName, String TaskReceipt){
-
- //System.out.println("\nHere I start the setTaskReceipt with the following Receipt: \n"+TaskReceipt+"\n\n");
- StringReader ReceiptReader = null;
- Receipt newtaskReceipt = new Receipt();
-
- try{
- ReceiptReader = new StringReader(TaskReceipt);
- } catch (Exception ae){
- System.err.println("[Project::setTaskReceipt()] => Error creating the String Reader: " + ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
-
- try{
- Unmarshaller un = new Unmarshaller(Receipt.class);
- newtaskReceipt = (Receipt) un.unmarshal(ReceiptReader);
- } catch (Exception ae){
- System.err.println("[ProjectExecutor::setTaskReceipt()] => Error: " + ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
-
- try{
- System.out.println("Receipt Code: " + newtaskReceipt.getCode());
- System.out.println("Receipt Kind: " + newtaskReceipt.getKind());
- ListTaskReceipt.add(newtaskReceipt);
- } catch(Exception ae){
- System.err.println("[ProjectExecutor::setTaskReceipt] Adding Task inside the list of Tasks: "+ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
-
- System.out.println("Here the thread"+ThreadName + "I put the taskreceipt on the phase list"+ListTaskReceipt.size());
- }
-
- public void setTheNewPackage(){
-
- File readExecutionPackage = null;
- byte[] buff = null;
- InputStream sourcefile = null;
-
- try{
- readExecutionPackage = new File(ProjectExecutor.ENV_PACKAGE_DIR + ProjectExecutor.dirEPName + "ComplexCalc.zip");
- setZipFileName("ComplexCalc.zip");
-
- System.out.println("\n File name is: "+readExecutionPackage.getName());
- System.out.println("\n File size is: "+readExecutionPackage.length());
-
- int filesiuze = (int) readExecutionPackage.length();
- buff = new byte[filesiuze];
- sourcefile = new FileInputStream(readExecutionPackage);
- sourcefile.read(buff);
- pesdataexecutionpackage = new String(Base64.encode(buff));
- }catch (Exception ae){
- System.err.println("[ProjectExecutor::setTheNewPackage()] => Error "+ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
- }
-
- public static synchronized String ProjectReceiptToString(Receipt projectReceipt){
-
- System.out.println("\nHere I'm on TaskReceipToString()\n");
- StringWriter classXmlFile = null;
- try{
- classXmlFile = new StringWriter();
- Marshaller.marshal(projectReceipt,classXmlFile);
- } catch (Exception ae){
- System.err.println("[ProjectExecutor::ProjectReceiptToString()] => Error: " + ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
- //System.out.println("On ProjectReceiptToString() My task class receipt right now is: " + classXmlFile.toString());
-
- return classXmlFile.toString();
- }
-
- public static synchronized String PhaseReceiptToString(Receipt phaseReceipt){
-
- System.out.println("\nHere I'm on PhaseReceiptToString()\n");
- StringWriter classXmlFile = null;
- try{
- classXmlFile = new StringWriter();
- Marshaller.marshal(phaseReceipt,classXmlFile);
-
- } catch (Exception ae){
- System.err.println("[ProjectExecutor::PhaseReceiptToString()] => Error: " + ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
- //System.out.println("On PhaseReceiptToString() My phase class receipt right now is: " + classXmlFile.toString());
-
- return classXmlFile.toString();
- }
-
- public static synchronized String TaskReceipToString(Receipt taskReceipt){
-
- System.out.println("\nHere I'm on TaskReceipToString()\n");
- StringWriter classXmlFile = null;
- try{
- classXmlFile = new StringWriter();
- Marshaller.marshal(taskReceipt,classXmlFile);
-
- } catch (Exception ae){
- System.err.println("[ProjectExecutor::TaskReceipToString()] => Error: " + ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
- //System.out.println("On TaskReceipToString() My task class receipt right now is: " + classXmlFile.toString());
- return classXmlFile.toString();
- }
-
- /* public receipt StringToTaskReceipt(String StringTaskReceipt){
- System.out.println("");
- receipt receiptTask = null;
- return receiptTask;
- }*/
-
- public static synchronized void setCloseProjectReceipt(){
-
- System.out.println("\n Here I start the setCloseProjectReceipt() \n");
- try{
- System.out.println("\n\n\n\n\n\n\nWHILE CLOSE THE RECEIPT the List Phase Size is: "+ListPhaseReceipt.size()+"\n\n\n\n");
-
- projectReceipt.setAttachamments(ListPhaseReceipt);
- /*
- if (projectType.equals("1"))
- projectReceipt.setAttachamments(ListPhaseReceipt1);
- else if (projectType.equals("2") && phaseOption.booleanValue()==false)
- projectReceipt.setAttachamments(ListPhaseReceipt2);
- else if (projectType.equals("2") && phaseOption.booleanValue()==true)
- projectReceipt.setAttachamments(ListPhaseReceipt3);
- else{
- projectReceipt.setAttachamments(ListPhaseReceipt4);
- }*/
- SaveReceipt(ProjectReceiptToString(projectReceipt));
- System.out.println("\nHere I finished the receipt project and Saved on DataBase\n");
- } catch(Exception ae){
- System.err.println("[ProjectExecutor::setCloseProjectReceipt()] Error closing the project receipt: "+ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
- }
-
- /*private void convertedReceipt(){
-
-
-
- System.out.println("I current receipt is: "+stringReceipt);
- StringReader ReceiptReader = new StringReader(stringReceipt);
-
- try{
- Unmarshaller un = new Unmarshaller(Receipt.class);
- receiptProject = (Receipt) un.unmarshal(ReceiptReader);
- } catch (Exception ae){
- System.err.println("Monitor::loadProjectReceipt()] Error doing the Unmarshaller: " + ae.getMessage());
- ae.printStackTrace();
- }
-
- ListPhase = receiptProject.getAttachamments();
- setPhaseSize(ListPhase.size());
-
- }
-
- public void loadPhaseReceipt(int indexPhase){
-
- ListPhase = receiptProject.getAttachamments();
-
- System.out.println("My Receipt used by the Monitor is: "+stringReceipt);
-
- //for(int i=0; i< ListPhase.size();i++){
-
- receiptPhase = (Receipt) (ListPhase.get(indexPhase));
- ListTask = receiptPhase.getAttachamments();
- setSkindphase(receiptPhase.getKind());
-
-
- List ListContentPhaseReceipt = receiptPhase.getContent();
- if (ListContentPhaseReceipt != null){
- Bdata BdataContent = new Bdata();
- for(int i=0; i < ListContentPhaseReceipt.size();i++){
-
- BdataContent = (Bdata) ListContentPhaseReceipt.get(i);
-
- if (BdataContent.getKeyword().equals("STATUSPHASE")){
- this.statusPhase = BdataContent.getSvalue();
- }
- }
- }
-
- if (this.statusPhase == null || ListContentPhaseReceipt == null ){
- this.setStatusPhase("None");
- }
-
- //this.setStatusPhase("None");
-
- }
-
- //public String getKindPhase(){
- //}
-
- public void loadTaskReceipt(){
-
- System.out.println("\n Here I'm on loadTaskReceipt\n");
-
- List ListContent = null;
- Bdata Content = null;
-
- startTime = new String[ListTask.size()];
- serverSide = new String[ListTask.size()];
- status = new String[ListTask.size()];
- packageName = new String[ListTask.size()];
- endTime = new String[ListTask.size()];
-
- setTaskSize(ListTask.size());
-
- for(int j=0;j<ListTask.size();j++){
- receiptTask = (Receipt) ListTask.get(j);
- ListContent = receiptTask.getContent();
- for(int l=0; l < ListContent.size(); l++){
- Content = (Bdata) ListContent.get(l);
-
- System.out.println(Content.getKeyword()+"::"+Content.getSvalue()+"\t");
-
- if (Content.getKeyword().equals("STARTTIME"))
- startTime[j] = Content.getSvalue();
-
- if (Content.getKeyword().equals("HOSTNAME"))
- serverSide[j] = Content.getSvalue();
-
- if (Content.getKeyword().equals("STATUSPROCESS"))
- status[j] = Content.getSvalue();
-
- if (Content.getKeyword().equals("PACKAGENAME"))
- packageName[j] = Content.getSvalue();
-
- if (Content.getKeyword().equals("ENDTIME"))
- endTime[j] = Content.getSvalue();
-
- }
- System.out.println("\n\n");
- }
- }
-
- public void loadSpecificTask(){
-
- System.out.println("\n Here I'm on loadSpecificTask()\n");
-
- List ListContent = null;
- Bdata Content = null;
-
- receiptTask = (Receipt) ListTask.get(taskIndex);
- ListContent = receiptTask.getContent();
- for(int i=0;i<ListContent.size();i++){
-
- Content = (Bdata) ListContent.get(i);
-
- System.out.println(Content.getKeyword()+"::"+Content.getSvalue()+"\t");
-
- if (Content.getKeyword().equals("STARTTIME"))
- setSstarttime(Content.getSvalue());
-
- if (Content.getKeyword().equals("HOSTNAME"))
- setShostname(Content.getSvalue());
-
- if (Content.getKeyword().equals("STATUSPROCESS"))
- setSstatus(Content.getSvalue());
-
- if (Content.getKeyword().equals("IPADDRESS"))
- setSfullurl(Content.getSvalue());
-
- if (Content.getKeyword().equals("PROCESSID"))
- setSprocessid(Content.getSvalue());
-
- if (Content.getKeyword().equals("PATHEXEC"))
- setSfullpath(Content.getSvalue());
-
- if (Content.getKeyword().equals("PACKAGENAME"))
- setSpackagename(Content.getSvalue());
-
- if (Content.getKeyword().equals("ENDTIME"))
- setSendtime(Content.getSvalue());
- }
- }
- }
- */
-
-
-
- public static synchronized void setClosePhaseReceiptSingle(){
- /* Method used by Single Calcuation */
- System.out.println("\n Here I start the setClosePhaseReceiptSingle() \n");
-
- try{
- phaseReceipt1.setAttachamments(ListTaskReceipt);
- System.out.println("\n Here I put the task receipt on the phase attachament \n");
-
- //ListTaskReceipt = null;
- //PhaseReceiptToString(phaseReceipt);
- //ListPhaseReceipt.add(phaseReceipt1);
- if (ListPhaseReceipt.isEmpty())
- ListPhaseReceipt.add(0, phaseReceipt1);
- else
- ListPhaseReceipt.set(0, phaseReceipt1);
- } catch (Exception ae){
- System.err.println("[ProjectExecutor::setClosePhaseReceiptSingle()] Error Closing Single Receipt Phase: "+ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
- }
-
- public static synchronized void setClosePhaseReceiptFastRefine(String when){
- /* Method used by Fast Refine */
-
- System.out.println("\n Here I start the setClosePhaseReceiptFastRefine() from: \n"+when);
- try{
- phaseReceipt2.setAttachamments(ListTaskReceipt);
- System.out.println("\n Here I put the task receipt on the phase attachament \n");
-
- //ListTaskReceipt = null;
- //PhaseReceiptToString(phaseReceipt);
- //ListPhaseReceipt = new ArrayList();
-
- if (ListPhaseReceipt.isEmpty())
- ListPhaseReceipt.add(0,phaseReceipt2);
- else
- //ListPhaseReceipt.remove(0);
- //ListPhaseReceipt.add(0,phaseReceipt2);
- ListPhaseReceipt.set(0,phaseReceipt2);
-
-
- System.out.println("In the End: setClosePhaseReceiptFastRefine => List Size: "+ListPhaseReceipt.size());
- }catch (Exception ae){
- System.err.println("[ProjectExecutor::setClosePhaseReceiptFastRefine()] Error Closing Fast Refine Receipt Phase: "+ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
- }
-
- public static synchronized void setClosePhaseReceiptLongRefine(String when){
- /* Method used by Long Refine */
- try{
- System.out.println("\n Here I start the setClosePhaseReceiptLongRefine() The list Task size now is: "+ListTaskReceipt.size()+" from: \n"+when);
-
- System.out.println("\n The ListPhaseReceipt size is: " + ListPhaseReceipt.size());
-
-
-
- //ListTaskReceipt = null;
- //PhaseReceiptToString(phaseReceipt);
- //ListPhaseReceipt = new ArrayList();
- if (ListPhaseReceipt.isEmpty()){
- System.out.println("If Phase Receipt Long Refine is empty I will go here and insert ListPhaseReceipt.add(0,phaseReceipt3);");
- ListPhaseReceipt.add(0,phaseReceipt2);
- ListPhaseReceipt.add(1,phaseReceipt3);
- }
-
- else if (ListPhaseReceipt.size()==1){
- if (phaseOption.booleanValue()==false){
- System.out.println("If Phase Receipt Long Refine I will go here and update ListPhaseReceipt.set(0,phaseReceipt3);");
- ListPhaseReceipt.set(0,phaseReceipt2); //Updating the The Long Refine, when I defined just one Long Refine project
- ListPhaseReceipt.add(1,phaseReceipt3); //Updating the The Long Refine, when I defined just one Long Refine project
- }else{
- System.out.println("If Phase Receipt Long Refine I will go here and insert ListPhaseReceipt.add(1,phaseReceipt3);");
- ListPhaseReceipt.set(0,phaseReceipt2);
- ListPhaseReceipt.add(1,phaseReceipt3); //Add the Long Refine, when I had previously the Fast Refine
- }
- }
- else if (ListPhaseReceipt.size()==2){
- System.out.println("If Phase Receipt Long Refine I will go here and update ListPhaseReceipt.set(1,phaseReceipt3);");
- ListPhaseReceipt.set(0,phaseReceipt2);
- ListPhaseReceipt.set(1,phaseReceipt3); //Update the Long Refine, when I had the Fast Refined already executed.
- }
-
- phaseReceipt3.setAttachamments(ListTaskReceipt);
- System.out.println("\n Here I put the task receipt on the phase attachament \n");
-
- System.out.println("\n\n\n\tThe Long Refine List size right now is: "+ListPhaseReceipt.size());
- } catch (Exception ae){
- System.err.println("[ProjectExecutor::setClosePhaseReceiptLongRefine()] Error closing Long Refine Receipt Phase: "+ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
- }
-
-
- public static synchronized void setClosePhaseReceiptCij(String when){
-
- System.out.println("\n Here I start the setClosePhaseReceiptCij() \n");
-
- try{
-
- phaseReceipt4.setAttachamments(ListTaskReceipt);
- System.out.println("\n Here I put the task receipt on the phase attachament from: \n"+when);
-
- //ListTaskReceipt = null;
- //PhaseReceiptToString(phaseReceipt);
-
- if (ListPhaseReceipt.size()==1)
-
- ListPhaseReceipt.add(1,phaseReceipt4);
- else if (ListPhaseReceipt.size()==2){
- if (phaseOption.booleanValue()==false){
- ListPhaseReceipt.add(2,phaseReceipt4);
- }else{
- ListPhaseReceipt.add(2,phaseReceipt4);
- }
- }
- else if (ListPhaseReceipt.size()==3){
- ListPhaseReceipt.set(2,phaseReceipt4);
- }
-
- System.out.println("In the End: setClosePhaseReceiptCij => List Size: "+ListPhaseReceipt.size());
-
- } catch(Exception ae){
- System.err.println("[ProjectExecutor::setClosePhaseReceiptCij()] Error closing Cij Receipt Phase: "+ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
- }
-
- public static synchronized void setClosePhaseReceiptHighTPTHermo(String when){
-
- System.out.println("\n Here I start the setClosePhaseReceiptHighTPTHermo() from: \n"+when);
-
- System.out.println("ListPhaseReceipt: "+ListPhaseReceipt.size() + " =>ListTaskReceipt: "+ListTaskReceipt.size());
-
- try{
- phaseReceipt5.setAttachamments(ListTaskReceipt);
- System.out.println("\n Here I put all the tasks receipt on the phase attachament \n");
-
- //ListTaskReceipt = null;
- //PhaseReceiptToString(phaseReceipt);
-
- if (ListPhaseReceipt.size()==1){
- System.out.println("If Phase Receipt Thermo is 1 I will go here and insert ListPhaseReceipt.add(1,phaseReceipt5);");
- ListPhaseReceipt.add(0,phaseReceipt2);
- ListPhaseReceipt.add(1, phaseReceipt2);
- ListPhaseReceipt.add(2,phaseReceipt5);
- }
-
- else if (ListPhaseReceipt.size()==2){
- if (phaseOption.booleanValue()==false){
- System.out.println("If Phase Receipt Thermo is 2 I will go here and update ListPhaseReceipt.set(1,phaseReceipt5);");
- ListPhaseReceipt.set(0,phaseReceipt2);
- ListPhaseReceipt.set(1,phaseReceipt3);
- ListPhaseReceipt.add(2,phaseReceipt5);
- }else{
- System.out.println("If Phase Receipt Thermo is 2 I will go here and insert ListPhaseReceipt.add(2,phaseReceipt5);");
- ListPhaseReceipt.set(0, phaseReceipt2);
- ListPhaseReceipt.set(1, phaseReceipt3);
- ListPhaseReceipt.add(2, phaseReceipt5);
- }
- }
- else if (ListPhaseReceipt.size()==3){
- System.out.println("If Phase Receipt Thermo is 3 I will go here and insert ListPhaseReceipt.set(2,phaseReceipt5);");
- ListPhaseReceipt.set(0, phaseReceipt2);
- ListPhaseReceipt.set(1, phaseReceipt3);
- ListPhaseReceipt.set(2,phaseReceipt5);
- }
-
- phaseReceipt5.setAttachamments(ListTaskReceipt);
- System.out.println("\n Here I put all the tasks receipt on the phase attachament \n");
-
- System.out.println("In the End: setClosePhaseReceiptHighTPTHermo => List Size: "+ListPhaseReceipt.size());
- } catch(Exception ae){
- System.err.println("[ProjectExecutor::setClosePhaseReceiptHighTPTHermo()] Error closing HighTP Thermo Receipt Phase: "+ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
- }
-
//GETTERS
public String getLogFileName(){
return this.logFileName;
@@ -1008,16 +317,16 @@
try{
setDirEPName();
-
+
if (kindPhase.equals("Approximate EOS") )//Fast Refine
this.ReadFastRefineFitting();
if (kindPhase.equals("EOS Refinement") )//Long Refine
- this.ReadLongRefineFitting();
+ ReadLongRefineFitting();
} catch (Exception ae){
System.err.println("[ProjectExecutor::getStringResultFit()] Error Running the Fitting EOS: "+ae.getMessage());
ae.printStackTrace();
- System.exit(-1);
+ //System.exit(-1);
}
return this.stringResultFit;
@@ -1027,12 +336,12 @@
try{
setDirEPName();
- CijGentab();
+ OutRunnings.CijGentab();
ReadCijGentab();
} catch (Exception ae){
System.err.println("[ProjectExecutor::getStringCijOutput()] Error Reading the Cij Output: " +ae.getMessage());
ae.printStackTrace();
- System.exit(-1);
+ //System.exit(-1);
}
return this.stringCijOutput;
@@ -1066,8 +375,8 @@
return this.compound;
}
- public String getCrystalType(){
- return this.crystalType;
+ public static String getCrystalType(){
+ return crystalType;
}
public String getFullpathproject(){
@@ -1106,11 +415,11 @@
try{
this.setDirEPName();
- CijGentab();
+ OutRunnings.CijGentab();
} catch(Exception ae){
System.err.println("[ProjectExecutor::getFiletodb()] Error defing directory for CIJ output: "+ae.getMessage());
ae.printStackTrace();
- System.exit(-1);
+ //System.exit(-1);
}
FileReader FileRead = null;
@@ -1132,7 +441,7 @@
} catch(Exception ae){
System.err.println("[ProjectExecutor::getFiletodb] Error reading the file: => " + ae.getMessage());
ae.printStackTrace();
- System.exit(-1);
+ //System.exit(-1);
}
return this.filetodb;
@@ -1140,1159 +449,114 @@
public void run(){
- System.out.println("\n Here I call the run \n");
+ Receipt projectReceipt = null;
+ System.out.println("\n Here I call the run and execute basic commands\n");
try{
/* Start the Project Receipt */
- setProjectReceipt();
- setCreatePackage();
+ //setProjectReceipt();
+ OutRunnings.setCreatePackage(pesdataexecutionpackage);
} catch(Exception ae){
System.err.println("[ProjectExecutor::run()] Error starting upt Project Receipt inside run method: " + ae.getMessage());
ae.printStackTrace();
- System.exit(-1);
+ //System.exit(-1);
}
+
+ ExecuteProject execute = null;
-
try{
- if (projectType.equals("1")){ /* This is Single Calculation */
- System.out.println("\nHere I start the Single Calculation");
- System.out.println("\nReturn from UncompressExecutionPackage: "+UnCompressExecutionPackage());
-
- /* Start the Phase Receipt */
- setPhaseReceipt();
-
-
- /*This method do a send of package to Task Executor, selected by Task Dispacther*/
- setDispSetting();
-
- /*It call the method below to fill up all the path package into the phase receipt*/
- this.AddPckPathSingleCalc();
-
- AddStatusPhase("Running");
-
- //setClosePhaseReceipt();
- Poll(phaseReceipt1.getAttachamments(), "Single");
-
- AddStatusPhase("Completed");
-
- getOutPutTask();
- System.out.println("\nHere I finish the Single Calculation\n");
+ execute = new ExecuteProject();
+ execute.prepare_project();
- } else if (projectType.equals("2") && phaseOption.booleanValue()==true){ /* This is Fast Refine */
-
- System.out.println("Here I uncompress the "+this.zipFileName + " with " + UnCompressComplexCalc());
-
- System.out.println("Start the Spliiter right here for Fast Refine");
- SendPackageESG();
-
- System.out.println("\nHere I finish the splitter");
- System.out.println("\nHere I start uncompress the TarBallFromWS.zip");
- System.out.println("\nReturn from uncompressTarBallfromWS: "+ UnCompressTarBallFromWS());
- System.out.println("\nReturn from UncompressExecutionPackage: " + UnCompressExecutionPackage());
-
- /* Start the Phase Receipt */
- setPhaseReceipt();
-
- setDispSetting();
- //setClosePhaseReceipt();
- //setCloseProjectReceipt();
-
- /*It call the method below to fill up all the path package into the phase receipt of Fast Refine*/
- this.AddPckPathFastRefine();
-
- AddStatusPhase("Running");
-
- Poll(phaseReceipt2.getAttachamments(), "Fast Refine");
-
- AddStatusPhase("Completed");
-
- getOutPutTask();
-
- setFastRefineFitting();
-
- ReadFastRefineFitting();
- /*Here I finish the Fast Refine*/
-
- /*Now Starting the Long Refine*/
- CreatePackage();
- System.out.println("Terminei de criar o arquivo aqui and my ListPhase size is: "+this.ListPhaseReceipt.size() +" and ListTaskSize is: "+this.ListTaskReceipt.size());
-
- /*Here I just change the phase option to run the EOS Refinement aka Long Refine*/
- setPhaseOption(new Boolean(false));
- setPhaseReceipt();
-
- //List OldPhaseList = this.ListPhaseReceipt;
-
- setTheNewPackage();
-
- SendPackageESG();
-
- System.out.println("\nHere I finish the splitter");
- System.out.println("\nHere I start uncompress the TarBallFromWS.zip");
- System.out.println("\nReturn from uncompressTarBallfromWS: "+ UnCompressTarBallFromWS());
- System.out.println("\nReturn from UncompressExecutionPackage: "+UnCompressExecutionPackage());
-
- /* Start the Phase Receipt */
- //setPhaseReceipt();
-
- setDispSetting();
-
- /*It call the method below to fill up all the path package into the phase receipt of Long Refine*/
- this.AddPckPathLongRefine();
-
- AddStatusPhase("Running");
-
- Poll(phaseReceipt3.getAttachamments(), "Long Refine");
-
- AddStatusPhase("Completed");
-
- getOutPutTask();
-
- setLongRefineFitting();
-
- setCloseProjectReceipt();
-
- ReadLongRefineFitting();
- System.out.println("\nHere I finish the sequence of Fast Refine & Long Refine\n");
-
-
- } else if (projectType.equals("2") && phaseOption.booleanValue()==false){ /*This Long Refine*/
-
- System.out.println("Here I uncompress the "+this.zipFileName + " with " + UnCompressComplexCalc());
-
- System.out.println("Start the Spliter right here Long Refine");
-
- SendPackageESG();
-
- System.out.println("\nHere I finish the splitter");
- System.out.println("\nHere I start uncompress the TarBallFromWS.zip");
- System.out.println("\nReturn from uncompressTarBallfromWS: "+ UnCompressTarBallFromWS());
- System.out.println("\nReturn from UncompressExecutionPackage: " + UnCompressExecutionPackage());
-
- /* Start the Phase Receipt */
- setPhaseReceipt();
-
- setDispSetting();
-
- /*It call the method below to fill up all the path package into the phase receipt of Long Refine*/
- this.AddPckPathLongRefine();
-
- AddStatusPhase("Running");
-
- Poll(phaseReceipt3.getAttachamments(), "Long Refine");
-
- AddStatusPhase("Completed");
-
- getOutPutTask();
-
- setLongRefineFitting();
-
- setCloseProjectReceipt();
-
- ReadLongRefineFitting();
-
- System.out.println("\nHere I finish the sequence of Long Refine\n");
-
- } else if (projectType.equals("3")){ /* This Cij */
-
-
- if (phaseOption.booleanValue()==true){ /* Starting the Fast Refine*/
-
- projectType = "2";
- System.out.println("Here I uncompress the "+this.zipFileName + " with " + UnCompressComplexCalc());
-
- System.out.println("Start the Spliiter right here for Fast Refine");
-
- SendPackageESG();
-
- System.out.println("\nHere I finish the splitter");
- System.out.println("\nHere I start uncompress the TarBallFromWS.zip");
- System.out.println("\nReturn from uncompressTarBallfromWS: "+ UnCompressTarBallFromWS());
- System.out.println("\nReturn from UncompressExecutionPackage: "+UnCompressExecutionPackage());
-
- /* Start the Phase Receipt */
- setPhaseReceipt();
-
- setDispSetting();
- //setClosePhaseReceipt();
- //setCloseProjectReceipt();
-
- /*It call the method below to fill up all the path package into the phase receipt of Fast Refine*/
- System.out.println("Phase Fast Refine");
- this.AddPckPathFastRefine();
-
- AddStatusPhase("Running");
-
- Poll(phaseReceipt2.getAttachamments(), "Fast Refine");
-
- AddStatusPhase("Completed");
-
- getOutPutTask();
-
- setFastRefineFitting();
-
- ReadFastRefineFitting();
- /*Here I finish the Fast Refine*/
-
- /*Here I start the Long Refine*/
- CreatePackage();
- System.out.println("Terminei de criar o arquivo aqui and my ListPhase size is: "+ListPhaseReceipt.size() +" and ListTaskSize is: "+ListTaskReceipt.size());
-
- /*Here I just change the phase option to run the EOS Refinement aka Long Refine*/
- setPhaseOption(new Boolean(false));
- setPhaseReceipt();
-
- setTheNewPackage();
-
- SendPackageESG();
-
- System.out.println("\nHere I finish the splitter");
- System.out.println("\nHere I start uncompress the TarBallFromWS.zip");
- System.out.println("\nReturn from uncompressTarBallfromWS: "+ UnCompressTarBallFromWS());
- System.out.println("\nReturn from UncompressExecutionPackage: "+UnCompressExecutionPackage());
-
- /* Start the Phase Receipt */
- setDispSetting();
-
- /*It call the method below to fill up all the path package into the phase receipt of Long Refine*/
- System.out.println("Phase Long Refine");
- this.AddPckPathLongRefine();
-
- AddStatusPhase("Running");
-
-
- System.out.println("Terminei de criar o arquivo aqui and my ListPhase size is: "+this.ListPhaseReceipt.size() +" and ListTaskSize is: "+this.ListTaskReceipt.size());
-
- Poll(phaseReceipt3.getAttachamments(), "Long Refine");
-
-
- System.out.println("Terminei de criar o arquivo aqui and my ListPhase size is: "+this.ListPhaseReceipt.size() +" and ListTaskSize is: "+this.ListTaskReceipt.size());
-
-
- AddStatusPhase("Completed");
-
- getOutPutTask();
-
- setLongRefineFitting();
-
- setCloseProjectReceipt();
-
- ReadLongRefineFitting();
-
- projectType = "3";
- }else{ /* Option for Long Refine */
- projectType = "2";
- System.out.println("Here I uncompress the " + this.zipFileName + " with " + UnCompressComplexCalc());
-
- System.out.println("Start the Spliter right here Long Refine");
-
- SendPackageESG();
-
- System.out.println("\nHere I finish the splitter");
- System.out.println("\nHere I start uncompress the TarBallFromWS.zip");
- System.out.println("\nReturn from uncompressTarBallfromWS: "+ UnCompressTarBallFromWS());
- System.out.println("\nReturn from UncompressExecutionPackage: " + UnCompressExecutionPackage());
-
- /* Start the Phase Receipt */
- setPhaseReceipt();
-
- setDispSetting();
-
- /*It call the method below to fill up all the path package into the phase receipt of Long Refine*/
- this.AddPckPathLongRefine();
-
- AddStatusPhase("Running");
-
-
- System.out.println("Terminei de criar o arquivo aqui and my ListPhase size is: "+this.ListPhaseReceipt.size() +" and ListTaskSize is: "+this.ListTaskReceipt.size());
-
-
- Poll(phaseReceipt3.getAttachamments(), "Long Refine");
-
-
- System.out.println("Terminei de criar o arquivo aqui and my ListPhase size is: "+this.ListPhaseReceipt.size() +" and ListTaskSize is: "+this.ListTaskReceipt.size());
-
-
- AddStatusPhase("Completed");
-
- getOutPutTask();
-
- setLongRefineFitting();
-
- setCloseProjectReceipt();
-
- ReadLongRefineFitting();
- projectType = "3";
- setPhaseOption(new Boolean(false));
- }
-
- RunIntermediate34();
-
- setPhaseReceipt();
-
- setDispSettingCij();
-
- /*It call the method below to fill up all the path package into the phase receipt of Cij*/
- this.AddPckPathCijPhase();
-
- AddStatusPhase("Running");
-
-
- System.out.println("Terminei de criar o arquivo aqui and my ListPhase size is: "+this.ListPhaseReceipt.size() +" and ListTaskSize is: "+this.ListTaskReceipt.size());
-
- Poll(phaseReceipt4.getAttachamments(), "Cij");
-
- System.out.println("Terminei de criar o arquivo aqui and my ListPhase size is: "+this.ListPhaseReceipt.size() +" and ListTaskSize is: "+this.ListTaskReceipt.size());
-
- AddStatusPhase("Completed");
-
- getOutPutTaskCij();
-
- // These methods will be called from Project Manager
- //CijGentab();
- //ReadCijGentab();
- //insertCijtoDB();
- System.out.println("\nHere I finish the sequence of Cij\n");
-
- }
-
- else if (projectType.equals("4")){
- //HiPT Thermo
- //Fast Refine
- //Long Refine
+ ////////////////////////
+ /* Single Calculation */
+ if (projectType.equals("1")){
- //Hi Temperature
- System.out.println("\nHere I start the HiPT Thermo");
+ execute.executeSingleCalc(projectType, phaseOption);
- if (phaseOption.booleanValue()==true){ /* Starting the Fast Refine*/
-
- projectType = "2";
- System.out.println("Here I uncompress the "+this.zipFileName + " with " + UnCompressComplexCalc());
- System.out.println("Start the Spliiter right here for Fast Refine");
- SendPackageESG();
- System.out.println("\nHere I finish the splitter");
- System.out.println("\nHere I start uncompress the TarBallFromWS.zip");
- System.out.println("\nReturn from uncompressTarBallfromWS: "+ UnCompressTarBallFromWS());
- System.out.println("\nReturn from UncompressExecutionPackage: "+UnCompressExecutionPackage());
- /* Start the Phase Receipt */
- setPhaseReceipt();
- setDispSetting();
- /*It call the method below to fill up all the path package into the phase receipt of Fast Refine*/
- System.out.println("Phase Fast Refine");
- this.AddPckPathFastRefine();
- AddStatusPhase("Running");
-
-
-
- System.out.println("Terminei de criar o arquivo aqui and my ListPhase size is: "+this.ListPhaseReceipt.size() +" and ListTaskSize is: "+this.ListTaskReceipt.size());
-
- Poll(phaseReceipt2.getAttachamments(), "Fast Refine");
-
-
- System.out.println("Terminei de criar o arquivo aqui and my ListPhase size is: "+this.ListPhaseReceipt.size() +" and ListTaskSize is: "+this.ListTaskReceipt.size());
-
-
- AddStatusPhase("Completed");
- getOutPutTask();
- setFastRefineFitting();
- ReadFastRefineFitting();
- setCloseProjectReceipt();
- /*Here I finish the Fast Refine*/
- }
-
- /*Now Starting the Long Refine*/
- projectType = "2";
- CreatePackage();
- //System.out.println("Terminei de criar o arquivo aqui and my ListPhase size is: "+this.ListPhaseReceipt.size() +" and ListTaskSize is: "+this.ListTaskReceipt.size());
- /*Here I just change the phase option to run the EOS Refinement aka Long Refine*/
- setPhaseOption(new Boolean(false));
- setPhaseReceipt();
- //List OldPhaseList = this.ListPhaseReceipt;
- setTheNewPackage();
- SendPackageESG();
- System.out.println("\nHere I finish the splitter");
- System.out.println("\nHere I start uncompress the TarBallFromWS.zip");
- System.out.println("\nReturn from uncompressTarBallfromWS: "+ UnCompressTarBallFromWS());
- System.out.println("\nReturn from UncompressExecutionPackage: "+UnCompressExecutionPackage());
- /* Start the Phase Receipt */
- //setPhaseReceipt();
- setDispSetting();
- /*It call the method below to fill up all the path package into the phase receipt of Long Refine*/
- this.AddPckPathLongRefine();
- AddStatusPhase("Running");
-
-
- System.out.println("Terminei de criar o arquivo aqui and my ListPhase size is: "+this.ListPhaseReceipt.size() +" and ListTaskSize is: "+this.ListTaskReceipt.size());
-
- Poll(phaseReceipt3.getAttachamments(), "Long Refine");
-
-
- System.out.println("Terminei de criar o arquivo aqui and my ListPhase size is: "+this.ListPhaseReceipt.size() +" and ListTaskSize is: "+this.ListTaskReceipt.size());
-
- AddStatusPhase("Completed");
- getOutPutTask();
- setLongRefineFitting();
- setCloseProjectReceipt();
- ReadLongRefineFitting();
- System.out.println("\nHere I finish the sequence of Fast Refine XOR Long Refine\n");
- /*Here I finished the sequence of Fast Refine and Long Refine*/
-
- projectType = "4";
-
- createQPointFile();
-
- ScriptCreatePhononPackages();
- setPhaseReceipt();
-
- setDispSettingHighTPThermo();
-
- /*It call the method below to fill up all the path package into the phase receipt of Cij*/
- this.AddPckPathHighTPThermoPhase();
-
- AddStatusPhase("Running");
-
-
- System.out.println("Terminei de criar o arquivo aqui and my ListPhase size is: "+this.ListPhaseReceipt.size() +" and ListTaskSize is: "+this.ListTaskReceipt.size());
-
-
- Poll(phaseReceipt5.getAttachamments(), "HighTP Thermo");
-
-
- System.out.println("Terminei de criar o arquivo aqui and my ListPhase size is: "+this.ListPhaseReceipt.size() +" and ListTaskSize is: "+this.ListTaskReceipt.size());
-
-
- AddStatusPhase("Completed");
- getOutPutTaskHighTempThermo();
-
- System.out.println("\nHere I finish the sequence of High PT Thermo\n");
-
- } else if (projectType.equals("5")){
- //HiPT Thermo
- //Fast Refine
- //Long Refine
- //Hi Temperature
- //Cij
}
- } catch(Exception ae){
- System.err.println("[ProjectExecutor::run()] Error inside IF encapsulates: "+ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
-
-
- try{
- setCloseProjectReceipt();
- } catch(Exception ae){
- System.err.println("[ProjectExecutor::run()] Error Closing the project Receipt: "+ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
-
- }
-
- //I had here the StartDispatcher()
-
- public void AddPckPathFastRefine(){
-
- /*This method is used to add all the packages path in Phase Receipt into the content field.*/
- System.out.println("Here I start the AddPckPathFastRefine()");
- try{
- List ListContent = new Vector();
- String[] ListPackagesFR = this.ListPackages();
- Bdata[] ContentFRPhase = new Bdata[ListPackagesFR.length];
- System.out.println("My list will be: ");
- for(int i=0; i<ListPackagesFR.length;i++){
- ContentFRPhase[i] = new Bdata();
- ContentFRPhase[i].setId("013");
- ContentFRPhase[i].setCode(ListPackagesFR[i].substring(0, ListPackagesFR[i].length()-4));
- ContentFRPhase[i].setKeyword("PCKGPATHONPE");
- ContentFRPhase[i].setSvalue(ENV_PACKAGE_DIR+this.dirEPName+ListPackagesFR[i].substring(0, ListPackagesFR[i].length()-4));
- System.out.println(ENV_PACKAGE_DIR+this.dirEPName+ListPackagesFR[i]+"\n");
- ListContent.add(ContentFRPhase[i]);
- }
- phaseReceipt2.setContent(ListContent);
- } catch(Exception ae){
- System.err.println("[ProjectExecutor::AddPckPathFastRefine()] Error adding the Fast Refine Packages at Phase Receipt: "+ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
- }
-
- public void AddPckPathLongRefine(){
-
- /*This method is used to add all the packages path in Phase Receipt into the content field.*/
- System.out.println("Here I start the AddPckPathLongRefine()");
-
- try{
- List ListContent = new Vector();
- String[] ListPackagesLR = this.ListPackages();
- Bdata[] ContentLRPhase = new Bdata[ListPackagesLR.length];
- for(int i=0; i<ListPackagesLR.length;i++){
- ContentLRPhase[i] = new Bdata();
- ContentLRPhase[i].setId("013");
- ContentLRPhase[i].setCode(ListPackagesLR[i].substring(0, ListPackagesLR[i].length()-4));
- ContentLRPhase[i].setKeyword("PCKGPATHONPE");
- ContentLRPhase[i].setSvalue(ENV_PACKAGE_DIR+this.dirEPName+ListPackagesLR[i].substring(0, ListPackagesLR[i].length()-4));
- ListContent.add(ContentLRPhase[i]);
- }
- phaseReceipt3.setContent(ListContent);
- } catch(Exception ae){
- System.err.println("[ProjectExecutor::AddPckPathLongRefine()] Error addind the Long Refine packages at Phase Receipt: "+ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
- }
-
- public void AddPckPathSingleCalc(){
-
- /*This method is used to add all the packages path in Phase Receipt into the content field.*/
- System.out.println("Here I start the AddPckPathSingleCalc()");
- try{
- Bdata ContentFRPhase = null;
- List ListContent = new Vector();
- String[] ListPackageSingle = this.ListPackages();
- for(int i=0; i<ListPackageSingle.length;i++){
- ContentFRPhase = new Bdata();
- ContentFRPhase.setId("013");
- ContentFRPhase.setCode(ListPackageSingle[i].substring(0, ListPackageSingle[i].length()-4));
- ContentFRPhase.setKeyword("PCKGPATHONPE");
- ContentFRPhase.setSvalue(ENV_PACKAGE_DIR+this.dirEPName+ListPackageSingle[i].substring(0, ListPackageSingle[i].length()-4));
- ListContent.add(ContentFRPhase);
- }
- phaseReceipt1.setContent(ListContent);
- } catch (Exception ae){
- System.err.println("[ProjectExecutor::AddPckPathSingleCalc()] Error addind the Single Package inside Phase Receipt: "+ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
- }
-
- private void AddPckPathCijPhase(){
-
- /*This method is used to add all the packages path in Phase Receipt into the content field.*/
- System.out.println("Here I start the AddPckPathCijPhase()");
- try{
- Bdata ContentCijPhase = null;
- List ListContent = new Vector();
- String[] ListLRPackages = ListPackages();
- String[] ListPackagesCij = null;
- String ActuallyCCPackage = null;
- for(int i=0; i<ListLRPackages.length; i++){
+ ///////////////////////////////
+ /* Fast Refine - Long Refine*/
+ if (projectType.equals("2") && phaseOption.booleanValue()==true){
+
+ projectReceipt = execute.executeFastRefine(projectType, phaseOption);
- ActuallyCCPackage = ListLRPackages[i];
- System.out.println("[ProjectExecutor::AddPckPathCijPhase()] => Actually package is: " + ActuallyCCPackage);
-
- ListPackagesCij = ListEEPackages(ActuallyCCPackage, false);
-
- for(int j=0; j < ListPackagesCij.length; j++ ){
- ContentCijPhase = new Bdata();
- ContentCijPhase.setId("013");
- ContentCijPhase.setCode(ListPackagesCij[j].substring(0,ListPackagesCij[j].length()-4));
- ContentCijPhase.setKeyword("PCKGPATHONPE");
- ContentCijPhase.setSvalue(ENV_PACKAGE_DIR+this.dirEPName+ActuallyCCPackage.substring(0, ActuallyCCPackage.length()-4)+"/"+ListPackagesCij[j].substring(0,ListPackagesCij[j].length()-4));
-
- System.out.println("Package: => "+ListPackagesCij[j]);
- System.out.println("Package substring: => " + ListPackagesCij[j].substring(0,ListPackagesCij[j].length()-4));
- System.out.println("Full package for the package: "+ENV_PACKAGE_DIR+this.dirEPName+ActuallyCCPackage.substring(0, ActuallyCCPackage.length()-4)+"/"+ListPackagesCij[j].substring(0,ListPackagesCij[j].length()-4));
- ListContent.add(ContentCijPhase);
- }
- this.phaseReceipt4.setContent(ListContent);
- //for(int j=0; j < ++){
- //0}
+ projectReceipt = execute.executeLongRefine(projectReceipt, projectType, false);
}
- } catch (Exception ae){
- System.err.println("[ProjectExecutor::AddPckPathCijPhase()] Error adding the Cij Package inside the Phase Receipt: "+ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
- }
-
- private void AddPckPathHighTPThermoPhase(){
-
- /*This method is used to add all the packages path in Phase Receipt into the content field.*/
- System.out.println("Here I start the AddPckPathHighTPThermoPhase()");
-
- try{
- Bdata ContentCijPhase = null;
- List ListContent = new Vector();
- String[] ListLRPackages = ListPackages();
- String[] ListPackagesPH = null;
- String ActuallyCCPackage = null;
- for(int i=0; i<ListLRPackages.length; i++){
+ /////////////////
+ /* Long Refine */
+ if (projectType.equals("2") && phaseOption.booleanValue()==false){
- ActuallyCCPackage = ListLRPackages[i];
- System.out.println("[ProjectExecutor::AddPckPathHighTPThermoPhase()] => Actually package is: " + ActuallyCCPackage);
-
- ListPackagesPH = ListPHPackages(ActuallyCCPackage, false);
-
- for(int j=0; j < ListPackagesPH.length; j++ ){
- ContentCijPhase = new Bdata();
- ContentCijPhase.setId("013");
- ContentCijPhase.setCode(ListPackagesPH[j].substring(0,ListPackagesPH[j].length()-4));
- ContentCijPhase.setKeyword("PCKGPATHONPE");
- ContentCijPhase.setSvalue(ENV_PACKAGE_DIR+this.dirEPName+ActuallyCCPackage.substring(0, ActuallyCCPackage.length()-4)+"/"+ListPackagesPH[j].substring(0,ListPackagesPH[j].length()-4));
-
- System.out.println("Package: => "+ListPackagesPH[j]);
- System.out.println("Package substring: => " + ListPackagesPH[j].substring(0,ListPackagesPH[j].length()-4));
- System.out.println("Full package for the package: "+ENV_PACKAGE_DIR+this.dirEPName+ActuallyCCPackage.substring(0, ActuallyCCPackage.length()-4)+"/"+ListPackagesPH[j].substring(0,ListPackagesPH[j].length()-4));
- ListContent.add(ContentCijPhase);
- }
- this.phaseReceipt5.setContent(ListContent);
+ projectReceipt = ReceiptManagement.setProjectReceipt();
+
+ projectReceipt = execute.executeLongRefine(projectReceipt, projectType, false);
}
- } catch (Exception ae){
- System.err.println("[ProjectExecutor::AddPckPathHighTPThermoPhase()] Error adding the HiPt Thermo packages inside Phase Receipt: "+ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
- }
-
- private void AddStatusPhase(String StatusPhase){
-
- System.out.println("Here I am starting the AddStatusPhase\n\n");
-
- /*This method will insert the status for every different phase in the project*/
- Bdata BdataContent = null;
- List ListContent = null;
-
- try{
- BdataContent = new Bdata();
-
- /*if (projectType.equals("1")){
- ListContent = this.phaseReceipt1.getContent();
- BdataContent.setId("014");
- BdataContent.setCode("StatusPhase");
- BdataContent.setKeyword("STATUSPHASE");
- BdataContent.setSvalue(StatusPhase);
- ListContent.add(BdataContent);
- this.phaseReceipt1.setContent(ListContent);
- }*/
- //Fast Refine
- if (projectType.equals("2") && phaseOption.booleanValue()==true){
- ListContent = this.phaseReceipt2.getContent();
- BdataContent.setId("014");
- BdataContent.setCode("StatusPhase");
- BdataContent.setKeyword("STATUSPHASE");
- BdataContent.setSvalue(StatusPhase);
- ListContent.add(BdataContent);
- this.phaseReceipt2.setContent(ListContent);
- }
- //Long Refine
- if (projectType.equals("2") && phaseOption.booleanValue()==false){
- ListContent = this.phaseReceipt3.getContent();
- BdataContent.setId("014");
- BdataContent.setCode("StatusPhase");
- BdataContent.setKeyword("STATUSPHASE");
- BdataContent.setSvalue(StatusPhase);
- ListContent.add(BdataContent);
- this.phaseReceipt3.setContent(ListContent);
- }
- //Cij Calculation
- if (phaseOption.booleanValue()==true && projectType.equals("3")){
- ListContent = this.phaseReceipt4.getContent();
- BdataContent.setId("014");
- BdataContent.setCode("StatusPhase");
- BdataContent.setKeyword("STATUSPHASE");
- BdataContent.setSvalue(StatusPhase);
- ListContent.add(BdataContent);
- this.phaseReceipt4.setContent(ListContent);
- }
- //High TP Thermo
- if (phaseOption.booleanValue()==true && projectType.equals("4")){
- ListContent = this.phaseReceipt5.getContent();
- BdataContent.setId("014");
- BdataContent.setCode("StatusPhase");
- BdataContent.setKeyword("STATUSPHASE");
- BdataContent.setSvalue(StatusPhase);
- ListContent.add(BdataContent);
- this.phaseReceipt5.setContent(ListContent);
- }
- } catch (Exception ae){
- System.err.println("[ProjectExecutor::AddStatusPhase] Error defining new status to the phase: "+ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
- }
-
- public static final int TotalJobs=0;
-
-
- public void setDispSetting(){
+ /////////////////////////////////////
+ /* Fast Refine - Long Refine - Cij */
+ if (projectType.equals("3") && phaseOption.booleanValue()==true){
- System.out.println("\n Here I just start the ProjectExecutor::setDispSetting \n");
-
- //List of Package of __CC5f_1
- String[] ListOfPackages = null;
- String ActuallyPackage = null;
- DispatchTask[] dispatch = null;
-
- try{
- ListOfPackages = ListPackages();
- } catch (Exception ae){
- System.err.println("[ProjectExecutor::setDispSetting()] Error getting the list of packages: "+ae.getMessage());
- ae.printStackTrace();
- System.exit(-1);
- }
-
- //TotalJobs
-
- try{
- dispatch = new DispatchTask[ListOfPackages.length];
-
- for(int i=0;i<ListOfPackages.length;i++){
-
- //try{
- ActuallyPackage = ListOfPackages[i];
- ...
[truncated message content] |