|
From: <ha...@us...> - 2006-08-30 01:33:24
|
Revision: 662 Author: hategan Date: 2006-08-29 18:33:14 -0700 (Tue, 29 Aug 2006) ViewCVS: http://svn.sourceforge.net/cogkit/?rev=662&view=rev Log Message: ----------- moved examples Added Paths: ----------- trunk/current/src/cog/modules/examples/ trunk/current/src/cog/modules/examples/src/org/globus/cog/abstraction/examples/taskgraph/HierarchicalDAG.java trunk/current/src/cog/modules/examples/src/org/globus/cog/abstraction/examples/taskgraph/RemoteCompileExecute.java Removed Paths: ------------- trunk/current/src/cog/modules/examples/src/org/globus/cog/abstraction/examples/etc/ trunk/current/src/cog/modules/examples/src/org/globus/cog/abstraction/examples/execution/ trunk/current/src/cog/modules/examples/src/org/globus/cog/abstraction/examples/file/ trunk/current/src/cog/modules/examples/src/org/globus/cog/abstraction/examples/invocation/ trunk/current/src/cog/modules/examples/src/org/globus/cog/abstraction/examples/queue/ trunk/current/src/cog/modules/examples/src/org/globus/cog/abstraction/examples/set/ trunk/current/src/cog/modules/examples/src/org/globus/cog/abstraction/examples/taskgraph/HierarchicalDAG.java trunk/current/src/cog/modules/examples/src/org/globus/cog/abstraction/examples/taskgraph/RemoteCompileExecute.java trunk/current/src/cog/modules/examples/src/org/globus/cog/abstraction/examples/transfer/ trunk/current/src/cog/modules/examples/src/org/globus/cog/abstraction/examples/xml/ Copied: trunk/current/src/cog/modules/examples (from rev 656, trunk/current/src/cog/modules/abstraction-examples) Deleted: trunk/current/src/cog/modules/examples/src/org/globus/cog/abstraction/examples/taskgraph/HierarchicalDAG.java =================================================================== --- trunk/current/src/cog/modules/abstraction-examples/src/org/globus/cog/abstraction/examples/taskgraph/HierarchicalDAG.java 2006-08-28 22:19:16 UTC (rev 656) +++ trunk/current/src/cog/modules/examples/src/org/globus/cog/abstraction/examples/taskgraph/HierarchicalDAG.java 2006-08-30 01:33:14 UTC (rev 662) @@ -1,182 +0,0 @@ -// ---------------------------------------------------------------------- -// This code is developed as part of the Java CoG Kit project -// The terms of the license can be found at http://www.cogkit.org/license -// This message may not be removed or altered. -// ---------------------------------------------------------------------- - -package org.globus.cog.abstraction.examples.taskgraph; - -import org.apache.log4j.Logger; -import org.globus.cog.abstraction.examples.transfer.FileTransfer; -import org.globus.cog.abstraction.impl.common.StatusEvent; -import org.globus.cog.abstraction.impl.common.task.IllegalSpecException; -import org.globus.cog.abstraction.impl.common.task.InvalidSecurityContextException; -import org.globus.cog.abstraction.impl.common.task.InvalidServiceContactException; -import org.globus.cog.abstraction.impl.common.task.TaskSubmissionException; -import org.globus.cog.abstraction.impl.common.taskgraph.TaskGraphHandlerImpl; -import org.globus.cog.abstraction.impl.common.taskgraph.TaskGraphImpl; -import org.globus.cog.abstraction.interfaces.ExecutableObject; -import org.globus.cog.abstraction.interfaces.Status; -import org.globus.cog.abstraction.interfaces.StatusListener; -import org.globus.cog.abstraction.interfaces.Task; -import org.globus.cog.abstraction.interfaces.TaskGraph; -import org.globus.cog.abstraction.interfaces.TaskGraphHandler; - -/* - * This class serves as an example to demonstrate the execution of hierarchical - * taskgraphs (DAGs). It simply shows the semantics of how a user can create a - * hierarchy of task graph and submit additional tasks to an already executing - * task graph (a.k.a adding tasks to a "live taskgraph"). The parameters to the - * task specification MUST be changed to suite your requirements and - * environment. - */ -public class HierarchicalDAG implements StatusListener { - static Logger logger = Logger.getLogger(HierarchicalDAG.class.getName()); - protected org.globus.cog.abstraction.interfaces.TaskGraph taskGraph; - protected boolean active = false; - private boolean submitted = false; - private Task task6 = null; - private Task task9 = null; - private TaskGraph tg5 = null; - - public void createDAG() throws Exception { - TaskGraph tg1 = new TaskGraphImpl(); - try { - tg1.setName("TG1"); - Task task1 = prepareTask("Task1", - "gridftp://hot.mcs.anl.gov:2811//home/cog/gridfile1", - "gridftp://cold.mcs.anl.gov:2811//home/cog/gridfile1"); - Task task2 = prepareTask("Task2", - "gridftp://cold.mcs.anl.gov:2811//home/cog/gridfile2", - "gridftp://hot.mcs.anl.gov:2811//home/cog/gridfile2"); - tg1.add(task1); - tg1.add(task2); - tg1.addDependency(task1, task2); - - TaskGraph tg2 = new TaskGraphImpl(); - tg2.setName("TG2"); - Task task3 = prepareTask("Task3", - "gridftp://hot.mcs.anl.gov:2811//home/cog/gridfile3", - "gridftp://cold.mcs.anl.gov:2811//home/cog/gridfile3"); - Task task4 = prepareTask("Task4", - "gridftp://cold.mcs.anl.gov:2811//home/cog/gridfile4", - "gridftp://hot.mcs.anl.gov:2811//home/cog/gridfile4"); - tg2.add(task3); - tg2.add(task4); - tg2.addDependency(task3, task4); - - TaskGraph tg3 = new TaskGraphImpl(); - tg3.setName("TG3"); - tg3.add(tg1); - tg3.add(tg2); - tg3.addDependency(tg1, tg2); - - TaskGraph tg4 = new TaskGraphImpl(); - tg4.setName("TG4"); - Task task5 = prepareTask("Task5", - "gridftp://new.mcs.anl.gov:2811//home/cog/gridfile6", - "gridftp://old.mcs.anl.gov:2811//home/cog/gridfile7"); - tg4.add(tg3); - tg4.add(task5); - tg4.addDependency(tg3, task5); - - tg5 = new TaskGraphImpl(); - - Task task7 = prepareTask("Task7", - "gridftp://old.mcs.anl.gov:2811//home/cog/gridfile8", - "gridftp://new.mcs.anl.gov:2811//home/cog/gridfile9"); - Task task8 = prepareTask("Task8", - "gridftp://here.mcs.anl.gov:2811//home/cog/gridfile10", - "gridftp://there.mcs.anl.gov:2811//home/cog/gridfile10"); - task9 = prepareTask("Task9", - "gridftp://here.mcs.anl.gov:2811//home/cog/gridfile11", - "gridftp://there.mcs.anl.gov:2811//home/cog/gridfile11"); - - tg5.add(task7); - tg5.add(task8); - tg5.add(task9); - tg5.add(tg4); - - tg5.addDependency(task7, task8); - tg5.addDependency(task8, task9); - tg5.addDependency(task8, tg4); - tg5.addDependency(task9, tg4); - - this.taskGraph = tg5; - this.taskGraph.setName("Main Graph"); - this.taskGraph.addStatusListener(this); - } catch (Exception e) { - logger.error("Unable to create DAG", e); - } - } - - public void submitDAG() { - TaskGraphHandler handler = new TaskGraphHandlerImpl(); - try { - handler.submit(this.taskGraph); - logger.debug("TaskGraph submitted"); - } catch (InvalidSecurityContextException ise) { - logger.error("Security Exception"); - ise.printStackTrace(); - System.exit(1); - } catch (TaskSubmissionException tse) { - logger.error("TaskSubmission Exception"); - tse.printStackTrace(); - System.exit(1); - } catch (IllegalSpecException ispe) { - logger.error("Specification Exception"); - ispe.printStackTrace(); - System.exit(1); - } catch (InvalidServiceContactException isce) { - logger.error("Service Contact Exception"); - isce.printStackTrace(); - System.exit(1); - } - } - - private Task prepareTask(String name, String source, String destination) - throws Exception { - FileTransfer fileTransfer = new FileTransfer(name, source, destination); - fileTransfer.prepareTask(); - Task task = fileTransfer.getFileTransferTask(); - task.removeStatusListener(fileTransfer); - return task; - } - - public void statusChanged(StatusEvent event) { - ExecutableObject eo = event.getSource(); - logger.debug(eo.getName()); - Status status = event.getStatus(); - logger.debug("Status changed to: " + status.getStatusString()); - - // demonstrating "live" task graphs - if (status.getStatusCode() == Status.SUBMITTED && !submitted) { - submitted = true; - try { - task6 = prepareTask("Task6", - "gridftp://this.mcs.anl.gov:2811//home/cog/gridfile12", - "gridftp://that.mcs.anl.gov:2811//home/cog/gridfile12"); - tg5.addDependency(task6, task9); - tg5.add(task6); - } catch (Exception e) { - e.printStackTrace(); - } - } - - if (status.getStatusCode() == Status.COMPLETED - || status.getStatusCode() == Status.FAILED) { - logger.info("Task Graph Done"); - // System.exit(1); - } - } - - public static void main(String arg[]) { - try { - HierarchicalDAG dag = new HierarchicalDAG(); - dag.createDAG(); - dag.submitDAG(); - } catch (Exception e) { - logger.error("Exception caught: ", e); - } - } -} \ No newline at end of file Copied: trunk/current/src/cog/modules/examples/src/org/globus/cog/abstraction/examples/taskgraph/HierarchicalDAG.java (from rev 658, trunk/current/src/cog/modules/abstraction-examples/src/org/globus/cog/abstraction/examples/taskgraph/HierarchicalDAG.java) =================================================================== --- trunk/current/src/cog/modules/examples/src/org/globus/cog/abstraction/examples/taskgraph/HierarchicalDAG.java (rev 0) +++ trunk/current/src/cog/modules/examples/src/org/globus/cog/abstraction/examples/taskgraph/HierarchicalDAG.java 2006-08-30 01:33:14 UTC (rev 662) @@ -0,0 +1,182 @@ +// ---------------------------------------------------------------------- +// This code is developed as part of the Java CoG Kit project +// The terms of the license can be found at http://www.cogkit.org/license +// This message may not be removed or altered. +// ---------------------------------------------------------------------- + +package org.globus.cog.abstraction.examples.taskgraph; + +import org.apache.log4j.Logger; +import org.globus.cog.abstraction.impl.common.StatusEvent; +import org.globus.cog.abstraction.impl.common.task.IllegalSpecException; +import org.globus.cog.abstraction.impl.common.task.InvalidSecurityContextException; +import org.globus.cog.abstraction.impl.common.task.InvalidServiceContactException; +import org.globus.cog.abstraction.impl.common.task.TaskSubmissionException; +import org.globus.cog.abstraction.impl.common.taskgraph.TaskGraphHandlerImpl; +import org.globus.cog.abstraction.impl.common.taskgraph.TaskGraphImpl; +import org.globus.cog.abstraction.interfaces.ExecutableObject; +import org.globus.cog.abstraction.interfaces.Status; +import org.globus.cog.abstraction.interfaces.StatusListener; +import org.globus.cog.abstraction.interfaces.Task; +import org.globus.cog.abstraction.interfaces.TaskGraph; +import org.globus.cog.abstraction.interfaces.TaskGraphHandler; +import org.globus.cog.abstraction.tools.transfer.FileTransfer; + +/* + * This class serves as an example to demonstrate the execution of hierarchical + * taskgraphs (DAGs). It simply shows the semantics of how a user can create a + * hierarchy of task graph and submit additional tasks to an already executing + * task graph (a.k.a adding tasks to a "live taskgraph"). The parameters to the + * task specification MUST be changed to suite your requirements and + * environment. + */ +public class HierarchicalDAG implements StatusListener { + static Logger logger = Logger.getLogger(HierarchicalDAG.class.getName()); + protected org.globus.cog.abstraction.interfaces.TaskGraph taskGraph; + protected boolean active = false; + private boolean submitted = false; + private Task task6 = null; + private Task task9 = null; + private TaskGraph tg5 = null; + + public void createDAG() throws Exception { + TaskGraph tg1 = new TaskGraphImpl(); + try { + tg1.setName("TG1"); + Task task1 = prepareTask("Task1", + "gridftp://hot.mcs.anl.gov:2811//home/cog/gridfile1", + "gridftp://cold.mcs.anl.gov:2811//home/cog/gridfile1"); + Task task2 = prepareTask("Task2", + "gridftp://cold.mcs.anl.gov:2811//home/cog/gridfile2", + "gridftp://hot.mcs.anl.gov:2811//home/cog/gridfile2"); + tg1.add(task1); + tg1.add(task2); + tg1.addDependency(task1, task2); + + TaskGraph tg2 = new TaskGraphImpl(); + tg2.setName("TG2"); + Task task3 = prepareTask("Task3", + "gridftp://hot.mcs.anl.gov:2811//home/cog/gridfile3", + "gridftp://cold.mcs.anl.gov:2811//home/cog/gridfile3"); + Task task4 = prepareTask("Task4", + "gridftp://cold.mcs.anl.gov:2811//home/cog/gridfile4", + "gridftp://hot.mcs.anl.gov:2811//home/cog/gridfile4"); + tg2.add(task3); + tg2.add(task4); + tg2.addDependency(task3, task4); + + TaskGraph tg3 = new TaskGraphImpl(); + tg3.setName("TG3"); + tg3.add(tg1); + tg3.add(tg2); + tg3.addDependency(tg1, tg2); + + TaskGraph tg4 = new TaskGraphImpl(); + tg4.setName("TG4"); + Task task5 = prepareTask("Task5", + "gridftp://new.mcs.anl.gov:2811//home/cog/gridfile6", + "gridftp://old.mcs.anl.gov:2811//home/cog/gridfile7"); + tg4.add(tg3); + tg4.add(task5); + tg4.addDependency(tg3, task5); + + tg5 = new TaskGraphImpl(); + + Task task7 = prepareTask("Task7", + "gridftp://old.mcs.anl.gov:2811//home/cog/gridfile8", + "gridftp://new.mcs.anl.gov:2811//home/cog/gridfile9"); + Task task8 = prepareTask("Task8", + "gridftp://here.mcs.anl.gov:2811//home/cog/gridfile10", + "gridftp://there.mcs.anl.gov:2811//home/cog/gridfile10"); + task9 = prepareTask("Task9", + "gridftp://here.mcs.anl.gov:2811//home/cog/gridfile11", + "gridftp://there.mcs.anl.gov:2811//home/cog/gridfile11"); + + tg5.add(task7); + tg5.add(task8); + tg5.add(task9); + tg5.add(tg4); + + tg5.addDependency(task7, task8); + tg5.addDependency(task8, task9); + tg5.addDependency(task8, tg4); + tg5.addDependency(task9, tg4); + + this.taskGraph = tg5; + this.taskGraph.setName("Main Graph"); + this.taskGraph.addStatusListener(this); + } catch (Exception e) { + logger.error("Unable to create DAG", e); + } + } + + public void submitDAG() { + TaskGraphHandler handler = new TaskGraphHandlerImpl(); + try { + handler.submit(this.taskGraph); + logger.debug("TaskGraph submitted"); + } catch (InvalidSecurityContextException ise) { + logger.error("Security Exception"); + ise.printStackTrace(); + System.exit(1); + } catch (TaskSubmissionException tse) { + logger.error("TaskSubmission Exception"); + tse.printStackTrace(); + System.exit(1); + } catch (IllegalSpecException ispe) { + logger.error("Specification Exception"); + ispe.printStackTrace(); + System.exit(1); + } catch (InvalidServiceContactException isce) { + logger.error("Service Contact Exception"); + isce.printStackTrace(); + System.exit(1); + } + } + + private Task prepareTask(String name, String source, String destination) + throws Exception { + FileTransfer fileTransfer = new FileTransfer(name, source, destination); + fileTransfer.prepareTask(); + Task task = fileTransfer.getFileTransferTask(); + task.removeStatusListener(fileTransfer); + return task; + } + + public void statusChanged(StatusEvent event) { + ExecutableObject eo = event.getSource(); + logger.debug(eo.getName()); + Status status = event.getStatus(); + logger.debug("Status changed to: " + status.getStatusString()); + + // demonstrating "live" task graphs + if (status.getStatusCode() == Status.SUBMITTED && !submitted) { + submitted = true; + try { + task6 = prepareTask("Task6", + "gridftp://this.mcs.anl.gov:2811//home/cog/gridfile12", + "gridftp://that.mcs.anl.gov:2811//home/cog/gridfile12"); + tg5.addDependency(task6, task9); + tg5.add(task6); + } catch (Exception e) { + e.printStackTrace(); + } + } + + if (status.getStatusCode() == Status.COMPLETED + || status.getStatusCode() == Status.FAILED) { + logger.info("Task Graph Done"); + // System.exit(1); + } + } + + public static void main(String arg[]) { + try { + HierarchicalDAG dag = new HierarchicalDAG(); + dag.createDAG(); + dag.submitDAG(); + } catch (Exception e) { + logger.error("Exception caught: ", e); + } + } +} \ No newline at end of file Deleted: trunk/current/src/cog/modules/examples/src/org/globus/cog/abstraction/examples/taskgraph/RemoteCompileExecute.java =================================================================== --- trunk/current/src/cog/modules/abstraction-examples/src/org/globus/cog/abstraction/examples/taskgraph/RemoteCompileExecute.java 2006-08-28 22:19:16 UTC (rev 656) +++ trunk/current/src/cog/modules/examples/src/org/globus/cog/abstraction/examples/taskgraph/RemoteCompileExecute.java 2006-08-30 01:33:14 UTC (rev 662) @@ -1,303 +0,0 @@ -// ---------------------------------------------------------------------- -//This code is developed as part of the Java CoG Kit project -//The terms of the license can be found at http://www.cogkit.org/license -//This message may not be removed or altered. -//---------------------------------------------------------------------- - -package org.globus.cog.abstraction.examples.taskgraph; - -import java.io.File; - -import org.apache.log4j.Logger; -import org.globus.cog.abstraction.examples.transfer.FileTransfer; -import org.globus.cog.abstraction.impl.common.AbstractionFactory; -import org.globus.cog.abstraction.impl.common.AbstractionProperties; -import org.globus.cog.abstraction.impl.common.ProviderMethodException; -import org.globus.cog.abstraction.impl.common.StatusEvent; -import org.globus.cog.abstraction.impl.common.task.ExecutionServiceImpl; -import org.globus.cog.abstraction.impl.common.task.IllegalSpecException; -import org.globus.cog.abstraction.impl.common.task.InvalidProviderException; -import org.globus.cog.abstraction.impl.common.task.InvalidSecurityContextException; -import org.globus.cog.abstraction.impl.common.task.InvalidServiceContactException; -import org.globus.cog.abstraction.impl.common.task.JobSpecificationImpl; -import org.globus.cog.abstraction.impl.common.task.ServiceContactImpl; -import org.globus.cog.abstraction.impl.common.task.TaskImpl; -import org.globus.cog.abstraction.impl.common.task.TaskSubmissionException; -import org.globus.cog.abstraction.impl.common.taskgraph.TaskGraphHandlerImpl; -import org.globus.cog.abstraction.impl.common.taskgraph.TaskGraphImpl; -import org.globus.cog.abstraction.interfaces.ExecutableObject; -import org.globus.cog.abstraction.interfaces.ExecutionService; -import org.globus.cog.abstraction.interfaces.JobSpecification; -import org.globus.cog.abstraction.interfaces.SecurityContext; -import org.globus.cog.abstraction.interfaces.ServiceContact; -import org.globus.cog.abstraction.interfaces.Status; -import org.globus.cog.abstraction.interfaces.StatusListener; -import org.globus.cog.abstraction.interfaces.Task; -import org.globus.cog.abstraction.interfaces.TaskGraph; -import org.globus.cog.abstraction.interfaces.TaskGraphHandler; -import org.globus.cog.util.ArgumentParser; -import org.globus.cog.util.ArgumentParserException; - -/* - * This example demonstrates an execution flow where a local java file needs to - * be compiled and executed remotely. Then it transfers the stdout of the remote - * execution back to the local machine. - */ -public class RemoteCompileExecute implements StatusListener { - static Logger logger = Logger.getLogger(RemoteCompileExecute.class - .getName()); - private String serviceContact = null; - private String executionProvider = null; - private String transferProvider = null; - private String sourceFile = null; - private String normalizedFileName = null; - private String javaHome = null; - private String classpath = null; - private TaskGraph tg = null; - - public static void main(String args[]) { - ArgumentParser ap = new ArgumentParser(); - ap.setExecutableName("cog-compile-execute"); - ap.addOption("src", "Name of the Java source file", "filename", - ArgumentParser.NORMAL); - ap.addAlias("src", "s"); - ap.addOption("javaHome", - "Path of the Java environment on the remote machine", "path", - ArgumentParser.NORMAL); - ap.addAlias("javaHome", "j"); - ap.addOption("classpath", - "Path of the Java classpath on the remote machine", "path", - ArgumentParser.OPTIONAL); - ap.addAlias("classpath", "cp"); - ap.addOption("execution-provider", - "Execution provider; available providers: " - + AbstractionProperties.getProviders().toString(), - "provider", ArgumentParser.NORMAL); - ap.addAlias("execution-provider", "ep"); - ap.addOption("transfer-provider", - "Transfer provider; available providers: " - + AbstractionProperties.getProviders().toString(), - "provider", ArgumentParser.NORMAL); - ap.addAlias("transfer-provider", "tp"); - ap.addOption("service-contact", "Service contact for the remote host", - "host", ArgumentParser.NORMAL); - ap.addAlias("service-contact", "sc"); - ap.addFlag("verbose", - "If enabled, display information about what is being done"); - ap.addAlias("verbose", "v"); - ap.addFlag("help", "Display usage"); - ap.addAlias("help", "h"); - try { - ap.parse(args); - if (ap.isPresent("help")) { - ap.usage(); - } else { - ap.checkMandatory(); - try { - RemoteCompileExecute rce = new RemoteCompileExecute(); - rce.setServiceContact(ap.getStringValue("service-contact")); - rce.setExecutionProvider(ap - .getStringValue("execution-provider")); - rce.setTransferProvider(ap - .getStringValue("transfer-provider")); - rce.setSourceFile(ap.getStringValue("src")); - rce.setJavaHome(ap.getStringValue("javaHome")); - rce.setClasspath(ap.getStringValue("classpath", null)); - rce.prepareTaskGraph(); - rce.submit(); - } catch (Exception e) { - logger.error("Exception in main", e); - } - } - } catch (ArgumentParserException e) { - System.err.println("Error parsing arguments: " + e.getMessage()); - ap.usage(); - } - } - - private void prepareTaskGraph() throws Exception { - this.tg = new TaskGraphImpl(); - tg.setName("Workflow"); - Task transferTask = prepareFileTransferTask(); - Task compileTask = prepareCompileTask(); - Task executeTask = prepareExecutionTask(); - tg.add(transferTask); - tg.add(compileTask); - tg.add(executeTask); - - tg.addDependency(transferTask, compileTask); - tg.addDependency(compileTask, executeTask); - tg.addStatusListener(this); - } - - private void submit() { - TaskGraphHandler handler = new TaskGraphHandlerImpl(); - try { - handler.submit(this.tg); - logger.debug("TaskGraph submitted"); - } catch (InvalidSecurityContextException ise) { - logger.error("Security Exception"); - ise.printStackTrace(); - System.exit(1); - } catch (TaskSubmissionException tse) { - logger.error("TaskSubmission Exception"); - tse.printStackTrace(); - System.exit(1); - } catch (IllegalSpecException ispe) { - logger.error("Specification Exception"); - ispe.printStackTrace(); - System.exit(1); - } catch (InvalidServiceContactException isce) { - logger.error("Service Contact Exception"); - isce.printStackTrace(); - System.exit(1); - } - } - - private Task prepareFileTransferTask() throws Exception { - FileTransfer fileTransfer = new FileTransfer("Transfer_Task", "file://" - + this.sourceFile, this.transferProvider + "://" - + this.serviceContact + "///tmp/" + normalizedFileName - + ".java"); - fileTransfer.prepareTask(); - Task task = fileTransfer.getFileTransferTask(); - task.removeStatusListener(fileTransfer); - task.addStatusListener(this); - return task; - } - - private Task prepareCompileTask() throws InvalidProviderException, - ProviderMethodException { - Task task = new TaskImpl("Compile_Task", Task.JOB_SUBMISSION); - JobSpecification spec = new JobSpecificationImpl(); - - spec.setExecutable(this.javaHome + "/bin/javac"); - if (this.classpath != null) { - spec.addArgument(" -classpath"); - spec.addArgument(this.classpath); - } - spec.addArgument("/tmp/" + this.normalizedFileName + ".java"); - spec.setRedirected(true); - task.setSpecification(spec); - - ExecutionService service = new ExecutionServiceImpl(); - service.setProvider(this.executionProvider.toLowerCase()); - - SecurityContext securityContext = AbstractionFactory - .newSecurityContext(this.executionProvider.toLowerCase()); - securityContext.setCredentials(null); - service.setSecurityContext(securityContext); - - ServiceContact sc = new ServiceContactImpl(this.serviceContact); - service.setServiceContact(sc); - task.addService(service); - - task.addStatusListener(this); - return task; - } - - private Task prepareExecutionTask() throws InvalidProviderException, - ProviderMethodException { - Task task = new TaskImpl("Execution_Task", Task.JOB_SUBMISSION); - - JobSpecification spec = new JobSpecificationImpl(); - - spec.setExecutable(this.javaHome + "/bin/java"); - if (this.classpath == null) { - spec.addArgument(" -classpath"); - spec.addArgument("/tmp"); - } else { - spec.addArgument(" -classpath"); - spec.addArgument("/tmp" + File.pathSeparator + this.classpath); - } - spec.addArgument(normalizedFileName); - spec.setRedirected(true); - task.setSpecification(spec); - - ExecutionService service = new ExecutionServiceImpl(); - service.setProvider(this.executionProvider.toLowerCase()); - - SecurityContext securityContext = AbstractionFactory - .newSecurityContext(this.executionProvider.toLowerCase()); - securityContext.setCredentials(null); - service.setSecurityContext(securityContext); - - ServiceContact sc = new ServiceContactImpl(this.serviceContact); - service.setServiceContact(sc); - task.addService(service); - - task.addStatusListener(this); - return task; - } - - public String getExecutionProvider() { - return executionProvider; - } - - public void setExecutionProvider(String provider) { - this.executionProvider = provider; - } - - public String getSourceFile() { - return sourceFile; - } - - public void setSourceFile(String sourceFile) { - this.sourceFile = sourceFile; - String filename = this.sourceFile.substring(this.sourceFile - .lastIndexOf("/")); - filename = filename.substring(1, filename.lastIndexOf(".java")); - this.normalizedFileName = filename; - logger.debug("Normalized file " + this.normalizedFileName); - } - - public String getServiceContact() { - return serviceContact; - } - - public void setServiceContact(String serviceContact) { - this.serviceContact = serviceContact; - } - - public String getJavaHome() { - return javaHome; - } - - public void setJavaHome(String javaHome) { - this.javaHome = javaHome; - } - - public void statusChanged(StatusEvent event) { - ExecutableObject eo = event.getSource(); - Status status = event.g... [truncated message content] |
|
From: <dko...@us...> - 2006-09-13 16:32:24
|
Revision: 697
http://svn.sourceforge.net/cogkit/?rev=697&view=rev
Author: dkodeboy
Date: 2006-09-13 09:31:12 -0700 (Wed, 13 Sep 2006)
Log Message:
-----------
code for gui
Added Paths:
-----------
trunk/current/src/cog/modules/workflow-repo-gui/
trunk/current/src/cog/modules/workflow-repo-gui/build.properties
trunk/current/src/cog/modules/workflow-repo-gui/derby.log
trunk/current/src/cog/modules/workflow-repo-gui/etc/
trunk/current/src/cog/modules/workflow-repo-gui/etc/grapheditor.properties
trunk/current/src/cog/modules/workflow-repo-gui/etc/karajan-restricted-classes.properties
trunk/current/src/cog/modules/workflow-repo-gui/etc/karajan-restricted.properties
trunk/current/src/cog/modules/workflow-repo-gui/etc/karajan.properties
trunk/current/src/cog/modules/workflow-repo-gui/etc/log4j.properties
trunk/current/src/cog/modules/workflow-repo-gui/etc/remote.properties
trunk/current/src/cog/modules/workflow-repo-gui/etc/repository.properties
trunk/current/src/cog/modules/workflow-repo-gui/etc/repository_schema_derby.sql
trunk/current/src/cog/modules/workflow-repo-gui/icons/
trunk/current/src/cog/modules/workflow-repo-gui/icons/about-small.png
trunk/current/src/cog/modules/workflow-repo-gui/icons/close_view.gif
trunk/current/src/cog/modules/workflow-repo-gui/icons/cog.gif
trunk/current/src/cog/modules/workflow-repo-gui/icons/file_obj.gif
trunk/current/src/cog/modules/workflow-repo-gui/icons/form_banner.gif
trunk/current/src/cog/modules/workflow-repo-gui/icons/help_topic.gif
trunk/current/src/cog/modules/workflow-repo-gui/icons/large_image.gif
trunk/current/src/cog/modules/workflow-repo-gui/icons/linkto_help.gif
trunk/current/src/cog/modules/workflow-repo-gui/icons/newprj_wiz.gif
trunk/current/src/cog/modules/workflow-repo-gui/icons/sample.gif
trunk/current/src/cog/modules/workflow-repo-gui/icons/th_horizontal.gif
trunk/current/src/cog/modules/workflow-repo-gui/icons/th_vertical.gif
trunk/current/src/cog/modules/workflow-repo-gui/icons/workflow.png
trunk/current/src/cog/modules/workflow-repo-gui/lib/
trunk/current/src/cog/modules/workflow-repo-gui/lib/backport-util-concurrent.jar
trunk/current/src/cog/modules/workflow-repo-gui/lib/cog-abstraction-common-2.0.jar
trunk/current/src/cog/modules/workflow-repo-gui/lib/cog-grapheditor-0.47.jar
trunk/current/src/cog/modules/workflow-repo-gui/lib/cog-grapheditor-0.47.jar.sav
trunk/current/src/cog/modules/workflow-repo-gui/lib/cog-karajan-0.33.jar
trunk/current/src/cog/modules/workflow-repo-gui/lib/cog-repository-1.0.jar
trunk/current/src/cog/modules/workflow-repo-gui/lib/cog-resources-1.0.jar
trunk/current/src/cog/modules/workflow-repo-gui/lib/cog-util-0.91.jar
trunk/current/src/cog/modules/workflow-repo-gui/lib/derby.jar
trunk/current/src/cog/modules/workflow-repo-gui/lib/derbynet.jar
trunk/current/src/cog/modules/workflow-repo-gui/lib/derbytools.jar
trunk/current/src/cog/modules/workflow-repo-gui/lib/jdom.jar
trunk/current/src/cog/modules/workflow-repo-gui/lib/log4j-1.2.8.jar
trunk/current/src/cog/modules/workflow-repo-gui/lib/xpp3-1.1.3.4d_b4_min.jar
trunk/current/src/cog/modules/workflow-repo-gui/lib/xpp3.LICENSE
trunk/current/src/cog/modules/workflow-repo-gui/lib/xstream-1.1.1-patched.jar
trunk/current/src/cog/modules/workflow-repo-gui/lib/xstream.LICENSE
trunk/current/src/cog/modules/workflow-repo-gui/plugin.properties
trunk/current/src/cog/modules/workflow-repo-gui/plugin.xml
trunk/current/src/cog/modules/workflow-repo-gui/schema/
trunk/current/src/cog/modules/workflow-repo-gui/schema/product.exsd
trunk/current/src/cog/modules/workflow-repo-gui/src/
trunk/current/src/cog/modules/workflow-repo-gui/src/karajanRCP/
trunk/current/src/cog/modules/workflow-repo-gui/src/karajanRCP/KarajanRCPPlugin.java
trunk/current/src/cog/modules/workflow-repo-gui/src/karajanRCP/rcp/
trunk/current/src/cog/modules/workflow-repo-gui/src/karajanRCP/rcp/Application.java
trunk/current/src/cog/modules/workflow-repo-gui/src/karajanRCP/rcp/ApplicationActionBarAdvisor.java
trunk/current/src/cog/modules/workflow-repo-gui/src/karajanRCP/rcp/ApplicationWorkbenchAdvisor.java
trunk/current/src/cog/modules/workflow-repo-gui/src/karajanRCP/rcp/ApplicationWorkbenchWindowAdvisor.java
trunk/current/src/cog/modules/workflow-repo-gui/src/karajanRCP/rcp/Messages.java
trunk/current/src/cog/modules/workflow-repo-gui/src/karajanRCP/rcp/OpenRepositoryFormEditorAction.java
trunk/current/src/cog/modules/workflow-repo-gui/src/karajanRCP/rcp/Perspective.java
trunk/current/src/cog/modules/workflow-repo-gui/src/karajanRCP/rcp/RepositoryFormActionBarContributor.java
trunk/current/src/cog/modules/workflow-repo-gui/src/karajanRCP/rcp/RepositoryFormEditor.java
trunk/current/src/cog/modules/workflow-repo-gui/src/karajanRCP/rcp/RepositoryFormEditorInput.java
trunk/current/src/cog/modules/workflow-repo-gui/src/karajanRCP/rcp/RepositoryIntroPage.java
trunk/current/src/cog/modules/workflow-repo-gui/src/karajanRCP/rcp/SaveComponentsPage.java
trunk/current/src/cog/modules/workflow-repo-gui/src/karajanRCP/rcp/SetupPage.java
trunk/current/src/cog/modules/workflow-repo-gui/src/karajanRCP/rcp/ViewComponentsPage.java
trunk/current/src/cog/modules/workflow-repo-gui/src/karajanRCP/rcp/index.xml
trunk/current/src/cog/modules/workflow-repo-gui/src/karajanRCP/rcp/messages.properties
trunk/current/src/cog/modules/workflow-repo-gui/src/karajanRCP/views/
trunk/current/src/cog/modules/workflow-repo-gui/src/karajanRCP/views/GraphViewer.java
trunk/current/src/cog/modules/workflow-repo-gui/src/karajanRCP/views/KarajanView.java
trunk/current/src/cog/modules/workflow-repo-gui/src/org/
trunk/current/src/cog/modules/workflow-repo-gui/src/org/cogkit/
trunk/current/src/cog/modules/workflow-repo-gui/src/org/cogkit/repository/
trunk/current/src/cog/modules/workflow-repo-gui/src/org/cogkit/repository/ComponentNodeInfo.java
trunk/current/src/cog/modules/workflow-repo-gui/src/org/cogkit/repository/LibraryElementLoader.java
trunk/current/src/cog/modules/workflow-repo-gui/src/org/cogkit/repository/NodeElementPropertySource.java
trunk/current/src/cog/modules/workflow-repo-gui/src/org/cogkit/repository/RepositoryLibInfo.java
trunk/current/src/cog/modules/workflow-repo-gui/src/org/cogkit/repository/RepositoryNodeInfo.java
trunk/current/src/cog/modules/workflow-repo-gui/src/org/cogkit/repository/SysLibInfo.java
trunk/current/src/cog/modules/workflow-repo-gui/src/org/cogkit/repository/util/
trunk/current/src/cog/modules/workflow-repo-gui/src/org/cogkit/repository/util/FileHandler.java
trunk/current/src/cog/modules/workflow-repo-gui/src/org/cogkit/repository/util/FilteredStream.java
trunk/current/src/cog/modules/workflow-repo-gui/src/org/cogkit/repository/util/InfoParser.java
trunk/current/src/cog/modules/workflow-repo-gui/src/org/cogkit/repository/util/NodeInfo.java
trunk/current/src/cog/modules/workflow-repo-gui/test/
trunk/current/src/cog/modules/workflow-repo-gui/test/repositoryTest.java
trunk/current/src/cog/modules/workflow-repo-gui/test/swingTest.java
Added: trunk/current/src/cog/modules/workflow-repo-gui/build.properties
===================================================================
--- trunk/current/src/cog/modules/workflow-repo-gui/build.properties (rev 0)
+++ trunk/current/src/cog/modules/workflow-repo-gui/build.properties 2006-09-13 16:31:12 UTC (rev 697)
@@ -0,0 +1,5 @@
+source.KarajanRCP.jar = src/
+output.KarajanRCP.jar = bin/
+bin.includes = plugin.xml,\
+ KarajanRCP.jar,\
+ src/
Added: trunk/current/src/cog/modules/workflow-repo-gui/derby.log
===================================================================
--- trunk/current/src/cog/modules/workflow-repo-gui/derby.log (rev 0)
+++ trunk/current/src/cog/modules/workflow-repo-gui/derby.log 2006-09-13 16:31:12 UTC (rev 697)
@@ -0,0 +1,10 @@
+----------------------------------------------------------------
+2006-07-19 15:56:34.203 GMT:
+ Booting Derby version The Apache Software Foundation - Apache Derby - 10.1.0.0 alpha - (178324): instance c013800d-010c-8780-b35f-000000109a08
+on database directory C:\KTest
+
+Database Class Loader started - derby.database.classpath=''
+
+2006-07-19 15:56:53.859 GMT:
+Shutting down instance c013800d-010c-8780-b35f-000000109a08
+----------------------------------------------------------------
Added: trunk/current/src/cog/modules/workflow-repo-gui/etc/grapheditor.properties
===================================================================
--- trunk/current/src/cog/modules/workflow-repo-gui/etc/grapheditor.properties (rev 0)
+++ trunk/current/src/cog/modules/workflow-repo-gui/etc/grapheditor.properties 2006-09-13 16:31:12 UTC (rev 697)
@@ -0,0 +1,25 @@
+#The output directory for the HTML target. It will be created if not present
+html.outputdir=html
+#The default layout engine used by the HTML canvas renderer
+html.graphview.layoutengine=org.globus.cog.gui.grapheditor.canvas.views.layouts.LevelLayout
+
+
+#The output directory for the PostScript target
+postscript.outputdir=postscript
+#The default file name for PostScript output
+postscript.outputfile=out.ps
+#The default layout engine used by the PostScript canvas renderer
+postscript.graphview.layoutengine=org.globus.cog.gui.grapheditor.canvas.views.layouts.LevelLayout
+
+
+#The location of the service that the remote target will use
+remote.contact=localhost:9999
+
+#The output directory for the SVG target. It will be created if not present
+svg.outputdir=svg
+#The default layout engine used by the SVG canvas renderer
+svg.graphview.layoutengine=org.globus.cog.gui.grapheditor.canvas.views.layouts.LevelLayout
+
+#The output directory for the Dot target. It will be created if not present
+dot.outputdir=dot
+dot.outputfile=graph.dot
\ No newline at end of file
Added: trunk/current/src/cog/modules/workflow-repo-gui/etc/karajan-restricted-classes.properties
===================================================================
--- trunk/current/src/cog/modules/workflow-repo-gui/etc/karajan-restricted-classes.properties (rev 0)
+++ trunk/current/src/cog/modules/workflow-repo-gui/etc/karajan-restricted-classes.properties 2006-09-13 16:31:12 UTC (rev 697)
@@ -0,0 +1,9 @@
+package.allow=java.lang
+package.allow=java.util
+
+package.allow=org.globus.cog.karajan.workflow.nodes
+package.allow=org.globus.cog.karajan.workflow.events
+package.allow=org.globus.cog.karajan.arguments
+package.allow=org.globus.cog.karajan.util
+
+class.disallow=org.globus.cog.karajan.workflow.JavaElement
Added: trunk/current/src/cog/modules/workflow-repo-gui/etc/karajan-restricted.properties
===================================================================
--- trunk/current/src/cog/modules/workflow-repo-gui/etc/karajan-restricted.properties (rev 0)
+++ trunk/current/src/cog/modules/workflow-repo-gui/etc/karajan-restricted.properties 2006-09-13 16:31:12 UTC (rev 697)
@@ -0,0 +1 @@
+include.dirs=@classpath/
Added: trunk/current/src/cog/modules/workflow-repo-gui/etc/karajan.properties
===================================================================
--- trunk/current/src/cog/modules/workflow-repo-gui/etc/karajan.properties (rev 0)
+++ trunk/current/src/cog/modules/workflow-repo-gui/etc/karajan.properties 2006-09-13 16:31:12 UTC (rev 697)
@@ -0,0 +1 @@
+include.dirs=.:@classpath/
Added: trunk/current/src/cog/modules/workflow-repo-gui/etc/log4j.properties
===================================================================
--- trunk/current/src/cog/modules/workflow-repo-gui/etc/log4j.properties (rev 0)
+++ trunk/current/src/cog/modules/workflow-repo-gui/etc/log4j.properties 2006-09-13 16:31:12 UTC (rev 697)
@@ -0,0 +1,70 @@
+#Root category
+log4j.rootCategory=WARN, CONSOLE
+
+# CONSOLE is set to be a ConsoleAppender using a PatternLayout
+# The class is not printed
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=%-5p %x - %m%n
+
+# CONSOLE-C is the same as above, but the class is printed
+log4j.appender.CONSOLE-C=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE-C.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE-C.layout.ConversionPattern=%-5p [%c] %x - %m%n
+
+# %karajan%
+
+
+# %abstraction%
+
+log4j.logger.org.globus.cog.abstraction=WARN
+
+# %abstraction-common%
+
+log4j.logger.org.globus.cog.abstraction.impl.common=WARN
+
+# %jglobus%
+
+
+# %util%
+
+
+# %abstraction-examples%
+
+
+# %grapheditor%
+
+log4j.logger.org.globus.cog.gui.grapheditor=INFO
+
+# %resources%
+
+
+# %provider-gt2%
+
+
+# %provider-gt2ft%
+
+
+# %provider-gt3_2_1%
+
+
+# %provider-gt3-common%
+
+
+# %provider-gt4_0_0%
+
+log4j.logger.org.apache.axis.utils.JavaUtils=ERROR
+# %provider-condor%
+
+
+# %provider-ssh%
+
+
+# %provider-webdav%
+
+
+# %provider-local%
+
+
+# %provider-mpichg2%
+
Added: trunk/current/src/cog/modules/workflow-repo-gui/etc/remote.properties
===================================================================
--- trunk/current/src/cog/modules/workflow-repo-gui/etc/remote.properties (rev 0)
+++ trunk/current/src/cog/modules/workflow-repo-gui/etc/remote.properties 2006-09-13 16:31:12 UTC (rev 697)
@@ -0,0 +1,16 @@
+# default is to keep the client connection alive and reconnect to the
+# server if the connection is lost. Without the reconnect, the remote
+# invocations will fail if a disconnection occurs. Of course, the same
+# happens if the reconnection fails
+".*" keepalive(120), reconnect
+
+# for servers inside a domain that is allowed to connect to this host
+# use a persistent callback server, but do polling every 2 minutes
+#".*mcs.anl.gov" callback, poll(120)
+
+# for Australian servers use the callback server, but also try to keep
+# the client connection for at most 2 minutes
+#".*au" keepalive(120), callback
+
+# poll every 5 minutes
+#".*uk" poll(300)
Added: trunk/current/src/cog/modules/workflow-repo-gui/etc/repository.properties
===================================================================
--- trunk/current/src/cog/modules/workflow-repo-gui/etc/repository.properties (rev 0)
+++ trunk/current/src/cog/modules/workflow-repo-gui/etc/repository.properties 2006-09-13 16:31:12 UTC (rev 697)
@@ -0,0 +1,11 @@
+derby.system.home = c:/sc2005/log/comp_repository/
+derby.infolog.append=true
+derby.storage.pageSize=8192
+derby.storage.pageReservedSpace=60
+derby.repository.dir=c:/sc2005/database/workflowRepository
+derby.repository.type=local
+derby.username=laszewsk
+derby.password=jaba
+derby.host=127.0.0.1
+derby.port=1527
+derby.stream.error.file=derby.log
Added: trunk/current/src/cog/modules/workflow-repo-gui/etc/repository_schema_derby.sql
===================================================================
--- trunk/current/src/cog/modules/workflow-repo-gui/etc/repository_schema_derby.sql (rev 0)
+++ trunk/current/src/cog/modules/workflow-repo-gui/etc/repository_schema_derby.sql 2006-09-13 16:31:12 UTC (rev 697)
@@ -0,0 +1,43 @@
+
+CREATE TABLE COMPONENT_METADATA (
+ "COMP_ID" VARCHAR(40) NOT NULL,
+ "SHORTDESC" VARCHAR(100),
+ "DESCRIPTION" VARCHAR(255),
+ "AUTHOR" VARCHAR(100),
+ "VERSION" VARCHAR(100),
+ "DATE_CREATED" DATE,
+ "DATE_MODIFIED" DATE,
+ "LANGUAGE" VARCHAR(25),
+ "SIGNATURE" VARCHAR(255)
+ );
+
+CREATE TABLE COMPONENT_CODE (
+ "COMP_ID" VARCHAR(50) NOT NULL,
+ "CODE" CLOB
+ );
+
+CREATE TABLE COMPONENT_ATTRIBUTES (
+ "ATTR_ID" VARCHAR(150) NOT NULL,
+ "ATTR_DESC" VARCHAR(255),
+ "ATTR_TYPE" VARCHAR(100)
+ );
+
+INSERT INTO COMPONENT_ATTRIBUTES VALUES ('comp_id', 'Components ID','varchar(40)');
+INSERT INTO COMPONENT_ATTRIBUTES VALUES ('shortdesc','Short Description','varchar(100)');
+INSERT INTO COMPONENT_ATTRIBUTES VALUES ('description','Two line description','varchar(255)');
+INSERT INTO COMPONENT_ATTRIBUTES VALUES ('author','creator of the component','varchar(100)');
+INSERT INTO COMPONENT_ATTRIBUTES VALUES ('version','version of the component','varchar(100)');
+INSERT INTO COMPONENT_ATTRIBUTES VALUES ('date_created','date of creation','date');
+INSERT INTO COMPONENT_ATTRIBUTES VALUES ('date_modified','date of modification','date');
+INSERT INTO COMPONENT_ATTRIBUTES VALUES ('language','component code language','varchar(25)');
+INSERT INTO COMPONENT_ATTRIBUTES VALUES ('signature','component xml signature','varchar(255)');
+
+
+ALTER TABLE COMPONENT_METADATA
+ ADD CONSTRAINT "METADATA_PK_CONS" PRIMARY KEY ("COMP_ID");
+
+ALTER TABLE COMPONENT_CODE
+ ADD CONSTRAINT "REQUEST_FK_CONS" FOREIGN KEY ("COMP_ID") REFERENCES COMPONENT_METADATA("COMP_ID");
+
+ALTER TABLE COMPONENT_ATTRIBUTES
+ ADD CONSTRAINT "ATTRIBUTES_PK_CONS" PRIMARY KEY ("ATTR_ID");
Added: trunk/current/src/cog/modules/workflow-repo-gui/icons/about-small.png
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/icons/about-small.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/icons/close_view.gif
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/icons/close_view.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/icons/cog.gif
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/icons/cog.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/icons/file_obj.gif
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/icons/file_obj.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/icons/form_banner.gif
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/icons/form_banner.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/icons/help_topic.gif
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/icons/help_topic.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/icons/large_image.gif
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/icons/large_image.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/icons/linkto_help.gif
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/icons/linkto_help.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/icons/newprj_wiz.gif
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/icons/newprj_wiz.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/icons/sample.gif
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/icons/sample.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/icons/th_horizontal.gif
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/icons/th_horizontal.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/icons/th_vertical.gif
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/icons/th_vertical.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/icons/workflow.png
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/icons/workflow.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/lib/backport-util-concurrent.jar
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/lib/backport-util-concurrent.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/lib/cog-abstraction-common-2.0.jar
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/lib/cog-abstraction-common-2.0.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/lib/cog-grapheditor-0.47.jar
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/lib/cog-grapheditor-0.47.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/lib/cog-grapheditor-0.47.jar.sav
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/lib/cog-grapheditor-0.47.jar.sav
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/lib/cog-karajan-0.33.jar
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/lib/cog-karajan-0.33.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/lib/cog-repository-1.0.jar
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/lib/cog-repository-1.0.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/lib/cog-resources-1.0.jar
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/lib/cog-resources-1.0.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/lib/cog-util-0.91.jar
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/lib/cog-util-0.91.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/lib/derby.jar
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/lib/derby.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/lib/derbynet.jar
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/lib/derbynet.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/lib/derbytools.jar
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/lib/derbytools.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/lib/jdom.jar
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/lib/jdom.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/lib/log4j-1.2.8.jar
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/lib/log4j-1.2.8.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/lib/xpp3-1.1.3.4d_b4_min.jar
===================================================================
(Binary files differ)
Property changes on: trunk/current/src/cog/modules/workflow-repo-gui/lib/xpp3-1.1.3.4d_b4_min.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/current/src/cog/modules/workflow-repo-gui/lib/xpp3.LICENSE
===================================================================
--- trunk/current/src/cog/modules/workflow-repo-gui/lib/xpp3.LICENSE (rev 0)
+++ trunk/current/src/cog/modules/workflow-repo-gui/lib/xpp3.LICENSE 2006-09-13 16:31:12 UTC (rev 697)
@@ -0,0 +1,46 @@
+Indiana University Extreme! Lab Software License
+
+Version 1.1.1
+
+Copyright (c) 2002 Extreme! Lab, Indiana University. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the distribution.
+
+3. The end-user documentation included with the redistribution, if any,
+ must include the following acknowledgment:
+
+ "This product includes software developed by the Indiana University
+ Extreme! Lab (http://www.extreme.indiana.edu/)."
+
+Alternately, this acknowledgment may appear in the software itself,
+if and wherever such third-party acknowledgments normally appear.
+
+4. The names "Indiana Univeristy" and "Indiana Univeristy Extreme! Lab"
+must not be used to endorse or promote products derived from this
+software without prior written permission. For written permission,
+please contact http://www.extreme.indiana.edu/.
+
+5. Products derived from this software may not use "Indiana Univeristy"
+name nor may "Indiana Univeristy" appear in their name, without prior
+written permission of the Indiana University.
+
+THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHORS, COPYRIGHT HOLDERS OR ITS CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Added: trunk/current/src/cog/modules/workflow-repo-gui/lib/xstream-1.1.1-pa...
[truncated message content] |
|
From: <ha...@us...> - 2007-02-12 23:55:08
|
Revision: 1575
http://svn.sourceforge.net/cogkit/?rev=1575&view=rev
Author: hategan
Date: 2007-02-12 15:55:03 -0800 (Mon, 12 Feb 2007)
Log Message:
-----------
added providers for PBS and Cobalt
Added Paths:
-----------
trunk/current/src/cog/modules/provider-localscheduler/
trunk/current/src/cog/modules/provider-localscheduler/CHANGES.txt
trunk/current/src/cog/modules/provider-localscheduler/build.xml
trunk/current/src/cog/modules/provider-localscheduler/dependencies.xml
trunk/current/src/cog/modules/provider-localscheduler/etc/
trunk/current/src/cog/modules/provider-localscheduler/etc/MANIFEST.MF.head
trunk/current/src/cog/modules/provider-localscheduler/etc/MANIFEST.MF.tail
trunk/current/src/cog/modules/provider-localscheduler/etc/log4j.properties.module
trunk/current/src/cog/modules/provider-localscheduler/etc/provider-cobalt.properties
trunk/current/src/cog/modules/provider-localscheduler/etc/provider-pbs.properties
trunk/current/src/cog/modules/provider-localscheduler/launchers.xml
trunk/current/src/cog/modules/provider-localscheduler/lib/
trunk/current/src/cog/modules/provider-localscheduler/project.properties
trunk/current/src/cog/modules/provider-localscheduler/resources/
trunk/current/src/cog/modules/provider-localscheduler/resources/cog-provider.properties
trunk/current/src/cog/modules/provider-localscheduler/src/
trunk/current/src/cog/modules/provider-localscheduler/src/org/
trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/
trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/
trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/
trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/
trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/
trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/cobalt/
trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/cobalt/CobaltExecutor.java
trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/cobalt/Properties.java
trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/cobalt/QueuePoller.java
trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/cobalt/execution/
trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/cobalt/execution/JobSubmissionTaskHandler.java
trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/cobalt/execution/TaskHandlerImpl.java
trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/common/
trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/common/Job.java
trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/common/ProcessException.java
trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/common/ProcessListener.java
trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/pbs/
trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/pbs/PBSExecutor.java
trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/pbs/Properties.java
trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/pbs/QueuePoller.java
trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/pbs/execution/
trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/pbs/execution/JobSubmissionTaskHandler.java
trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/pbs/execution/TaskHandlerImpl.java
Added: trunk/current/src/cog/modules/provider-localscheduler/CHANGES.txt
===================================================================
--- trunk/current/src/cog/modules/provider-localscheduler/CHANGES.txt (rev 0)
+++ trunk/current/src/cog/modules/provider-localscheduler/CHANGES.txt 2007-02-12 23:55:03 UTC (rev 1575)
@@ -0,0 +1,3 @@
+(02/12/07)
+
+*** Initial version
\ No newline at end of file
Added: trunk/current/src/cog/modules/provider-localscheduler/build.xml
===================================================================
--- trunk/current/src/cog/modules/provider-localscheduler/build.xml (rev 0)
+++ trunk/current/src/cog/modules/provider-localscheduler/build.xml 2007-02-12 23:55:03 UTC (rev 1575)
@@ -0,0 +1,152 @@
+<project name="Java CoG Kit" default="dist" basedir=".">
+
+ <property file="project.properties"/>
+ <property name="cog.dir" value="${basedir}/../../"/>
+ <property name="main.buildfile" value="${cog.dir}/mbuild.xml"/>
+ <property name="dist.dir" value="${cog.dir}/modules/${module.name}/dist/${module.name}-${version}"/>
+ <property name="build.dir" value="${cog.dir}/modules/${module.name}/build"/>
+
+ <!-- _________________________________________________________________ -->
+ <!-- / \ -->
+ <!-- | Help | -->
+ <!-- \_________________________________________________________________/ -->
+
+ <target name="help">
+ <echo>
+ Available targets:
+ help:
+ prints out this help message
+
+ dist:
+ creates a distribution directory of the
+ ${project} ${long.name}
+
+ jar:
+ creates a jar file for the ${project} ${long.name}
+ named ${jar.filename}
+
+ javadoc:
+ creates the documentation
+
+ clean:
+ removes the compiled classes
+
+ distclean:
+ deletes the distribution directory
+
+ all:
+ dist and javadoc
+
+ deploy.webstart:
+ deploys the module as a webstart application
+
+ dist.joint:
+ builds everything into one jar file. Should only
+ be used globally (from all)
+
+ fixeol:
+ change newlines to the unix standard
+ </echo>
+ </target>
+
+
+ <!-- _________________________________________________________________ -->
+ <!-- / \ -->
+ <!-- | Dist | -->
+ <!-- \_________________________________________________________________/ -->
+
+ <target name="dist" unless="no.providers">
+ <ant antfile="${main.buildfile}" target="dist"/>
+ </target>
+
+
+ <!-- _________________________________________________________________ -->
+ <!-- / \ -->
+ <!-- | Compile | -->
+ <!-- \_________________________________________________________________/ -->
+
+ <target name="compile">
+ <ant antfile="${main.buildfile}" target="compile"/>
+ </target>
+
+ <!-- _________________________________________________________________ -->
+ <!-- / \ -->
+ <!-- | Clean | -->
+ <!-- \_________________________________________________________________/ -->
+
+ <target name="clean">
+ <ant antfile="${main.buildfile}" target="clean"/>
+ </target>
+
+
+ <!-- _________________________________________________________________ -->
+ <!-- / \ -->
+ <!-- | Distclean | -->
+ <!-- \_________________________________________________________________/ -->
+
+ <target name="distclean">
+ <ant antfile="${main.buildfile}" target="distclean"/>
+ </target>
+
+
+ <!-- _________________________________________________________________ -->
+ <!-- / \ -->
+ <!-- | Jar | -->
+ <!-- \_________________________________________________________________/ -->
+
+ <target name="jar">
+ <ant antfile="${main.buildfile}" target="jar"/>
+ </target>
+
+
+ <!-- _________________________________________________________________ -->
+ <!-- / \ -->
+ <!-- | Javadoc | -->
+ <!-- \_________________________________________________________________/ -->
+
+ <target name="javadoc">
+ <ant antfile="${main.buildfile}" target="javadoc"/>
+ </target>
+
+
+
+ <!-- _________________________________________________________________ -->
+ <!-- / \ -->
+ <!-- | PMD | -->
+ <!-- \_________________________________________________________________/ -->
+
+ <target name="pmd">
+ <ant antfile="${main.buildfile}" target="pmd"/>
+ </target>
+
+ <target name="deploy.webstart">
+ <ant antfile="${main.buildfile}" target="deploy.webstart"/>
+ </target>
+
+ <target name="replacelibs">
+ <ant antfile="${main.buildfile}" target="replacelibs"/>
+ </target>
+
+ <target name="webstart.launchers">
+ <ant antfile="${main.buildfile}" target="webstart.launchers"/>
+ </target>
+
+ <target name="dist.joint">
+ <ant antfile="${main.buildfile}" target="dist.all"/>
+ </target>
+
+ <target name="module.package">
+ <ant antfile="${main.buildfile}" target="module.package"/>
+ </target>
+
+ <!-- ================================================ -->
+ <!-- fixeol -->
+ <!-- ================================================ -->
+
+ <target name="fixeol">
+ <ant antfile="${main.buildfile}" target="fixeol"/>
+ </target>
+
+</project>
+
+
Added: trunk/current/src/cog/modules/provider-localscheduler/dependencies.xml
===================================================================
--- trunk/current/src/cog/modules/provider-localscheduler/dependencies.xml (rev 0)
+++ trunk/current/src/cog/modules/provider-localscheduler/dependencies.xml 2007-02-12 23:55:03 UTC (rev 1575)
@@ -0,0 +1,14 @@
+<project name="Project dependencies" default="deps" basedir=".">
+ <!-- project dependencies -->
+ <target name="deps">
+ <ant antfile="${main.buildfile}" target="dep">
+ <property name="module" value="abstraction-common"/>
+ </ant>
+ <ant antfile="${main.buildfile}" target="dep">
+ <property name="module" value="jglobus"/>
+ </ant>
+ <ant antfile="${main.buildfile}" target="dep">
+ <property name="module" value="util"/>
+ </ant>
+ </target>
+</project>
Added: trunk/current/src/cog/modules/provider-localscheduler/etc/MANIFEST.MF.head
===================================================================
--- trunk/current/src/cog/modules/provider-localscheduler/etc/MANIFEST.MF.head (rev 0)
+++ trunk/current/src/cog/modules/provider-localscheduler/etc/MANIFEST.MF.head 2007-02-12 23:55:03 UTC (rev 1575)
@@ -0,0 +1 @@
+Manifest-Version: 1.0
Added: trunk/current/src/cog/modules/provider-localscheduler/etc/MANIFEST.MF.tail
===================================================================
--- trunk/current/src/cog/modules/provider-localscheduler/etc/MANIFEST.MF.tail (rev 0)
+++ trunk/current/src/cog/modules/provider-localscheduler/etc/MANIFEST.MF.tail 2007-02-12 23:55:03 UTC (rev 1575)
@@ -0,0 +1 @@
+
Added: trunk/current/src/cog/modules/provider-localscheduler/etc/log4j.properties.module
===================================================================
Added: trunk/current/src/cog/modules/provider-localscheduler/etc/provider-cobalt.properties
===================================================================
--- trunk/current/src/cog/modules/provider-localscheduler/etc/provider-cobalt.properties (rev 0)
+++ trunk/current/src/cog/modules/provider-localscheduler/etc/provider-cobalt.properties 2007-02-12 23:55:03 UTC (rev 1575)
@@ -0,0 +1,16 @@
+#
+# The interval, in seconds, at which the provider will poll the Cobalt
+# queue for status updates. There is at most one poll thread per JVM,
+# which is shared by all the jobs submitted through the Cobalt provider.
+#
+poll.interval=5
+
+#
+# The path to cqsub. The default assumes that cqsub is in PATH
+#
+cqsub=cqsub
+
+#
+# The path to cqstat. The default assumes that cqstat is in PATH
+#
+cqstat=cqstat
Added: trunk/current/src/cog/modules/provider-localscheduler/etc/provider-pbs.properties
===================================================================
--- trunk/current/src/cog/modules/provider-localscheduler/etc/provider-pbs.properties (rev 0)
+++ trunk/current/src/cog/modules/provider-localscheduler/etc/provider-pbs.properties 2007-02-12 23:55:03 UTC (rev 1575)
@@ -0,0 +1,16 @@
+#
+# The interval, in seconds, at which the provider will poll the PBS
+# queue for status updates. There is at most one poll thread per JVM,
+# which is shared by all the jobs submitted through the PBS provider.
+#
+poll.interval=5
+
+#
+# The path to qsub. The default assumes that qsub is in PATH
+#
+qsub=qsub
+
+#
+# The path to qstat. The default assumes that qstat is in PATH
+#
+qstat=qstat
Added: trunk/current/src/cog/modules/provider-localscheduler/launchers.xml
===================================================================
--- trunk/current/src/cog/modules/provider-localscheduler/launchers.xml (rev 0)
+++ trunk/current/src/cog/modules/provider-localscheduler/launchers.xml 2007-02-12 23:55:03 UTC (rev 1575)
@@ -0,0 +1,6 @@
+<project name="Launchers" default="create" basedir=".">
+ <target name="create">
+ </target>
+ <target name="webstart">
+ </target>
+</project>
Added: trunk/current/src/cog/modules/provider-localscheduler/project.properties
===================================================================
--- trunk/current/src/cog/modules/provider-localscheduler/project.properties (rev 0)
+++ trunk/current/src/cog/modules/provider-localscheduler/project.properties 2007-02-12 23:55:03 UTC (rev 1575)
@@ -0,0 +1,7 @@
+module.name = provider-localscheduler
+long.name = Local providers for PBS/Torque and Cobalt
+version = 1.0
+project = Java CoG Kit
+lib.deps = -
+debug = true
+
Added: trunk/current/src/cog/modules/provider-localscheduler/resources/cog-provider.properties
===================================================================
--- trunk/current/src/cog/modules/provider-localscheduler/resources/cog-provider.properties (rev 0)
+++ trunk/current/src/cog/modules/provider-localscheduler/resources/cog-provider.properties 2007-02-12 23:55:03 UTC (rev 1575)
@@ -0,0 +1,13 @@
+provider=pbs
+sandbox=false
+executionTaskHandler=org.globus.cog.abstraction.impl.scheduler.pbs.execution.TaskHandlerImpl
+securityContext=org.globus.cog.abstraction.impl.common.task.SecurityContextImpl
+
+alias=pbslocal:pbs
+
+provider=cobalt
+sandbox=false
+executionTaskHandler=org.globus.cog.abstraction.impl.scheduler.cobalt.execution.TaskHandlerImpl
+securityContext=org.globus.cog.abstraction.impl.common.task.SecurityContextImpl
+
+alias=cobaltlocal:cobalt
Added: trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/cobalt/CobaltExecutor.java
===================================================================
--- trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/cobalt/CobaltExecutor.java (rev 0)
+++ trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/cobalt/CobaltExecutor.java 2007-02-12 23:55:03 UTC (rev 1575)
@@ -0,0 +1,286 @@
+//----------------------------------------------------------------------
+//This code is developed as part of the Java CoG Kit project
+//The terms of the license can be found at http://www.cogkit.org/license
+//This message may not be removed or altered.
+//----------------------------------------------------------------------
+
+/*
+ * Created on Oct 11, 2005
+ */
+package org.globus.cog.abstraction.impl.scheduler.cobalt;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.globus.cog.abstraction.impl.scheduler.common.Job;
+import org.globus.cog.abstraction.impl.scheduler.common.ProcessException;
+import org.globus.cog.abstraction.impl.scheduler.common.ProcessListener;
+import org.globus.cog.abstraction.interfaces.JobSpecification;
+import org.globus.cog.abstraction.interfaces.Task;
+import org.globus.gsi.gssapi.auth.AuthorizationException;
+import org.ietf.jgss.GSSException;
+
+public class CobaltExecutor implements ProcessListener {
+ public static final Logger logger = Logger.getLogger(CobaltExecutor.class);
+
+ private JobSpecification spec;
+ private Task task;
+ private static QueuePoller poller;
+ private ProcessListener listener;
+ private String stdout, stderr, exitcode;
+ private File script;
+ private String cqsub;
+
+ private static final String[] EMPTY_STRING_ARRAY = new String[0];
+
+ public CobaltExecutor(Task task, ProcessListener listener) {
+ this.task = task;
+ this.spec = (JobSpecification) task.getSpecification();
+ this.listener = listener;
+ this.cqsub = Properties.getProperties().getCQSub();
+ }
+
+ private static synchronized QueuePoller getProcessPoller() {
+ if (poller == null) {
+ poller = new QueuePoller();
+ poller.start();
+ }
+ return poller;
+ }
+
+ public void start() throws AuthorizationException, GSSException,
+ IOException, ProcessException {
+ File scriptdir = new File(System.getProperty("user.home")
+ + File.separatorChar + ".globus" + File.separatorChar
+ + "scripts");
+ scriptdir.mkdirs();
+ if (!scriptdir.exists()) {
+ throw new IOException("Failed to create script directory ("
+ + scriptdir + ")");
+ }
+ script = File.createTempFile("cobalt", ".sh", scriptdir);
+ stdout = spec.getStdOutput() == null ? script.getAbsolutePath()
+ + ".stdout" : spec.getStdOutput();
+ stderr = spec.getStdError() == null ? script.getAbsolutePath()
+ + ".stderr" : spec.getStdError();
+ exitcode = script.getAbsolutePath() + ".exitcode";
+ writeScript(new BufferedWriter(new FileWriter(script)), exitcode,
+ stdout, stderr);
+ if (logger.isDebugEnabled()) {
+ logger.debug("Wrote submit script to " + script);
+ }
+ String[] cmdline = buildCMDLine(script.getAbsolutePath());
+
+ Process process = Runtime.getRuntime().exec(cmdline, null, null);
+
+ try {
+ process.getOutputStream().close();
+ }
+ catch (IOException e) {
+ }
+
+ try {
+ int code = process.waitFor();
+ if (code != 0) {
+ throw new ProcessException(
+ "Could not submit job (qsub reported an exit code of "
+ + code + "). "
+ + getOutput(process.getErrorStream()));
+ }
+ if (logger.isDebugEnabled()) {
+ logger.debug("QSub done (exit code " + code + ")");
+ }
+ }
+ catch (InterruptedException e) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("Interrupted exception while waiting for qsub", e);
+ }
+ if (listener != null) {
+ listener
+ .processFailed("The submission process was interrupted");
+ }
+ }
+
+ String jobid = getOutput(process.getInputStream());
+
+ getProcessPoller().addJob(
+ new Job(jobid, spec.isRedirected() ? stdout : null, spec
+ .isRedirected() ? stderr : null, exitcode, this));
+ }
+
+ private void error(String message) {
+ listener.processFailed(message);
+ }
+
+ protected void writeScript(Writer wr, String exitcodefile, String stdout,
+ String stderr) throws IOException {
+ if (spec.getStdInput() != null) {
+ throw new IOException("The Cobalt provider cannot redirect STDIN");
+ }
+ Iterator i = spec.getEnvironmentVariableNames().iterator();
+ while (i.hasNext()) {
+ String name = (String) i.next();
+ wr.write(name);
+ wr.write('=');
+ wr.write(quote(spec.getEnvironmentVariable(name)));
+ wr.write('\n');
+ }
+ wr.write(quote(spec.getExecutable()));
+ List args = spec.getArgumentsAsList();
+ if (args != null && args.size() > 0) {
+ wr.write(' ');
+ i = args.iterator();
+ while (i.hasNext()) {
+ wr.write(quote((String) i.next()));
+ wr.write(' ');
+ }
+ }
+ wr.write(" 1>" + quote(stdout) + ' ');
+ wr.write(" 2>" + quote(stderr) + '\n');
+ wr.write("/bin/echo $? >" + exitcodefile + '\n');
+ wr.close();
+ }
+
+ protected void addAttr(String attrName, String option, List l) {
+ Object value = spec.getAttribute(attrName);
+ if (value != null) {
+ l.add(option);
+ l.add(String.valueOf(value));
+ }
+ }
+
+ protected String[] buildCMDLine(String script) {
+ List l = new ArrayList();
+ l.add(cqsub);
+ addAttr("queue", "-q", l);
+ Collection names = spec.getEnvironmentVariableNames();
+ if (names != null && names.size() > 0) {
+ l.add("-e");
+ StringBuffer sb = new StringBuffer();
+ Iterator i = names.iterator();
+ while (i.hasNext()) {
+ String name = (String) i.next();
+ sb.append(name);
+ sb.append('=');
+ sb.append(quote(spec.getEnvironmentVariable(name)));
+ if (i.hasNext()) {
+ sb.append(':');
+ }
+ }
+ l.add(sb.toString());
+ }
+ addAttr("mode", "-m", l);
+ //We're gonna treat this as the process count
+ addAttr("count", "-c", l);
+ addAttr("project", "-p", l);
+ addAttr("queue", "-q", l);
+ addAttr("maxwalltime", "-t", l);
+ if (spec.getDirectory() != null) {
+ l.add("-C");
+ l.add(spec.getDirectory());
+ }
+ l.add("/bin/sh");
+ l.add(script);
+ return (String[]) l.toArray(EMPTY_STRING_ARRAY);
+ }
+
+ protected String quote(String s) {
+ boolean quotes = false;
+ if (s.indexOf(' ') != -1) {
+ quotes = true;
+ }
+ StringBuffer sb = new StringBuffer();
+ if (quotes) {
+ sb.append('"');
+ }
+ for (int i = 0; i < s.length(); i++) {
+ char c = s.charAt(i);
+ if (c == '"' || c == '\\') {
+ sb.append('\\');
+ break;
+ }
+ sb.append(c);
+ }
+ if (quotes) {
+ sb.append('"');
+ }
+ return sb.toString();
+ }
+
+ protected String getOutput(InputStream is) throws IOException {
+ if (logger.isDebugEnabled()) {
+ logger.debug("Waiting for output from qsub");
+ }
+ BufferedReader br = new BufferedReader(new InputStreamReader(is));
+ StringBuffer sb = new StringBuffer();
+ String out = br.readLine();
+ if (logger.isDebugEnabled()) {
+ logger.debug("Output from qsub is: \"" + out + "\"");
+ }
+ if ("".equals(out)) {
+ throw new IOException("Qsub returned empty job ID");
+ }
+ return out;
+ }
+
+ protected void cleanup() {
+ script.delete();
+ new File(exitcode).delete();
+ if (spec.getStdOutput() == null && stdout != null) {
+ new File(stdout).delete();
+ }
+ if (spec.getStdError() == null && stderr != null) {
+ new File(stderr).delete();
+ }
+ }
+
+ public void processCompleted(int exitCode) {
+ cleanup();
+ if (listener != null) {
+ listener.processCompleted(exitCode);
+ }
+ }
+
+ public void processFailed(String message) {
+ cleanup();
+ if (listener != null) {
+ listener.processFailed(message);
+ }
+ }
+
+ public void statusChanged(int status) {
+ if (listener != null) {
+ listener.statusChanged(status);
+ }
+ }
+
+ public void stderrUpdated(String stderr) {
+ if (listener != null) {
+ listener.stderrUpdated(stderr);
+ }
+ }
+
+ public void stdoutUpdated(String stdout) {
+ if (listener != null) {
+ listener.stdoutUpdated(stdout);
+ }
+ }
+
+ public void processFailed(Exception e) {
+ cleanup();
+ if (listener != null) {
+ listener.processFailed(e);
+ }
+ }
+}
Added: trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/cobalt/Properties.java
===================================================================
--- trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/cobalt/Properties.java (rev 0)
+++ trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/cobalt/Properties.java 2007-02-12 23:55:03 UTC (rev 1575)
@@ -0,0 +1,80 @@
+//----------------------------------------------------------------------
+//This code is developed as part of the Java CoG Kit project
+//The terms of the license can be found at http://www.cogkit.org/license
+//This message may not be removed or altered.
+//----------------------------------------------------------------------
+
+/*
+ * Created on Oct 20, 2005
+ */
+package org.globus.cog.abstraction.impl.scheduler.cobalt;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.apache.log4j.Logger;
+
+public class Properties extends java.util.Properties {
+ private static Logger logger = Logger.getLogger(Properties.class);
+
+ public static final String PROPERTIES = "provider-cobalt.properties";
+
+ public static final String POLL_INTERVAL = "poll.interval";
+ public static final String CQSUB = "cqsub";
+ public static final String CQSTAT = "cqstat";
+
+ private static Properties properties;
+
+ public static synchronized Properties getProperties() {
+ if (properties == null) {
+ properties = new Properties();
+ properties.load();
+ }
+ return properties;
+ }
+
+ private void load() {
+ setDefaults();
+ InputStream is = getClass().getClassLoader().getResourceAsStream(PROPERTIES);
+ if (is == null) {
+ logger.warn("Could not find " + PROPERTIES + ". Using defaults.");
+ }
+ else {
+ try {
+ super.load(is);
+ }
+ catch (IOException e) {
+ }
+ }
+ }
+
+ private void setDefaults() {
+ setPollInterval(5);
+ setCQSub("cqsub");
+ setCQStat("cqstat");
+ }
+
+ public void setPollInterval(int value) {
+ setProperty(POLL_INTERVAL, String.valueOf(value));
+ }
+
+ public int getPollInterval() {
+ return Integer.parseInt(getProperty(POLL_INTERVAL));
+ }
+
+ public void setCQSub(String cqsub) {
+ setProperty(CQSUB, cqsub);
+ }
+
+ public String getCQSub() {
+ return getProperty(CQSUB);
+ }
+
+ public void setCQStat(String cqstat) {
+ setProperty(CQSTAT, cqstat);
+ }
+
+ public String getCQStat() {
+ return getProperty(CQSTAT);
+ }
+}
Added: trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/cobalt/QueuePoller.java
===================================================================
--- trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/cobalt/QueuePoller.java (rev 0)
+++ trunk/current/src/cog/modules/provider-localscheduler/src/org/globus/cog/abstraction/impl/scheduler/cobalt/QueuePoller.java 2007-02-12 23:55:03 UTC (rev 1575)
@@ -0,0 +1,224 @@
+//----------------------------------------------------------------------
+//This code is developed as part of the Java CoG Kit project
+//The terms of the license can be found at http://www.cogkit.org/license
+//This message may not be removed or altered.
+//----------------------------------------------------------------------
+
+/*
+ * Created on Oct 11, 2005
+ */
+package org.globus.cog.abstraction.impl.scheduler.cobalt;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.log4j.Logger;
+import org.globus.cog.abstraction.impl.scheduler.common.Job;
+
+public class QueuePoller extends Thread {
+ public static final Logger logger = Logger.getLogger(QueuePoller.class);
+
+ private LinkedList newjobs, donejobs;
+ private Map jobs;
+ boolean...
[truncated message content] |
|
From: <ha...@us...> - 2007-08-23 18:52:50
|
Revision: 1710
http://cogkit.svn.sourceforge.net/cogkit/?rev=1710&view=rev
Author: hategan
Date: 2007-08-23 11:52:45 -0700 (Thu, 23 Aug 2007)
Log Message:
-----------
added initial version of dcache provider
Added Paths:
-----------
trunk/current/src/cog/modules/provider-dcache/
trunk/current/src/cog/modules/provider-dcache/CHANGES.txt
trunk/current/src/cog/modules/provider-dcache/build.xml
trunk/current/src/cog/modules/provider-dcache/dependencies.xml
trunk/current/src/cog/modules/provider-dcache/etc/
trunk/current/src/cog/modules/provider-dcache/etc/MANIFEST.MF.head
trunk/current/src/cog/modules/provider-dcache/etc/MANIFEST.MF.tail
trunk/current/src/cog/modules/provider-dcache/etc/log4j.properties.module
trunk/current/src/cog/modules/provider-dcache/etc/provider-dcache.properties
trunk/current/src/cog/modules/provider-dcache/launchers.xml
trunk/current/src/cog/modules/provider-dcache/lib/
trunk/current/src/cog/modules/provider-dcache/meta/
trunk/current/src/cog/modules/provider-dcache/meta/description.txt
trunk/current/src/cog/modules/provider-dcache/project.properties
trunk/current/src/cog/modules/provider-dcache/resources/
trunk/current/src/cog/modules/provider-dcache/resources/cog-provider.properties
trunk/current/src/cog/modules/provider-dcache/src/
trunk/current/src/cog/modules/provider-dcache/src/org/
trunk/current/src/cog/modules/provider-dcache/src/org/globus/
trunk/current/src/cog/modules/provider-dcache/src/org/globus/cog/
trunk/current/src/cog/modules/provider-dcache/src/org/globus/cog/abstraction/
trunk/current/src/cog/modules/provider-dcache/src/org/globus/cog/abstraction/impl/
trunk/current/src/cog/modules/provider-dcache/src/org/globus/cog/abstraction/impl/file/
trunk/current/src/cog/modules/provider-dcache/src/org/globus/cog/abstraction/impl/file/dcache/
trunk/current/src/cog/modules/provider-dcache/src/org/globus/cog/abstraction/impl/file/dcache/FileResourceImpl.java
trunk/current/src/cog/modules/provider-dcache/src/org/globus/cog/abstraction/impl/file/dcache/TaskHandlerImpl.java
Added: trunk/current/src/cog/modules/provider-dcache/CHANGES.txt
===================================================================
--- trunk/current/src/cog/modules/provider-dcache/CHANGES.txt (rev 0)
+++ trunk/current/src/cog/modules/provider-dcache/CHANGES.txt 2007-08-23 18:52:45 UTC (rev 1710)
@@ -0,0 +1,3 @@
+(08/23/07)
+
+*** Initial commit
\ No newline at end of file
Added: trunk/current/src/cog/modules/provider-dcache/build.xml
===================================================================
--- trunk/current/src/cog/modules/provider-dcache/build.xml (rev 0)
+++ trunk/current/src/cog/modules/provider-dcache/build.xml 2007-08-23 18:52:45 UTC (rev 1710)
@@ -0,0 +1,152 @@
+<project name="Java CoG Kit" default="dist" basedir=".">
+
+ <property file="project.properties"/>
+ <property name="cog.dir" value="${basedir}/../../"/>
+ <property name="main.buildfile" value="${cog.dir}/mbuild.xml"/>
+ <property name="dist.dir" value="${cog.dir}/modules/${module.name}/dist/${module.name}-${version}"/>
+ <property name="build.dir" value="${cog.dir}/modules/${module.name}/build"/>
+
+ <!-- _________________________________________________________________ -->
+ <!-- / \ -->
+ <!-- | Help | -->
+ <!-- \_________________________________________________________________/ -->
+
+ <target name="help">
+ <echo>
+ Available targets:
+ help:
+ prints out this help message
+
+ dist:
+ creates a distribution directory of the
+ ${project} ${long.name}
+
+ jar:
+ creates a jar file for the ${project} ${long.name}
+ named ${jar.filename}
+
+ javadoc:
+ creates the documentation
+
+ clean:
+ removes the compiled classes
+
+ distclean:
+ deletes the distribution directory
+
+ all:
+ dist and javadoc
+
+ deploy.webstart:
+ deploys the module as a webstart application
+
+ dist.joint:
+ builds everything into one jar file. Should only
+ be used globally (from all)
+
+ fixeol:
+ change newlines to the unix standard
+ </echo>
+ </target>
+
+
+ <!-- _________________________________________________________________ -->
+ <!-- / \ -->
+ <!-- | Dist | -->
+ <!-- \_________________________________________________________________/ -->
+
+ <target name="dist">
+ <ant antfile="${main.buildfile}" target="dist"/>
+ </target>
+
+
+ <!-- _________________________________________________________________ -->
+ <!-- / \ -->
+ <!-- | Compile | -->
+ <!-- \_________________________________________________________________/ -->
+
+ <target name="compile">
+ <ant antfile="${main.buildfile}" target="compile"/>
+ </target>
+
+ <!-- _________________________________________________________________ -->
+ <!-- / \ -->
+ <!-- | Clean | -->
+ <!-- \_________________________________________________________________/ -->
+
+ <target name="clean">
+ <ant antfile="${main.buildfile}" target="clean"/>
+ </target>
+
+
+ <!-- _________________________________________________________________ -->
+ <!-- / \ -->
+ <!-- | Distclean | -->
+ <!-- \_________________________________________________________________/ -->
+
+ <target name="distclean">
+ <ant antfile="${main.buildfile}" target="distclean"/>
+ </target>
+
+
+ <!-- _________________________________________________________________ -->
+ <!-- / \ -->
+ <!-- | Jar | -->
+ <!-- \_________________________________________________________________/ -->
+
+ <target name="jar">
+ <ant antfile="${main.buildfile}" target="jar"/>
+ </target>
+
+
+ <!-- _________________________________________________________________ -->
+ <!-- / \ -->
+ <!-- | Javadoc | -->
+ <!-- \_________________________________________________________________/ -->
+
+ <target name="javadoc">
+ <ant antfile="${main.buildfile}" target="javadoc"/>
+ </target>
+
+
+
+ <!-- _________________________________________________________________ -->
+ <!-- / \ -->
+ <!-- | PMD | -->
+ <!-- \_________________________________________________________________/ -->
+
+ <target name="pmd">
+ <ant antfile="${main.buildfile}" target="pmd"/>
+ </target>
+
+ <target name="deploy.webstart">
+ <ant antfile="${main.buildfile}" target="deploy.webstart"/>
+ </target>
+
+ <target name="replacelibs">
+ <ant antfile="${main.buildfile}" target="replacelibs"/>
+ </target>
+
+ <target name="webstart.launchers">
+ <ant antfile="${main.buildfile}" target="webstart.launchers"/>
+ </target>
+
+ <target name="dist.joint">
+ <ant antfile="${main.buildfile}" target="dist.all"/>
+ </target>
+
+ <target name="module.package">
+ <ant antfile="${main.buildfile}" target="module.package"/>
+ </target>
+
+ <!-- ================================================ -->
+ <!-- fixeol -->
+ <!-- ================================================ -->
+
+ <target name="fixeol">
+ <ant antfile="${main.buildfile}" target="fixeol"/>
+ </target>
+
+</project>
+
+
Added: trunk/current/src/cog/modules/provider-dcache/dependencies.xml
===================================================================
--- trunk/current/src/cog/modules/provider-dcache/dependencies.xml (rev 0)
+++ trunk/current/src/cog/modules/provider-dcache/dependencies.xml 2007-08-23 18:52:45 UTC (rev 1710)
@@ -0,0 +1,11 @@
+<project name="Project dependencies" default="deps" basedir=".">
+ <!-- project dependencies -->
+ <target name="deps">
+ <ant antfile="${main.buildfile}" target="dep">
+ <property name="module" value="abstraction-common"/>
+ </ant>
+ <ant antfile="${main.buildfile}" target="dep">
+ <property name="module" value="abstraction-local"/>
+ </ant>
+ </target>
+</project>
Added: trunk/current/src/cog/modules/provider-dcache/etc/MANIFEST.MF.head
===================================================================
--- trunk/current/src/cog/modules/provider-dcache/etc/MANIFEST.MF.head (rev 0)
+++ trunk/current/src/cog/modules/provider-dcache/etc/MANIFEST.MF.head 2007-08-23 18:52:45 UTC (rev 1710)
@@ -0,0 +1 @@
+Manifest-Version: 1.0
Added: trunk/current/src/cog/modules/provider-dcache/etc/MANIFEST.MF.tail
===================================================================
--- trunk/current/src/cog/modules/provider-dcache/etc/MANIFEST.MF.tail (rev 0)
+++ trunk/current/src/cog/modules/provider-dcache/etc/MANIFEST.MF.tail 2007-08-23 18:52:45 UTC (rev 1710)
@@ -0,0 +1 @@
+
Added: trunk/current/src/cog/modules/provider-dcache/etc/log4j.properties.module
===================================================================
Added: trunk/current/src/cog/modules/provider-dcache/etc/provider-dcache.properties
===================================================================
--- trunk/current/src/cog/modules/provider-dcache/etc/provider-dcache.properties (rev 0)
+++ trunk/current/src/cog/modules/provider-dcache/etc/provider-dcache.properties 2007-08-23 18:52:45 UTC (rev 1710)
@@ -0,0 +1,11 @@
+#
+# the location of dccp
+#
+
+dccp=dccp
+
+#
+# various command line options to dccp
+#
+
+dccp.options=-v
\ No newline at end of file
Added: trunk/current/src/cog/modules/provider-dcache/launchers.xml
===================================================================
--- trunk/current/src/cog/modules/provider-dcache/launchers.xml (rev 0)
+++ trunk/current/src/cog/modules/provider-dcache/launchers.xml 2007-08-23 18:52:45 UTC (rev 1710)
@@ -0,0 +1,6 @@
+<project name="Launchers" default="create" basedir=".">
+ <target name="create">
+ </target>
+ <target name="webstart">
+ </target>
+</project>
Added: trunk/current/src/cog/modules/provider-dcache/meta/description.txt
===================================================================
--- trunk/current/src/cog/modules/provider-dcache/meta/description.txt (rev 0)
+++ trunk/current/src/cog/modules/provider-dcache/meta/description.txt 2007-08-23 18:52:45 UTC (rev 1710)
@@ -0,0 +1,3 @@
+The provider-dcache module is a component of the abstractions framework.
+It provides the implementation for transfering files to and from dCache
+using dccp.
\ No newline at end of file
Added: trunk/current/src/cog/modules/provider-dcache/project.properties
===================================================================
--- trunk/current/src/cog/modules/provider-dcache/project.properties (rev 0)
+++ trunk/current/src/cog/modules/provider-dcache/project.properties 2007-08-23 18:52:45 UTC (rev 1710)
@@ -0,0 +1,6 @@
+module.name = provider-dcache
+long.name = dCache provider for abstractions
+version = 0.1
+project = Java CoG Kit
+lib.deps = -
+debug = true
Added: trunk/current/src/cog/modules/provider-dcache/resources/cog-provider.properties
===================================================================
--- trunk/current/src/cog/modules/provider-dcache/resources/cog-provider.properties (rev 0)
+++ trunk/current/src/cog/modules/provider-dcache/resources/cog-provider.properties 2007-08-23 18:52:45 UTC (rev 1710)
@@ -0,0 +1,5 @@
+provider=dcache
+sandbox=false
+fileOperationTaskHandler=org.globus.cog.abstraction.impl.file.dcache.TaskHandlerImpl
+securityContext=org.globus.cog.abstraction.impl.common.task.SecurityContextImpl
+fileResource=org.globus.cog.abstraction.impl.file.dcache.FileResourceImpl
Added: trunk/current/src/cog/modules/provider-dcache/src/org/globus/cog/abstraction/impl/file/dcache/FileResourceImpl.java
===================================================================
--- trunk/current/src/cog/modules/provider-dcache/src/org/globus/cog/abstraction/impl/file/dcache/FileResourceImpl.java (rev 0)
+++ trunk/current/src/cog/modules/provider-dcache/src/org/globus/cog/abstraction/impl/file/dcache/FileResourceImpl.java 2007-08-23 18:52:45 UTC (rev 1710)
@@ -0,0 +1,107 @@
+package org.globus.cog.abstraction.impl.file.dcache;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.net.URL;
+import java.util.Properties;
+import java.util.StringTokenizer;
+
+import org.apache.log4j.Logger;
+import org.globus.cog.abstraction.impl.file.FileResourceException;
+import org.globus.cog.abstraction.interfaces.ProgressMonitor;
+
+/**
+ * enables access to local file system through the file resource interface
+ * Supports absolute and relative path names
+ */
+public class FileResourceImpl extends org.globus.cog.abstraction.impl.file.local.FileResourceImpl {
+ public static final Logger logger = Logger.getLogger(FileResourceImpl.class);
+
+ public static final String PROPERTIES = "provider-dcache.properties";
+ public static final String DCCP = "dccp";
+ public static final String OPTIONS = "dccp.options";
+ private static Properties properties;
+
+ protected synchronized static Properties getProperties() {
+ if (properties == null) {
+ properties = new Properties();
+ properties.put(DCCP, "dccp");
+ properties.put(OPTIONS, "-d 1");
+ URL res = FileResourceImpl.class.getClassLoader().getResource(PROPERTIES);
+ if (res != null) {
+ try {
+ properties.load(res.openStream());
+ }
+ catch (IOException e) {
+ logger.warn("Failed to load dcache provider properties", e);
+ }
+ }
+ }
+ return properties;
+ }
+
+ private static String[] dccpCmd;
+
+ protected synchronized static String[] getDCCPCmd() {
+ if (dccpCmd == null) {
+ StringTokenizer st = new StringTokenizer(getProperties().getProperty(OPTIONS));
+ dccpCmd = new String[st.countTokens() + 1];
+ dccpCmd[0] = getProperties().getProperty(DCCP);
+ for (int i = 0; i < dccpCmd.length; i++) {
+ dccpCmd[i + 1] = st.nextToken();
+ }
+ }
+ return dccpCmd;
+ }
+
+ public FileResourceImpl() {
+ this("dcache");
+ }
+
+ public FileResourceImpl(String name) {
+ super(name);
+ }
+
+ public void getFile(String remoteFileName, String localFileName, ProgressMonitor progressMonitor)
+ throws FileResourceException {
+ try {
+ String[] opts = getDCCPCmd();
+ String[] cmd = new String[opts.length + 2];
+ System.arraycopy(opts, 0, cmd, 0, opts.length);
+ cmd[cmd.length - 2] = resolve(remoteFileName).getAbsolutePath();
+ cmd[cmd.length - 1] = resolve(localFileName).getAbsolutePath();
+ Process p = Runtime.getRuntime().exec(cmd);
+ consumeOutput(p);
+ int exitcode = p.waitFor();
+ if (exitcode != 0) {
+ throw new FileResourceException("Failed to copy \"" + remoteFileName + "\" to \""
+ + localFileName + "\". dccp failed with an exit code of " + exitcode);
+ }
+ }
+ catch (FileResourceException e) {
+ throw e;
+ }
+ catch (Exception e) {
+ throw new FileResourceException(e);
+ }
+ }
+
+ private String consumeOutput(Process p) throws IOException {
+ StringBuffer errstr = new StringBuffer();
+ Reader out = new InputStreamReader(p.getInputStream());
+ BufferedReader err = new BufferedReader(new InputStreamReader(p.getErrorStream()));
+
+ while (out.read() != -1) {
+ // keep reading
+ }
+
+ String line = err.readLine();
+ while (line != null) {
+ errstr.append(line);
+ errstr.append('\n');
+ }
+ return errstr.toString();
+ }
+}
Added: trunk/current/src/cog/modules/provider-dcache/src/org/globus/cog/abstraction/impl/file/dcache/TaskHandlerImpl.java
===================================================================
--- trunk/current/src/cog/modules/provider-dcache/src/org/globus/cog/abstraction/impl/file/dcache/TaskHandlerImpl.java (rev 0)
+++ trunk/current/src/cog/modules/provider-dcache/src/org/globus/cog/abstraction/impl/file/dcache/TaskHandlerImpl.java 2007-08-23 18:52:45 UTC (rev 1710)
@@ -0,0 +1,8 @@
+package org.globus.cog.abstraction.impl.file.dcache;
+
+/**
+ * Extends the base class TaskHandlerImpl in org.globus.cog.core.impl.file
+ */
+public class TaskHandlerImpl
+ extends org.globus.cog.abstraction.impl.file.TaskHandlerImpl {
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ha...@us...> - 2008-04-22 14:05:38
|
Revision: 1967
http://cogkit.svn.sourceforge.net/cogkit/?rev=1967&view=rev
Author: hategan
Date: 2008-04-22 07:05:35 -0700 (Tue, 22 Apr 2008)
Log Message:
-----------
added coaster provider
Added Paths:
-----------
trunk/current/src/cog/modules/provider-coaster/
trunk/current/src/cog/modules/provider-coaster/CHANGES.txt
trunk/current/src/cog/modules/provider-coaster/build.xml
trunk/current/src/cog/modules/provider-coaster/dependencies.xml
trunk/current/src/cog/modules/provider-coaster/etc/
trunk/current/src/cog/modules/provider-coaster/etc/MANIFEST.MF.head
trunk/current/src/cog/modules/provider-coaster/etc/MANIFEST.MF.tail
trunk/current/src/cog/modules/provider-coaster/etc/log4j.properties.module
trunk/current/src/cog/modules/provider-coaster/launchers.xml
trunk/current/src/cog/modules/provider-coaster/lib/
trunk/current/src/cog/modules/provider-coaster/lib/index.html
trunk/current/src/cog/modules/provider-coaster/libexec/
trunk/current/src/cog/modules/provider-coaster/libexec/bootstrap.sh
trunk/current/src/cog/modules/provider-coaster/meta/
trunk/current/src/cog/modules/provider-coaster/meta/description.txt
trunk/current/src/cog/modules/provider-coaster/project.properties
trunk/current/src/cog/modules/provider-coaster/resources/
trunk/current/src/cog/modules/provider-coaster/resources/coaster-bootstrap.list
trunk/current/src/cog/modules/provider-coaster/resources/cog-provider.properties
trunk/current/src/cog/modules/provider-coaster/resources/log4j.properties
trunk/current/src/cog/modules/provider-coaster/resources/worker.pl
trunk/current/src/cog/modules/provider-coaster/src/
trunk/current/src/cog/modules/provider-coaster/src/org/
trunk/current/src/cog/modules/provider-coaster/src/org/globus/
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/CoasterRequestManager.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/CoasterService.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/JobStatusCommand.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/LocalTCPService.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/Registering.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/RegistrationCommand.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/SubmitJobHandler.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/VersionCommand.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/AssociatedTask.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/CoasterQueueProcessor.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/CoasterTaskHandler.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/IDGenerator.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/JobQueue.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/LocalQueueProcessor.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/LocalTaskHandler.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/QueueProcessor.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/TCPTest.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/TaskNotifier.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/WallTime.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/Worker.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/WorkerKey.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/WorkerManager.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/WorkerTaskMonitor.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/local/
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/local/JobStatusHandler.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/local/LocalRequestManager.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/local/LocalService.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/local/RegistrationHandler.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/local/UnregisterHandler.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/local/VersionHandler.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/impl/
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/Bootstrap.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/BootstrapService.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/CancelJobCommand.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/CoasterChannelManager.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/Digester.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/JobSubmissionTaskHandler.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/NotificationManager.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/PackageList.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/PortManager.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/ServiceManager.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/SubmitJobCommand.java
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/TaskHandlerImpl.java
Added: trunk/current/src/cog/modules/provider-coaster/CHANGES.txt
===================================================================
Added: trunk/current/src/cog/modules/provider-coaster/build.xml
===================================================================
--- trunk/current/src/cog/modules/provider-coaster/build.xml (rev 0)
+++ trunk/current/src/cog/modules/provider-coaster/build.xml 2008-04-22 14:05:35 UTC (rev 1967)
@@ -0,0 +1,178 @@
+<project name="Java CoG Kit" default="dist" basedir=".">
+
+ <property file="project.properties"/>
+ <property name="cog.dir" value="${basedir}/../../"/>
+ <property name="main.buildfile" value="${cog.dir}/mbuild.xml"/>
+ <property name="dist.dir" value="${cog.dir}/modules/${module.name}/dist/${module.name}-${version}"/>
+ <property name="build.dir" value="${cog.dir}/modules/${module.name}/build"/>
+
+ <!-- _________________________________________________________________ -->
+ <!-- / \ -->
+ <!-- | Help | -->
+ <!-- \_________________________________________________________________/ -->
+
+ <target name="help">
+ <echo>
+ Available targets:
+ help:
+ prints out this help message
+
+ dist:
+ creates a distribution directory of the
+ ${project} ${long.name}
+
+ jar:
+ creates a jar file for the ${project} ${long.name}
+ named ${jar.filename}
+
+ javadoc:
+ creates the documentation
+
+ clean:
+ removes the compiled classes
+
+ distclean:
+ deletes the distribution directory
+
+ all:
+ dist and javadoc
+
+ deploy.webstart:
+ deploys the module as a webstart application
+
+ dist.joint:
+ builds everything into one jar file. Should only
+ be used globally (from all)
+
+ fixeol:
+ change newlines to the unix standard
+ </echo>
+ </target>
+
+
+ <!-- _________________________________________________________________ -->
+ <!-- / \ -->
+ <!-- | Dist | -->
+ <!-- \_________________________________________________________________/ -->
+
+ <target name="dist">
+ <ant antfile="${main.buildfile}" target="dist"/>
+ <ant antfile="${cog.dir}/modules/${module.name}/build.xml" target="bootstrap.jar"/>
+ </target>
+
+
+ <!-- _________________________________________________________________ -->
+ <!-- / \ -->
+ <!-- | Compile | -->
+ <!-- \_________________________________________________________________/ -->
+
+ <target name="compile">
+ <ant antfile="${main.buildfile}" target="compile"/>
+ </target>
+
+ <!-- _________________________________________________________________ -->
+ <!-- / \ -->
+ <!-- | Clean | -->
+ <!-- \_________________________________________________________________/ -->
+
+ <target name="clean">
+ <ant antfile="${main.buildfile}" target="clean"/>
+ </target>
+
+
+ <!-- _________________________________________________________________ -->
+ <!-- / \ -->
+ <!-- | Distclean | -->
+ <!-- \_________________________________________________________________/ -->
+
+ <target name="distclean">
+ <ant antfile="${main.buildfile}" target="distclean"/>
+ </target>
+
+
+ <!-- _________________________________________________________________ -->
+ <!-- / \ -->
+ <!-- | Jar | -->
+ <!-- \_________________________________________________________________/ -->
+
+ <target name="jar">
+ <ant antfile="${main.buildfile}" target="jar"/>
+ </target>
+
+
+ <!-- _________________________________________________________________ -->
+ <!-- / \ -->
+ <!-- | Javadoc | -->
+ <!-- \_________________________________________________________________/ -->
+
+ <target name="javadoc">
+ <ant antfile="${main.buildfile}" target="javadoc"/>
+ </target>
+
+
+
+ <!-- _________________________________________________________________ -->
+ <!-- / \ -->
+ <!-- | PMD | -->
+ <!-- \_________________________________________________________________/ -->
+
+ <target name="pmd">
+ <ant antfile="${main.buildfile}" target="pmd"/>
+ </target>
+
+ <target name="deploy.webstart">
+ <ant antfile="${main.buildfile}" target="deploy.webstart"/>
+ </target>
+
+ <target name="replacelibs">
+ <ant antfile="${main.buildfile}" target="replacelibs"/>
+ </target>
+
+ <target name="webstart.launchers">
+ <ant antfile="${main.buildfile}" target="webstart.launchers"/>
+ </target>
+
+ <target name="dist.joint">
+ <ant antfile="${main.buildfile}" target="dist.all"/>
+ </target>
+
+ <target name="module.package">
+ <ant antfile="${main.buildfile}" target="module.package"/>
+ </target>
+
+ <!-- ================================================ -->
+ <!-- fixeol -->
+ <!-- ================================================ -->
+
+ <target name="fixeol">
+ <ant antfile="${main.buildfile}" target="fixeol"/>
+ </target>
+
+ <target name="bootstrap.jar" depends="package.list">
+ <echo message="[${module.name}]: BOOTSTRAP JAR"/>
+ <mkdir dir="${build.dir}/etc.tmp"/>
+ <concat destfile="${build.dir}/etc.tmp/MANIFEST.MF">
+ <filelist dir="etc" files="MANIFEST.MF.head,MANIFEST.MF.tail"/>
+ </concat>
+ <jar jarfile="${dist.dir}/lib/coaster-bootstrap.jar" manifest="${build.dir}/etc.tmp/MANIFEST.MF" index="true">
+ <fileset dir="${build.dir}" includes="**/*.*" excludes="*.tmp, *.tmp/**, *.tmp/**/*.*"/>
+ </jar>
+ </target>
+
+ <target name="package.list">
+ <echo message="[${module.name}]: PACKAGE LIST"/>
+ <java
+ classpath="${build.dir}"
+ classname="org.globus.cog.abstraction.impl.execution.coaster.PackageList"
+ fork="true" output="${build.dir}/coaster-bootstrap.list" logError="true" failonerror="true">
+
+ <arg value="${dist.dir}/lib"/>
+ </java>
+ <copy file="${build.dir}/coaster-bootstrap.list" tofile="${dist.dir}/lib/coaster-bootstrap.list"/>
+ <copy file="${build.dir}/coaster-bootstrap.list" tofile="${cog.dir}/modules/${module.name}/lib/coaster-bootstrap.list"/>
+ <copy file="${build.dir}/coaster-bootstrap.list" tofile="${cog.dir}/modules/${module.name}/resources/coaster-bootstrap.list"/>
+ </target>
+
+</project>
+
+
Added: trunk/current/src/cog/modules/provider-coaster/dependencies.xml
===================================================================
--- trunk/current/src/cog/modules/provider-coaster/dependencies.xml (rev 0)
+++ trunk/current/src/cog/modules/provider-coaster/dependencies.xml 2008-04-22 14:05:35 UTC (rev 1967)
@@ -0,0 +1,14 @@
+<project name="Project dependencies" default="deps" basedir=".">
+ <!-- project dependencies -->
+ <target name="deps">
+ <ant antfile="${main.buildfile}" target="dep">
+ <property name="module" value="abstraction-common"/>
+ </ant>
+ <ant antfile="${main.buildfile}" target="dep">
+ <property name="module" value="jglobus"/>
+ </ant>
+ <ant antfile="${main.buildfile}" target="dep">
+ <property name="module" value="karajan"/>
+ </ant>
+ </target>
+</project>
Added: trunk/current/src/cog/modules/provider-coaster/etc/MANIFEST.MF.head
===================================================================
--- trunk/current/src/cog/modules/provider-coaster/etc/MANIFEST.MF.head (rev 0)
+++ trunk/current/src/cog/modules/provider-coaster/etc/MANIFEST.MF.head 2008-04-22 14:05:35 UTC (rev 1967)
@@ -0,0 +1 @@
+Manifest-Version: 1.0
Added: trunk/current/src/cog/modules/provider-coaster/etc/MANIFEST.MF.tail
===================================================================
--- trunk/current/src/cog/modules/provider-coaster/etc/MANIFEST.MF.tail (rev 0)
+++ trunk/current/src/cog/modules/provider-coaster/etc/MANIFEST.MF.tail 2008-04-22 14:05:35 UTC (rev 1967)
@@ -0,0 +1 @@
+Main-Class: org.globus.cog.abstraction.impl.execution.coaster.Bootstrap
Added: trunk/current/src/cog/modules/provider-coaster/etc/log4j.properties.module
===================================================================
Added: trunk/current/src/cog/modules/provider-coaster/launchers.xml
===================================================================
--- trunk/current/src/cog/modules/provider-coaster/launchers.xml (rev 0)
+++ trunk/current/src/cog/modules/provider-coaster/launchers.xml 2008-04-22 14:05:35 UTC (rev 1967)
@@ -0,0 +1,6 @@
+<project name="Launchers" default="create" basedir=".">
+ <target name="create">
+ </target>
+ <target name="webstart">
+ </target>
+</project>
Added: trunk/current/src/cog/modules/provider-coaster/lib/index.html
===================================================================
--- trunk/current/src/cog/modules/provider-coaster/lib/index.html (rev 0)
+++ trunk/current/src/cog/modules/provider-coaster/lib/index.html 2008-04-22 14:05:35 UTC (rev 1967)
@@ -0,0 +1,10 @@
+<html>
+ <head>
+ <title>Coaster Bootstrap Service</title>
+ </head>
+ <body>
+ <p>
+ Go away!
+ </p>
+ </body>
+</html>
Added: trunk/current/src/cog/modules/provider-coaster/libexec/bootstrap.sh
===================================================================
--- trunk/current/src/cog/modules/provider-coaster/libexec/bootstrap.sh (rev 0)
+++ trunk/current/src/cog/modules/provider-coaster/libexec/bootstrap.sh 2008-04-22 14:05:35 UTC (rev 1967)
@@ -0,0 +1,45 @@
+BS=$0
+LS=$1
+EMD5=$2
+LMD5=$3
+ID=$4
+H=$5
+L=$6
+error() {
+ echo $1
+ echo $1 >>$L
+ rm -f $DJ
+ exit 1
+}
+if [ "$L" == "" ]; then
+ L=~/coaster-boot-$ID.log
+fi
+DJ=`mktemp bootstrap.XXXXXX`
+echo "BS: $BS" >>$L
+wget -c -q $BS/coaster-bootstrap.jar -O $DJ >>$L 2>&1
+if [ "$?" != "0" ]; then
+ error "Failed to download bootstrap jar from $BS"
+fi
+AMD5=`/usr/bin/md5sum $DJ`
+echo "Expected checksum: $EMD5" >>$L
+echo "Computed checksum: ${AMD5:0:32}" >>$L
+if [ "${AMD5:0:32}" != "$EMD5" ]; then
+ error "Bootstrap jar checksum failed: $EMD5 != ${AMD5:0:32}"
+fi
+
+if [ "$JAVA_HOME" != "" ]; then
+ JAVA=$JAVA_HOME/bin/java
+else
+ JAVA=`which java`
+fi
+echo "JAVA=$JAVA" >>$L
+if [ -x $JAVA ]; then
+ echo "$JAVA -Djava.home="$JAVA_HOME" -DX509_USER_PROXY="$X509_USER_PROXY" -DGLOBUS_HOSTNAME="$H" -jar $DJ $BS $LMD5 $LS $ID" >>$L
+ $JAVA -Djava.home="$JAVA_HOME" -DX509_USER_PROXY="$X509_USER_PROXY" -DGLOBUS_HOSTNAME="$H" -jar $DJ $BS $LMD5 $LS $ID >>$L 2>&1
+ EC=$?
+ echo "Exit code: $EC" >>$L
+ rm -f $DJ
+ exit $EC
+else
+ error "Could not find a valid java executable"
+fi
Added: trunk/current/src/cog/modules/provider-coaster/meta/description.txt
===================================================================
Added: trunk/current/src/cog/modules/provider-coaster/project.properties
===================================================================
--- trunk/current/src/cog/modules/provider-coaster/project.properties (rev 0)
+++ trunk/current/src/cog/modules/provider-coaster/project.properties 2008-04-22 14:05:35 UTC (rev 1967)
@@ -0,0 +1,7 @@
+module.name = provider-coaster
+long.name = Coasters
+version = 0.1
+project = Java CoG Kit
+lib.deps = -
+debug = true
+
Added: trunk/current/src/cog/modules/provider-coaster/resources/coaster-bootstrap.list
===================================================================
--- trunk/current/src/cog/modules/provider-coaster/resources/coaster-bootstrap.list (rev 0)
+++ trunk/current/src/cog/modules/provider-coaster/resources/coaster-bootstrap.list 2008-04-22 14:05:35 UTC (rev 1967)
@@ -0,0 +1,22 @@
+backport-util-concurrent.jar f9c59530e5d6ca38f3ba6c0b6213e016
+cog-abstraction-common-2.2.jar dcc9dc2c0d73f4d9e0c1e62877e4c26a
+cog-jglobus-dev-080222.jar d87a8fb09be6d8011f6492feabce475d
+cog-karajan-0.36-dev.jar 7a2e83affcdc1ecb9bc771d71e4a3181
+cog-provider-coaster-0.1.jar 79a39f5d73aa2d09c59b1106f8eea4cf
+cog-provider-gt2-2.3.jar cb42a53716cfcbdba71321f58ee80337
+cog-provider-gt4_0_0-2.4.jar 48d9507bae0f958d0a8bdfdefbce7582
+cog-provider-local-2.1.jar 9294397d24948bd5dda8759e52e4c22e
+cog-provider-localscheduler-0.2.jar 3a2e8d438d3338cad0afa3e77ebec2cd
+cog-provider-ssh-2.3.jar e798e3e843f45217f555fe6ef17a4345
+cog-util-0.92.jar ad5946aa250148262f1d15474cc34ecc
+commons-logging-1.1.jar 6b62417e77b000a87de66ee3935edbf5
+cryptix-asn1.jar 87c4cf848c81d102bd29e33681b80e8a
+cryptix.jar c3dad86be114c7aaf2ddf32c8e52184a
+cryptix32.jar 59772ad239684bf10ae8fe71f4dbae22
+j2ssh-common-0.2.2.jar d65a51ea6f64efc066915c1618c613ca
+j2ssh-core-0.2.2-patched.jar 9bf1ffb8ab700234649f70ef4a35f029
+jaxrpc.jar 8e7d80b5d77dff6ed2f41352e9147101
+jce-jdk13-131.jar 06fc7049669d16c4001a452e100b401f
+jgss.jar 9cccfd21259791b509af229a0181f207
+log4j-1.2.8.jar 18a4ca847248e5b8606325684342701c
+puretls.jar 90b9c31c201243b9f4a24fa11d404702
Added: trunk/current/src/cog/modules/provider-coaster/resources/cog-provider.properties
===================================================================
--- trunk/current/src/cog/modules/provider-coaster/resources/cog-provider.properties (rev 0)
+++ trunk/current/src/cog/modules/provider-coaster/resources/cog-provider.properties 2008-04-22 14:05:35 UTC (rev 1967)
@@ -0,0 +1,6 @@
+provider=coaster
+sandbox=false
+executionTaskHandler=org.globus.cog.abstraction.impl.execution.local.TaskHandlerImpl
+securityContext=org.globus.cog.abstraction.impl.common.task.SecurityContextImpl
+
+
Added: trunk/current/src/cog/modules/provider-coaster/resources/log4j.properties
===================================================================
--- trunk/current/src/cog/modules/provider-coaster/resources/log4j.properties (rev 0)
+++ trunk/current/src/cog/modules/provider-coaster/resources/log4j.properties 2008-04-22 14:05:35 UTC (rev 1967)
@@ -0,0 +1,19 @@
+# Set root category priority to WARN and its only appender to CONSOLE.
+log4j.rootCategory=WARN, CONSOLE
+
+# A1 is set to be a ConsoleAppender.
+#log4j.appender.DEBUG=org.apache.log4j.ConsoleAppender
+
+# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+#log4j.appender.CONSOLE.Threshold=WARN
+log4j.appender.CONSOLE.layout.ConversionPattern=[%C{1}] %-5p %t %x - %m%n
+#log4j.appender.CONSOLE.layout.ConversionPattern=%-5p [%C{1}] %x - %m%n
+
+
+log4j.logger.org.globus.cog.abstraction=WARN
+log4j.logger.org.apache.axis.utils.JavaUtils=ERROR
+log4j.logger.org.globus.cog.abstraction.impl.execution.coaster.JobSubmissionTaskHandler=INFO
+log4j.logger.org.globus.cog.karajan.workflow.service=DEBUG
+log4j.logger.org.globus.cog.abstraction.coaster=INFO
\ No newline at end of file
Added: trunk/current/src/cog/modules/provider-coaster/resources/worker.pl
===================================================================
--- trunk/current/src/cog/modules/provider-coaster/resources/worker.pl (rev 0)
+++ trunk/current/src/cog/modules/provider-coaster/resources/worker.pl 2008-04-22 14:05:35 UTC (rev 1967)
@@ -0,0 +1,412 @@
+#!/usr/bin/perl
+use IO::Socket;
+use strict;
+use warnings;
+
+
+my $REPLY_FLAG = 0x00000001;
+my $FINAL_FLAG = 0x00000002;
+my $ERROR_FLAG = 0x00000004;
+
+my $COMPLETED = 7;
+my $FAILED = 5;
+my $ACTIVE = 2;
+
+my $TAG = 0;
+my $RETRIES = 3;
+my $REPLYTIMEOUT = 60;
+my $MAXFRAGS = 16;
+
+my $IDLETIMEOUT = 300; #Seconds
+my $LASTRECV = 0;
+
+my $BUFSZ = 2048;
+
+my %REQUESTS = ();
+my %REPLIES = ();
+
+my $LOG = "$ENV{HOME}/worker$ARGV[0].log";
+
+
+my %HANDLERS = (
+ "SHUTDOWN" => \&shutdown,
+ "SUBMITJOB" => \&submitjob,
+ "REGISTER" => \®ister,
+);
+
+my @CMDQ = ();
+
+my $ID=$ARGV[0];
+my $URI=$ARGV[1];
+my $SCHEME;
+my $HOSTNAME;
+my $PORT;
+if ($URI =~ /(.*):\/\//) { $SCHEME = $1; } else { die "Could not parse url scheme: $URI"; }
+if ($URI =~ /.*:\/\/(.*):/) { $HOSTNAME = $1; } else { die "Could not parse url hostname: $URI"; }
+if ($URI =~ /.*:\/\/.*:(.*)/) { $PORT = $1; } else { die "Could not parse url port: $URI"; }
+my $SOCK;
+
+my $JOBID;
+my %JOB;
+my %JOBENV;
+my @JOBARGS;
+
+sub wlog {
+ my $msg;
+ foreach $msg (@_) {
+ print LOG time(), " ", $msg;
+ #print $msg;
+ }
+}
+
+sub init() {
+ my $fail = 0;
+
+ open(LOG, ">$LOG") or die "Failed to open log file: $!";
+ my $b = select(LOG);
+ $| = 1;
+ select($b);
+ print LOG time(), " Logging started\n";
+
+ wlog "uri=$URI, scheme=$SCHEME, host=$HOSTNAME, port=$PORT, id=$ID\n";
+ for ($_ = 0; $_ < 10; $_++) {
+ $SOCK = IO::Socket::INET->new(Proto=>'tcp', PeerAddr=>$HOSTNAME, PeerPort=>$PORT) || ($fail = 1);
+ if (!$fail) {
+ $SOCK->setsockopt(SOL_SOCKET, SO_RCVBUF, 16384);
+ $SOCK->setsockopt(SOL_SOCKET, SO_SNDBUF, 32768);
+ last;
+ }
+ }
+ if ($fail) {
+ die "Failed to create sockets: $!";
+ }
+}
+
+
+sub sendm {
+ my ($tag, $flags, $msg) = @_;
+ my $len = length($msg);
+ my $buf = pack("VVV", $tag, $flags, $len);
+ $buf = $buf.$msg;
+ wlog("> len=$len, tag=$tag, flags=$flags, $msg\n");
+ $SOCK->send($buf) == length($buf) or die "cannot send to $SOCK: $!";
+}
+
+sub sendFrags {
+ my ($tag, $flg, @msgs) = @_;
+
+ for (my $i = 0; $i <= $#msgs; $i++) {
+ sendm($tag, ($i < $#msgs) ? $flg : ($FINAL_FLAG | $flg), $msgs[$i]);
+ }
+}
+
+sub sendCmd {
+ my @cmd = @_;
+ my $cont = shift(@cmd);
+ my $ctag = $TAG++;
+
+ registerCmd($ctag, $cont);
+ sendFrags($ctag, 0, @cmd);
+}
+
+sub sendReply {
+ my ($tag, @msgs) = @_;
+
+ sendFrags($tag, $REPLY_FLAG, @msgs);
+}
+
+sub sendError {
+ my ($tag, @msgs) = @_;
+
+ sendFrags($tag, $REPLY_FLAG | $ERROR_FLAG, @msgs);
+}
+
+sub unpackData {
+ my ($data) = @_;
+
+ my $lendata = length($data);
+ if ($lendata < 12) {
+ die "Received faulty message (length < 12: $lendata)";
+ }
+ my $tag = unpack("V", substr($data, 0, 4));
+ my $flg = unpack("V", substr($data, 4, 4));
+ my $len = unpack("V", substr($data, 8, 4));
+ my $msg;
+ $SOCK->recv($msg, $len);
+
+ wlog("< len=$len, tag=$tag, flags=$flg, $data\n");
+ return ($tag, $flg, $msg);
+}
+
+sub processRequest {
+ my ($tag, $timeout, $err, $request) = @_;
+
+ if ($timeout) {
+ sendError($tag, ("Timed out waiting for all fragments"));
+ }
+ else {
+ wlog "Processing request\n";
+ my $cmd = shift(@$request);
+ wlog "Cmd is $cmd\n";
+ if (exists($HANDLERS{$cmd})) {
+ $HANDLERS{$cmd}->($tag, 0, $request);
+ }
+ else {
+ sendError($tag, ("Unknown command: $cmd"));
+ }
+ }
+}
+
+sub process {
+ my ($tag, $flg, $msg) = @_;
+
+
+ my $reply = $flg & $REPLY_FLAG;
+ my ($record, $cont, $start, $frags);
+
+ if ($reply) {
+ if (exists($REPLIES{$tag})) {
+ $record = $REPLIES{$tag};
+ ($cont, $start, $frags) = ($record->[0], $record->[1], $record->[2]);
+ }
+ else {
+ wlog("Warning: received reply to unregistered command (tag=$tag). Discarding.\n");
+ return;
+ }
+ }
+ else {
+ if (!exists($REQUESTS{$tag})) {
+ $REQUESTS{$tag} = [\&processRequest, time(), []];
+ wlog "New request ($tag)\n";
+ }
+ $record = $REQUESTS{$tag};
+ ($cont, $start, $frags) = ($$record[0], $$record[1], $$record[2]);
+ }
+
+ my $fin = $flg & $FINAL_FLAG;
+ my $err = $flg & $ERROR_FLAG;
+
+ push @$frags, $msg;
+
+ if ($fin) {
+ if ($reply) {
+ delete($REPLIES{$tag});
+ }
+ else {
+ delete($REQUESTS{$tag});
+ }
+ $cont->($tag, 0, $err, $frags);
+ }
+}
+
+sub checkTimeouts2 {
+ my ($hash) = @_;
+
+ my $now = time();
+ my @del = ();
+
+ my $k;
+ my $v;
+
+ while (($k, $v) = each(%$hash)) {
+ if ($now - $$v[1] > $REPLYTIMEOUT) {
+ push(@del, $k);
+ my $cont = $$v[0];
+ $cont->($k, 1, 0, ());
+ }
+ }
+
+ foreach $k (@del) {
+ delete $$hash{$k};
+ }
+}
+
+sub checkTimeouts {
+ checkTimeouts2(\%REQUESTS);
+ checkTimeouts2(\%REPLIES);
+ if ($LASTRECV != 0) {
+ my $dif = time() - $LASTRECV;
+ if ($dif >= $IDLETIMEOUT) {
+ die "Idle time exceeded";
+ }
+ }
+}
+
+sub recvOne {
+ my $data;
+ $SOCK->recv($data, 12);
+ if (length($data) > 0) {
+ wlog "Received $data\n";
+ eval { process(unpackData($data)); } || wlog "$@\n";
+ $LASTRECV = time();
+ }
+ else {
+ #sleep 250ms
+ select(undef, undef, undef, 0.25);
+ checkTimeouts();
+ }
+}
+
+sub registerCmd {
+ my ($tag, $cont) = @_;
+
+ $REPLIES{$tag} = [$cont, time(), ()];
+}
+
+
+sub mainloop {
+ my $cmd;
+ while(1) {
+ foreach $cmd (@CMDQ) {
+ sendCmd(@$cmd);
+ }
+ @CMDQ = ();
+ recvOne();
+ }
+}
+
+sub queueCmd {
+ push @CMDQ, [@_];
+}
+
+sub printreply {
+ my ($tag, $timeout, $err, $reply) = @_;
+ if ($timeout) {
+ wlog "Timed out waiting for reply to $tag\n";
+ }
+ else {
+ wlog "$$reply[0]\n";
+ }
+}
+
+sub nullCB {
+ my ($tag, $timeout, $err, $reply) = @_;
+}
+
+sub registerCB {
+ my ($tag, $timeout, $err, $reply) = @_;
+
+ if ($timeout) {
+ die "Failed to register (timeout)\n";
+ }
+ if ($err) {
+ die "Failed to register (service returned error: ".join("\n", @$reply).")";
+ }
+}
+
+sub register {
+ my ($tag, $timeout, $reply) = @_;
+ sendReply($tag, ("OK"));
+}
+
+
+sub shutdown {
+ my ($tag, $timeout, $msgs) = @_;
+
+ sendReply($tag, ("OK"));
+ wlog "Shutdown command received. Exiting\n";
+ exit 0;
+}
+
+sub submitjob {
+ my ($tag, $timeout, $msgs) = @_;
+ my $desc = $$msgs[0];
+ my @lines = split(/\n/, $desc);
+ my $line;
+ $JOBID = undef;
+ %JOB = ();
+ @JOBARGS = ();
+ %JOBENV = ();
+ foreach $line (@lines) {
+ $line =~ s/\\n/\n/;
+ $line =~ s/\\\\/\\/;
+ my @pair = split(/=/, $line, 2);
+ if ($pair[0] eq "arg") {
+ pu...
[truncated message content] |
|
From: <ha...@us...> - 2008-06-19 19:49:38
|
Revision: 2040
http://cogkit.svn.sourceforge.net/cogkit/?rev=2040&view=rev
Author: hategan
Date: 2008-06-19 12:49:09 -0700 (Thu, 19 Jun 2008)
Log Message:
-----------
added transfer tool module
Added Paths:
-----------
trunk/current/src/cog/modules/transfer-gui/
trunk/current/src/cog/modules/transfer-gui/build.xml
trunk/current/src/cog/modules/transfer-gui/dependencies.xml
trunk/current/src/cog/modules/transfer-gui/etc/
trunk/current/src/cog/modules/transfer-gui/etc/MANIFEST.MF.head
trunk/current/src/cog/modules/transfer-gui/etc/MANIFEST.MF.tail
trunk/current/src/cog/modules/transfer-gui/etc/log4j.properties.module
trunk/current/src/cog/modules/transfer-gui/launchers.xml
trunk/current/src/cog/modules/transfer-gui/lib/
trunk/current/src/cog/modules/transfer-gui/project.properties
trunk/current/src/cog/modules/transfer-gui/src/
trunk/current/src/cog/modules/transfer-gui/src/org/
trunk/current/src/cog/modules/transfer-gui/src/org/globus/
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/BaseRFTClient.java
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/GridFTPGUIAboutBox.java
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/GridFTPGUIApp.java
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/GridFTPGUIView.java
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/RFTButtonActionListener.java
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/RFTClient.java
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/RFTJob.java
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/RFTOptions.java
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/RFTOptionsPanel.java
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/RFTPanel.java
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/RFTTransferFileParser.java
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/RFTTransferParam.java
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/RFTTransferParamPanel.java
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/ReliableFileDeleteClient.java
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/ReliableFileTransferClient.java
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/client-security-config.xml
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/myproxy/
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/myproxy/MyProxyLogon.java
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/myproxy/MyProxyLogonGUI.java
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/GridFTPGUIAboutBox.properties
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/GridFTPGUIApp.properties
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/GridFTPGUIView.properties
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/LocalFileSystemView.properties
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/NewJDialog.properties
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/NewJFrame.properties
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/RFTOptionsPanel.properties
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/RFTPanel.properties
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/RFTTransferParamPanel.properties
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/about-small.png
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/about.png
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/busyicons/
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/busyicons/busy-icon0.png
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/busyicons/busy-icon1.png
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/busyicons/busy-icon10.png
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/busyicons/busy-icon11.png
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/busyicons/busy-icon12.png
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/busyicons/busy-icon13.png
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/busyicons/busy-icon14.png
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/busyicons/busy-icon2.png
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/busyicons/busy-icon3.png
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/busyicons/busy-icon4.png
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/busyicons/busy-icon5.png
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/busyicons/busy-icon6.png
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/busyicons/busy-icon7.png
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/busyicons/busy-icon8.png
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/busyicons/busy-icon9.png
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/busyicons/idle-icon.png
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/rft.png
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/splash.png
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/unlock.png
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/window_globus.png
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/window_new.png
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/window_new_ftp.png
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/resources/window_new_gridftp.png
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/utils/
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/utils/LogFileUtils.java
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/utils/UIConstants.java
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/utils/Utils.java
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/webstart/
trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/webstart/ProgramStarter.java
Added: trunk/current/src/cog/modules/transfer-gui/build.xml
===================================================================
--- trunk/current/src/cog/modules/transfer-gui/build.xml (rev 0)
+++ trunk/current/src/cog/modules/transfer-gui/build.xml 2008-06-19 19:49:09 UTC (rev 2040)
@@ -0,0 +1,167 @@
+<!-- ===================================================================
+ This code is developed as part of the Java CoG Kit project
+ The terms of the license can be found at http://www.cogkit.org/license
+ This message may not be removed or altered.
+==================================================================== -->
+
+<project name="Java CoG Kit" default="dist" basedir=".">
+
+ <property file="project.properties"/>
+ <property name="cog.dir" value="${basedir}/../../"/>
+ <property name="main.buildfile" value="${cog.dir}/mbuild.xml"/>
+ <property name="dist.dir" value="${cog.dir}/modules/${module.name}/dist/${module.name}-${version}"/>
+ <property name="build.dir" value="${cog.dir}/modules/${module.name}/build"/>
+
+ <!-- ================================================ -->
+ <!-- Help -->
+ <!-- ================================================ -->
+
+ <target name="help">
+ <echo>
+ Available targets:
+ help:
+ prints out this help message
+
+ dist:
+ creates a distribution directory of the
+ ${project} ${long.name}
+
+ jar:
+ creates a jar file for the ${project} ${long.name}
+ named ${jar.filename}
+
+ javadoc:
+ creates the documentation
+
+ clean:
+ removes the compiled classes
+
+ distclean:
+ deletes the distribution directory
+
+ all:
+ dist and javadoc
+
+ deploy.webstart:
+ deploys the module as a webstart application
+
+ dist.joint:
+ builds everything into one jar file. Should only
+ be used globally (from all)
+
+ fixeol:
+ change newlines to the unix standard
+ </echo>
+ </target>
+
+
+ <!-- ================================================ -->
+ <!-- Dist -->
+ <!-- ================================================ -->
+
+ <target name="dist">
+ <ant antfile="${main.buildfile}" target="dist"/>
+ </target>
+
+
+ <!-- ================================================ -->
+ <!-- Compile -->
+ <!-- ================================================ -->
+
+ <target name="compile">
+ <ant antfile="${main.buildfile}" target="compile"/>
+ </target>
+
+ <!-- ================================================ -->
+ <!-- Clean -->
+ <!-- ================================================ -->
+
+ <target name="clean">
+ <ant antfile="${main.buildfile}" target="clean"/>
+ </target>
+
+
+ <!-- ================================================ -->
+ <!-- Distclean -->
+ <!-- ================================================ -->
+
+ <target name="distclean">
+ <ant antfile="${main.buildfile}" target="distclean"/>
+ </target>
+
+
+ <!-- ================================================ -->
+ <!-- Jar -->
+ <!-- ================================================ -->
+
+ <target name="jar">
+ <ant antfile="${main.buildfile}" target="jar"/>
+ </target>
+
+
+
+ <!-- ================================================ -->
+ <!-- Javadoc -->
+ <!-- ================================================ -->
+
+ <target name="javadoc">
+ <ant antfile="${main.buildfile}" target="javadoc"/>
+ </target>
+
+
+
+ <!-- ================================================ -->
+ <!-- PMD -->
+ <!-- ================================================ -->
+
+ <target name="pmd">
+ <ant antfile="${main.buildfile}" target="pmd"/>
+ </target>
+
+ <!-- ================================================ -->
+ <!-- deploy.webstart -->
+ <!-- ================================================ -->
+
+ <target name="deploy.webstart">
+ <ant antfile="${main.buildfile}" target="deploy.webstart"/>
+ </target>
+
+ <!-- ================================================ -->
+ <!-- replacelibs -->
+ <!-- ================================================ -->
+
+ <target name="replacelibs">
+ <ant antfile="${main.buildfile}" target="replacelibs"/>
+ </target>
+
+ <!-- ================================================ -->
+ <!-- webstart.launchers -->
+ <!-- ================================================ -->
+
+ <target name="webstart.launchers">
+ <ant antfile="${main.buildfile}" target="webstart.launchers"/>
+ </target>
+
+ <!-- ================================================ -->
+ <!-- dist.joint -->
+ <!-- ================================================ -->
+
+ <target name="dist.joint">
+ <ant antfile="${main.buildfile}" target="dist.all"/>
+ </target>
+ <!-- ================================================ -->
+ <!-- fixeol -->
+ <!-- ================================================ -->
+
+ <target name="fixeol">
+ <ant antfile="${main.buildfile}" target="fixeol"/>
+ </target>
+
+
+ <target name="module.package">
+ <ant antfile="${main.buildfile}" target="module.package"/>
+ </target>
+
+</project>
+
+
Added: trunk/current/src/cog/modules/transfer-gui/dependencies.xml
===================================================================
--- trunk/current/src/cog/modules/transfer-gui/dependencies.xml (rev 0)
+++ trunk/current/src/cog/modules/transfer-gui/dependencies.xml 2008-06-19 19:49:09 UTC (rev 2040)
@@ -0,0 +1,20 @@
+<!-- ===================================================================
+ This code is developed as part of the Java CoG Kit project
+ The terms of the license can be found at http://www.cogkit.org/license
+ This message may not be removed or altered.
+==================================================================== -->
+
+<project name="Project dependencies" default="deps" basedir=".">
+ <!-- project dependencies -->
+ <target name="deps">
+ <ant antfile="${main.buildfile}" target="dep">
+ <property name="module" value="abstraction"/>
+ </ant>
+ <ant antfile="${main.buildfile}" target="dep">
+ <property name="module" value="resources"/>
+ </ant>
+ <ant antfile="${main.buildfile}" target="dep">
+ <property name="module" value="util"/>
+ </ant>
+ </target>
+</project>
Added: trunk/current/src/cog/modules/transfer-gui/etc/MANIFEST.MF.head
===================================================================
--- trunk/current/src/cog/modules/transfer-gui/etc/MANIFEST.MF.head (rev 0)
+++ trunk/current/src/cog/modules/transfer-gui/etc/MANIFEST.MF.head 2008-06-19 19:49:09 UTC (rev 2040)
@@ -0,0 +1 @@
+Manifest-Version: 1.0
Added: trunk/current/src/cog/modules/transfer-gui/etc/MANIFEST.MF.tail
===================================================================
--- trunk/current/src/cog/modules/transfer-gui/etc/MANIFEST.MF.tail (rev 0)
+++ trunk/current/src/cog/modules/transfer-gui/etc/MANIFEST.MF.tail 2008-06-19 19:49:09 UTC (rev 2040)
@@ -0,0 +1 @@
+
Added: trunk/current/src/cog/modules/transfer-gui/etc/log4j.properties.module
===================================================================
--- trunk/current/src/cog/modules/transfer-gui/etc/log4j.properties.module (rev 0)
+++ trunk/current/src/cog/modules/transfer-gui/etc/log4j.properties.module 2008-06-19 19:49:09 UTC (rev 2040)
@@ -0,0 +1 @@
+log4j.logger.org.globus.cog.example=INFO
Added: trunk/current/src/cog/modules/transfer-gui/launchers.xml
===================================================================
--- trunk/current/src/cog/modules/transfer-gui/launchers.xml (rev 0)
+++ trunk/current/src/cog/modules/transfer-gui/launchers.xml 2008-06-19 19:49:09 UTC (rev 2040)
@@ -0,0 +1,30 @@
+<!-- ===================================================================
+ This code is developed as part of the Java CoG Kit project
+ The terms of the license can be found at http://www.cogkit.org/license
+ This message may not be removed or altered.
+==================================================================== -->
+
+<project name="Launchers" default="create" basedir=".">
+ <target name="create">
+ <ant antfile="${main.buildfile}" target="launcher">
+ <property name="launcher-name" value="sample-launcher"/>
+ <property name="class-name" value="org.globus.cog.example.Class"/>
+ </ant>
+ </target>
+ <target name="webstart">
+ <ant antfile="${main.buildfile}" target="webstart.launcher">
+ <property name="launcher-name" value="sample-app"/>
+ <property name="class-name" value="org.globus.cog.example.Class"/>
+ <property name="launcher-description" value="Example Application"/>
+ </ant>
+ <ant antfile="${main.buildfile}" target="webstart.launcher">
+ <property name="launcher-name" value="sample-applet"/>
+ <property name="class-name" value="org.globus.cog.example.Applet"/>
+ <property name="launcher-description" value="Example Application"/>
+ <property name="applet" value="true"/>
+ <property name="width" value="320"/>
+ <property name="height" value="240"/>
+ <property name="applet-params" value="<param name="param1" value="value1"/>"/>
+ </ant>
+ </target>
+</project>
Added: trunk/current/src/cog/modules/transfer-gui/project.properties
===================================================================
--- trunk/current/src/cog/modules/transfer-gui/project.properties (rev 0)
+++ trunk/current/src/cog/modules/transfer-gui/project.properties 2008-06-19 19:49:09 UTC (rev 2040)
@@ -0,0 +1,12 @@
+#===================================================================
+# This code is developed as part of the Java CoG Kit project
+# The terms of the license can be found at http://www.cogkit.org/license
+# This message may not be removed or altered.
+#====================================================================
+#
+module.name = transfer-gui
+long.name = File Transfer Graphical Interface
+version = 0.1
+project = Java CoG Kit
+lib.deps = -
+
Added: trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/BaseRFTClient.java
===================================================================
--- trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/BaseRFTClient.java (rev 0)
+++ trunk/current/src/cog/modules/transfer-gui/src/org/globus/transfer/reliable/client/BaseRFTClient.java 2008-06-19 19:49:09 UTC (rev 2040)
@@ -0,0 +1,414 @@
+/*
+ * Portions of this file Copyright 1999-2005 University of Chicago
+ * Portions of this file Copyright 1999-2005 The University of Southern California.
+ *
+ * This file or a portion of this file is licensed under the
+ * terms of the Globus Toolkit Public License, found at
+ * http://www.globus.org/toolkit/download/license.html.
+ * If you redistribute this file, with or without
+ * modifications, you must include this notice in the file.
+ */
+package org.globus.transfer.reliable.client;
+
+import java.net.URL;
+import java.security.cert.X509Certificate;
+import java.util.Calendar;
+import java.util.List;
+import java.util.Vector;
+import java.util.Map;
+import java.util.HashMap;
+
+import javax.xml.rpc.Stub;
+
+import org.globus.axis.util.Util;
+
+import org.apache.axis.message.addressing.EndpointReferenceType;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.globus.delegation.DelegationConstants;
+import org.globus.delegation.DelegationUtil;
+import org.globus.gsi.GlobusCredential;
+import org.globus.wsrf.impl.security.util.AuthUtil;
+import org.globus.ogsa.impl.security.authorization.SelfAuthorization;
+import org.globus.rft.generated.BaseRequestType;
+import org.globus.rft.generated.CreateReliableFileTransferInputType;
+import org.globus.rft.generated.CreateReliableFileTransferOutputType;
+import org.globus.rft.generated.DeleteRequestType;
+import org.globus.rft.generated.OverallStatus;
+import org.globus.rft.generated.RFTFaultResourcePropertyType;
+import org.globus.rft.generated.ReliableFileTransferFactoryPortType;
+import org.globus.rft.generated.ReliableFileTransferPortType;
+import org.globus.rft.generated.TransferRequestType;
+import org.globus.rft.generated.service.ReliableFileTransferFactoryServiceAddressingLocator;
+import org.globus.rft.generated.service.ReliableFileTransferServiceAddressingLocator;
+import org.globus.transfer.reliable.client.utils.LogFileUtils;
+import org.globus.transfer.reliable.service.RFTConstants;
+
+import org.globus.wsrf.container.ServiceContainer;
+import org.globus.wsrf.NotificationConsumerManager;
+import org.globus.wsrf.NotifyCallback;
+import org.globus.wsrf.WSNConstants;
+import org.globus.wsrf.client.BaseClient;
+import org.globus.wsrf.core.notification.ResourcePropertyValueChangeNotificationElementType;
+import org.globus.wsrf.impl.security.authorization.Authorization;
+import org.globus.wsrf.impl.security.authorization.HostAuthorization;
+import org.globus.wsrf.impl.security.authorization.ResourcePDPConfig;
+import org.globus.wsrf.impl.security.authorization.ServiceAuthorizationChain;
+import org.globus.wsrf.impl.security.descriptor.GSISecureMsgAuthMethod;
+import org.globus.wsrf.impl.security.descriptor.GSISecureConvAuthMethod;
+import org.globus.wsrf.impl.security.descriptor.GSITransportAuthMethod;
+import org.globus.wsrf.impl.security.descriptor.ResourceSecurityDescriptor;
+import org.globus.wsrf.impl.security.descriptor.ClientSecurityDescriptor;
+import org.globus.wsrf.security.Constants;
+import org.globus.wsrf.utils.AddressingUtils;
+import org.oasis.wsn.Subscribe;
+import org.oasis.wsn.TopicExpressionType;
+import org.oasis.wsrf.faults.BaseFaultType;
+import org.oasis.wsrf.properties.ResourcePropertyValueChangeNotificationType;
+
+/**
+ * BaseClient for RFT service
+ */
+public class BaseRFTClient extends BaseClient implements NotifyCallback {
+ private static Log logger = LogFactory.getLog(BaseRFTClient.class);
+ public static ReliableFileTransferServiceAddressingLocator rftLocator =
+ new ReliableFileTransferServiceAddressingLocator();
+
+ static final String SERVICE_URL_ROOT = "/wsrf/services/";
+
+ public static ReliableFileTransferFactoryServiceAddressingLocator
+ rftFactoryLocator =
+ new ReliableFileTransferFactoryServiceAddressingLocator();
+
+ private static ReliableFileTransferFactoryPortType factoryPort;
+
+ private static NotificationConsumerManager consumer = null;
+
+ public static int transferCount = 0;
+
+ public static int finished = 0;
+
+ public static int failed = 0;
+
+
+ public static URL endpoint = null;
+
+ public static String HOST = "127.0.0.1";
+
+ public static String PORT = null;
+
+ public static String PROTOCOL = "http";
+
+ public static int TERM_TIME = 60;
+
+ public static String PATH_TO_FILE = null;
+
+ public static String AUTHZ = "host";
+
+ public static String cmd[];
+
+ public static String outFileName = null;
+
+ public static Object authType = Constants.GSI_TRANSPORT;
+
+ public static Object authVal = Constants.SIGNATURE;
+
+ public static Authorization authzVal = HostAuthorization.getInstance();
+
+ public static String optionString =
+ "rft [options] -f <path to transfers file>\n"
+ + "Where options can be:\n"
+ + "-h <hostname or ip-address of container> Defaults to 'localhost'.\n"
+ + "-r <port on which container is listening> Defaults to TCP port 8443.\n"
+ + "-l lifetime of the created resource in minutes Defaults to 60 mins.\n"
+ + "-m security mechanism Allowed values: 'msg' for secure messages, 'conv' for\n"
+ + " secure conversation and 'trans' for secure transport. Defaults to \n"
+ + " 'trans'.\n"
+ + " -p protection type Allowed values: 'sig' for signature and 'enc' for encryption.\n"
+ + " Defaults to 'sig'.\n"
+ + " -z authorization Defaults to 'host' authorization. Allowed values: 'self' for\n"
+ + " self authorization and 'host' for host authorization.\n"
+ + " -file filename to write EPR of created Reliable"
+ + " File Transfer Resource\n";
+
+ static {
+ Util.registerTransport();
+ }
+
+
+ public BaseRFTClient() {
+ super();
+ }
+
+ public static void parseArgs() {
+ for(int i =0; i< cmd.length; i++) {
+ if ((cmd[i].equals("--help")) || (cmd[i].equals("-help"))) {
+ System.out.println( optionString );
+ System.exit(0);
+ } else if(cmd[i].equals("-h")) {
+ HOST = getValue(i);
+ i++;
+ } else if(cmd[i].equals("-r")) {
+ PORT = getValue(i);
+ i++;
+ } else if(cmd[i].equals("-l")) {
+ TERM_TIME = Integer.parseInt(getValue(i));
+ i++;
+ } else if(cmd[i].equals("-z")) {
+ AUTHZ = getValue(i);
+ authzVal = AuthUtil.getClientAuthorization(AUTHZ);
+ i++;
+ } else if(cmd[i].equals("-m")) {
+ String secType = getValue(i);
+ if (secType.equals("msg")) {
+ authType = Constants.GSI_SEC_MSG;
+ } else if (secType.equals("conv")) {
+ authType = Constants.GSI_SEC_CONV;
+ } else if(secType.equals("trans")) {
+ authType = Constants.GSI_TRANSPORT;
+ }
+ } else if (cmd[i].equals("-p")) {
+ String prot = getValue(i);
+ if (prot.equals("sig")) {
+ authVal = Constants.SIGNATURE;
+ } else if(prot.equals("enc")) {
+ authVal = Constants.ENCRYPTION;
+ }
+ } else if (cmd[i].equals("-file")) {
+ outFileName = getValue(i);
+ } else if (cmd[i].equals("-f")) {
+ PATH_TO_FILE = getValue(i);
+ }
+ }
+ if (PATH_TO_FILE == null) {
+ printUsage();
+ System.exit(-1);
+ }
+ }
+ protected static String getValue(int i) {
+ if (i + 1 > cmd.length) {
+ System.err.println(cmd[i] + " needs a argument");
+ System.exit(-1);
+ }
+ return cmd[i+1];
+ }
+
+ /**
+ * @param request
+ * @return rft epr
+ * @exception Exception
+ */
+ public static EndpointReferenceType createRFT(String rftFactoryAddress,
+ BaseRequestType request)
+ throws Exception {
+ endpoint = new URL(rftFactoryAddress);
+ factoryPort = rftFactoryLocator
+ .getReliableFileTransferFactoryPortTypePort(endpoint);
+ CreateReliableFileTransferInputType input =
+ new CreateReliableFileTransferInputType();
+ //input.setTransferJob(transferType);
+ if(request instanceof TransferRequestType) {
+ input.setTransferRequest((TransferRequestType)request);
+ } else {
+ input.setDeleteRequest((DeleteRequestType)request);
+ }
+ Calendar termTime = Calendar.getInstance();
+ termTime.add(Calendar.HOUR, 1);
+ input.setInitialTerminationTime(termTime);
+ setSecurity((Stub)factoryPort);
+ CreateReliableFileTransferOutputType response = factoryPort
+ .createReliableFileTransfer(input);
+
+ return response.getReliableTransferEPR();
+ }
+ /**
+ * Prints the usage
+ */
+ public static void printUsage() {
+ System.out.println(optionString);
+ }
+ /**
+ *
+ * @param topicPath
+ * @param producer
+ * @param message
+ */
+ public void deliver(List topicPath, EndpointReferenceType producer,
+ Object message) {
+ ResourcePropertyValueChangeNotificationType changeMessage =
+ ((ResourcePropertyValueChangeNotificationElementType) message)
+ .getResourcePropertyValueChangeNotification();
+ BaseFaultType fault = null;
+ try {
+
+ if (changeMessage != null) {
+
+ OverallStatus overallStatus = (OverallStatus) changeMessage
+ .getNewValue().get_any()[0].getValueAsType(
+ RFTConstants.OVERALL_STATUS_RESOURCE,
+ OverallStatus.class);
+ System.out.println("\n Overall status of transfer:");
+ System.out.println("Finished/Active/Failed/Retrying/Pending");
+ System.out.print(overallStatus.getTransfersFinished() + "/");
+ System.out.print(overallStatus.getTransfersActive() + "/");
+ System.out.print(overallStatus.getTransfersFailed() + "/");
+ System.out.print(overallStatus.getTransfersRestarted() + "/");
+ System.out.println(overallStatus.getTransfersPending());
+ if ( finished < overallStatus.getTransfersFinished()) {
+ finished = overallStatus.getTransfersFinished();
+ }
+ if (failed < overallStatus.getTransfersFailed()) {
+ failed = overallStatus.getTransfersFailed();
+ }
+ transferCount = overallStatus.getTransfersFinished() + overallStatus.getTransfersActive()
+ + overallStatus.getTransfersFailed() + over...
[truncated message content] |