com.googlecode.lightest.core
Class InteractiveTaskDispatchStrategy

java.lang.Object
  extended by com.googlecode.lightest.core.InteractiveTaskDispatchStrategy
All Implemented Interfaces:
IInterruptibleTaskDispatchStrategy, ITaskDispatchStrategy, groovy.lang.GroovyObject

public class InteractiveTaskDispatchStrategy
extends Object
implements groovy.lang.GroovyObject, IInterruptibleTaskDispatchStrategy


Field Summary
static String HELP_MESSAGE
           
static int MODE_CRAWL
           
static int MODE_FLY
           
static int MODE_RUN
           
static int MODE_WALK
           
 
Constructor Summary
InteractiveTaskDispatchStrategy()
           
InteractiveTaskDispatchStrategy(InputStream _in, PrintStream out)
           
 
Method Summary
 ITaskResult dispatch(ITask task)
          Dispatches the task.
 boolean getInterruptible()
           
 groovy.lang.MetaClass getMetaClass()
           
 int getMode()
           
 Object getProperty(String name)
           
 void interrupt()
          A directive to indicating interactive execution of tasks should be allowed as soon as possible.
 Object invokeMethod(String name, Object args)
           
 boolean isInterruptible()
          Returns whether interrupt() is allowed to be called on this strategy.
 void setIn(InputStream _in)
           
 void setInterruptible(boolean value)
          Sets whether interrupt() is allowed to be called on this strategy.
 void setMetaClass(groovy.lang.MetaClass metaClass)
           
 void setMode(int value)
           
 void setOut(PrintStream out)
           
 void setProperty(String name, Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODE_FLY

public static final int MODE_FLY
See Also:
Constant Field Values

MODE_RUN

public static final int MODE_RUN
See Also:
Constant Field Values

MODE_WALK

public static final int MODE_WALK
See Also:
Constant Field Values

MODE_CRAWL

public static final int MODE_CRAWL
See Also:
Constant Field Values

HELP_MESSAGE

public static final String HELP_MESSAGE
Constructor Detail

InteractiveTaskDispatchStrategy

public InteractiveTaskDispatchStrategy()

InteractiveTaskDispatchStrategy

public InteractiveTaskDispatchStrategy(InputStream _in,
                                       PrintStream out)
Parameters:
_in - the input stream to read when in interactive mode
out - the output stream to write messages to the interactive user
Method Detail

getMode

public int getMode()

setMode

public void setMode(int value)

getInterruptible

public boolean getInterruptible()

isInterruptible

public boolean isInterruptible()
Description copied from interface: IInterruptibleTaskDispatchStrategy
Returns whether interrupt() is allowed to be called on this strategy.

Specified by:
isInterruptible in interface IInterruptibleTaskDispatchStrategy

setInterruptible

public void setInterruptible(boolean value)
Description copied from interface: IInterruptibleTaskDispatchStrategy
Sets whether interrupt() is allowed to be called on this strategy.

Specified by:
setInterruptible in interface IInterruptibleTaskDispatchStrategy

setIn

public void setIn(InputStream _in)

setOut

public void setOut(PrintStream out)

interrupt

public void interrupt()
A directive to indicating interactive execution of tasks should be allowed as soon as possible. This is typically invoked as a response to user input.

Specified by:
interrupt in interface IInterruptibleTaskDispatchStrategy

dispatch

public ITaskResult dispatch(ITask task)
Dispatches the task. If in interactive mode, the user can manage the performing of the task, allowing dynamic task retry, for example. If the task is a breakpoint task, interactive mode may be automatically entered.

Specified by:
dispatch in interface ITaskDispatchStrategy
Parameters:
task -

getMetaClass

public groovy.lang.MetaClass getMetaClass()
Specified by:
getMetaClass in interface groovy.lang.GroovyObject

setMetaClass

public void setMetaClass(groovy.lang.MetaClass metaClass)
Specified by:
setMetaClass in interface groovy.lang.GroovyObject

invokeMethod

public Object invokeMethod(String name,
                           Object args)
Specified by:
invokeMethod in interface groovy.lang.GroovyObject

getProperty

public Object getProperty(String name)
Specified by:
getProperty in interface groovy.lang.GroovyObject

setProperty

public void setProperty(String name,
                        Object value)
Specified by:
setProperty in interface groovy.lang.GroovyObject


Copyright © 2009. All Rights Reserved.