org.gridbus.broker.farming.common.dispatchers
Class LocalDispatcher

java.lang.Object
  extended by org.gridbus.broker.farming.common.dispatchers.LocalDispatcher
All Implemented Interfaces:
java.io.Serializable, Dispatcher

public class LocalDispatcher
extends java.lang.Object
implements Dispatcher

Author:
mtc
See Also:
Serialized Form

Constructor Summary
LocalDispatcher(java.lang.String stagingDir, java.lang.String workingDir)
           
 
Method Summary
 boolean detectFile(java.lang.String filename, int timeoutMillis)
          Detects the existence of the remote file.
 java.io.InputStream executeAndGetResult(java.lang.String cmd)
           
 void executeCmd(java.lang.String cmd)
           
static Dispatcher getDefaultDispatcher(java.lang.Object config)
           
 java.lang.String getDispatcherType()
           
 java.lang.String getInputPath()
           
 java.lang.String getStagingDir()
           
 void shutdown()
           
 void stageIn(java.lang.String src, java.lang.String dest)
           
 void stageInData(java.lang.String src, java.lang.String dest)
           
 void stageOut(java.lang.String src, java.lang.String dest)
           
 void stageOutData(java.lang.String src, java.lang.String dest)
           
 java.lang.Object submit(java.lang.String scriptFileName)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalDispatcher

public LocalDispatcher(java.lang.String stagingDir,
                       java.lang.String workingDir)
Parameters:
stagingDir -
workingDir -
Method Detail

submit

public java.lang.Object submit(java.lang.String scriptFileName)
                        throws java.lang.Exception
Parameters:
scriptFileName -
Returns:
Throws:
java.lang.Exception

stageIn

public void stageIn(java.lang.String src,
                    java.lang.String dest)
             throws java.lang.Exception
Specified by:
stageIn in interface Dispatcher
Parameters:
src - -- local file path
dest - -- remote file path
Throws:
java.lang.Exception
See Also:
Dispatcher.stageIn(java.lang.String, java.lang.String)

stageOut

public void stageOut(java.lang.String src,
                     java.lang.String dest)
              throws java.lang.Exception
Specified by:
stageOut in interface Dispatcher
Parameters:
src - -- remote file path
dest - -- local file path
Throws:
java.lang.Exception
See Also:
Dispatcher.stageOut(java.lang.String, java.lang.String)

executeCmd

public void executeCmd(java.lang.String cmd)
                throws java.lang.Exception
Specified by:
executeCmd in interface Dispatcher
Throws:
java.lang.Exception

executeAndGetResult

public java.io.InputStream executeAndGetResult(java.lang.String cmd)
                                        throws java.lang.Exception
Specified by:
executeAndGetResult in interface Dispatcher
Returns:
Throws:
java.lang.Exception
See Also:
Dispatcher.executeCmd(java.lang.String)

getInputPath

public java.lang.String getInputPath()
Specified by:
getInputPath in interface Dispatcher
Returns:
See Also:
Dispatcher.getInputPath()

getStagingDir

public java.lang.String getStagingDir()
Specified by:
getStagingDir in interface Dispatcher
Returns:
See Also:
Dispatcher.getStagingDir()

getDefaultDispatcher

public static Dispatcher getDefaultDispatcher(java.lang.Object config)
Parameters:
config -
Returns:

getDispatcherType

public java.lang.String getDispatcherType()
Specified by:
getDispatcherType in interface Dispatcher
Returns:
See Also:
Dispatcher.getDispatcherType()

stageInData

public void stageInData(java.lang.String src,
                        java.lang.String dest)
                 throws java.lang.Exception
Specified by:
stageInData in interface Dispatcher
Throws:
java.lang.Exception
See Also:
Dispatcher.stageInData(java.lang.String, java.lang.String)

stageOutData

public void stageOutData(java.lang.String src,
                         java.lang.String dest)
                  throws java.lang.Exception
Specified by:
stageOutData in interface Dispatcher
Throws:
java.lang.Exception
See Also:
Dispatcher.stageOutData(java.lang.String, java.lang.String)

shutdown

public void shutdown()
Specified by:
shutdown in interface Dispatcher
See Also:
Dispatcher.shutdown()

detectFile

public boolean detectFile(java.lang.String filename,
                          int timeoutMillis)
Detects the existence of the remote file. Returns true, if the file exists, false otherwise.

Specified by:
detectFile in interface Dispatcher
Parameters:
filename -
timeoutMillis -
Returns: