org.gcube.common.vremanagement.deployer.impl.operators.common
Class BaseScheduler

java.lang.Object
  extended by org.gcube.common.vremanagement.deployer.impl.operators.common.BaseScheduler
All Implemented Interfaces:
Scheduler
Direct Known Subclasses:
InstallScheduler, RebootScheduler, UninstallScheduler

public abstract class BaseScheduler
extends Object
implements Scheduler

Base scheduler implementation

Author:
Manuele Simi (ISTI-CNR)

Field Summary
protected  org.gcube.common.core.utils.logging.GCUBELog logger
           
protected  Map<KeyData,Set<File>> scripts
           
 
Constructor Summary
BaseScheduler()
           
 
Method Summary
 void add(BasePackage target)
          Adds the scripts belonging to the given package to the scheduler.
 Object clone()
          Overrides the Object.clone() method to avoid the Scheduler cloning
protected abstract  List<String> getScriptsToSchedule(BasePackage target)
          Extracts the scripts to schedule from the given package
 void remove(BasePackage target)
          Removes all the scripts of the given package from the scheduler
 void run(KeyData key)
          Executes all the scripts stored in the Scheduler for the given package
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.gcube.common.core.utils.logging.GCUBELog logger

scripts

protected Map<KeyData,Set<File>> scripts
Constructor Detail

BaseScheduler

public BaseScheduler()
Method Detail

add

public void add(BasePackage target)
         throws DeployException
Adds the scripts belonging to the given package to the scheduler.

Specified by:
add in interface Scheduler
Parameters:
target - the package
Throws:
DeployException - if the methods fails when adding the script

remove

public void remove(BasePackage target)
            throws DeployException
Removes all the scripts of the given package from the scheduler

Specified by:
remove in interface Scheduler
Parameters:
target - the package
Throws:
DeployException - if the methods fails when removing all the scripts

run

public void run(KeyData key)
         throws DeployException
Executes all the scripts stored in the Scheduler for the given package

Specified by:
run in interface Scheduler
Parameters:
key - the package key
Throws:
DeployException - if one of the scripts fails

getScriptsToSchedule

protected abstract List<String> getScriptsToSchedule(BasePackage target)
Extracts the scripts to schedule from the given package

Parameters:
target - the package
Returns:
the scripts to schedule

clone

public Object clone()
             throws CloneNotSupportedException
Overrides the Object.clone() method to avoid the Scheduler cloning

Overrides:
clone in class Object
Returns:
the cloned object
Throws:
CloneNotSupportedException - always thrown


Copyright © 2012. All Rights Reserved.