org.icenigrid.gridsam.core.plugin.connector.condor
Class ShellBasedCondorDRMConnectorManager

java.lang.Object
  extended byorg.icenigrid.gridsam.core.plugin.connector.common.AbstractDRMConnectorManager
      extended byorg.icenigrid.gridsam.core.plugin.connector.condor.ShellBasedCondorDRMConnectorManager
All Implemented Interfaces:
DRMConnectorManager, EventListener, RegistryShutdownListener

public class ShellBasedCondorDRMConnectorManager
extends AbstractDRMConnectorManager
implements RegistryShutdownListener

DRMConnectorManager implementation for the shell-based condor integration


Constructor Summary
ShellBasedCondorDRMConnectorManager()
          default constructor
 
Method Summary
 void addCondorEventListener(CondorEventListener pListener)
          add a CondorEventListener
 List getCondorEventListeners()
          get the condor event listeners
 String getCondorLogFile()
          get the condor log file
 String getCondorRmCommand()
          get the condor_rm command
 DRMConnector getDRMConnector()
          return a DRMConnector instance based on the configuration
 Shell getShell()
          get the shell to use to for launching job
 String getTailCommand()
          get the condor log file
 boolean hasShell()
          test if a shell has been associated with this stage
 void initialise(JobManagerContext pContext)
          called by the Job Manager to initialise this DRMConnectorBuilder
 void registryDidShutdown()
          handle shutdown
 void removeCondorEventListener(CondorEventListener pListener)
          remove a condor event listener
 void setCondorLogFile(String pFile)
          set condor log file location
 void setCondorRmCommand(String pFile)
          set the condor_rm command
 void setShell(Shell pShell)
          set the shell to use
 void setTailCommand(String pFile)
          set condor log file location
 void terminate(JobContext pJobContext)
          called by the Job Manager to terminate the job previously handled by this DRMConnectorManager
 
Methods inherited from class org.icenigrid.gridsam.core.plugin.connector.common.AbstractDRMConnectorManager
getJobManagerContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShellBasedCondorDRMConnectorManager

public ShellBasedCondorDRMConnectorManager()
default constructor

Method Detail

terminate

public void terminate(JobContext pJobContext)
               throws ControlException
called by the Job Manager to terminate the job previously handled by this DRMConnectorManager

Specified by:
terminate in interface DRMConnectorManager
Overrides:
terminate in class AbstractDRMConnectorManager
Parameters:
pJobContext - the job
Throws:
ControlException - the job cannot be terminated

setCondorLogFile

public void setCondorLogFile(String pFile)
set condor log file location

Parameters:
pFile - the log file

getCondorLogFile

public String getCondorLogFile()
get the condor log file

Returns:
String the spooling directory

setTailCommand

public void setTailCommand(String pFile)
set condor log file location

Parameters:
pFile - the log file

getTailCommand

public String getTailCommand()
get the condor log file

Returns:
String the spooling directory

setCondorRmCommand

public void setCondorRmCommand(String pFile)
set the condor_rm command

Parameters:
pFile - the log file

getCondorRmCommand

public String getCondorRmCommand()
get the condor_rm command

Returns:
String the path to the condor_rm command

setShell

public void setShell(Shell pShell)
set the shell to use

Parameters:
pShell - the shell for launching job

getShell

public Shell getShell()
get the shell to use to for launching job

Returns:
Shell the shell to launch job

hasShell

public boolean hasShell()
test if a shell has been associated with this stage

Returns:
true if a shell has been set, false otherwise

addCondorEventListener

public void addCondorEventListener(CondorEventListener pListener)
add a CondorEventListener

Parameters:
pListener - the listener

removeCondorEventListener

public void removeCondorEventListener(CondorEventListener pListener)
remove a condor event listener

Parameters:
pListener - the listener to be removed

getCondorEventListeners

public List getCondorEventListeners()
get the condor event listeners

Returns:
List of CondorEventListener

initialise

public void initialise(JobManagerContext pContext)
                throws ConfigurationException
called by the Job Manager to initialise this DRMConnectorBuilder

Specified by:
initialise in interface DRMConnectorManager
Overrides:
initialise in class AbstractDRMConnectorManager
Parameters:
pContext - object for the DRMConnectorBuilder to interact with the Job Manager
Throws:
ConfigurationException - to indicate the context contains missing configuration information for this builder to function

registryDidShutdown

public void registryDidShutdown()
handle shutdown

Specified by:
registryDidShutdown in interface RegistryShutdownListener

getDRMConnector

public DRMConnector getDRMConnector()
                             throws ConfigurationException
return a DRMConnector instance based on the configuration

Specified by:
getDRMConnector in interface DRMConnectorManager
Returns:
DRMConnector instance that can be used for launching job
Throws:
ConfigurationException - if the instance cannot be built