com.dtolabs.rundeck.core.execution.dispatch
Class ParallelNodeDispatcher

java.lang.Object
  extended by com.dtolabs.rundeck.core.execution.dispatch.ParallelNodeDispatcher
All Implemented Interfaces:
NodeDispatcher

public class ParallelNodeDispatcher
extends java.lang.Object
implements NodeDispatcher

MultiNodeExecutor is ...


Nested Class Summary
static class ParallelNodeDispatcher.SetThreadLocalTask
          Task to set a threadlocal value given a refid.
 
Field Summary
static java.lang.String NODE_NAME_LOCAL_REF_ID
           
static java.lang.String NODE_USER_LOCAL_REF_ID
           
static java.lang.String STATUS_LISTENER_REF_ID
           
 
Constructor Summary
ParallelNodeDispatcher(Framework framework)
           
 
Method Summary
static void addNodeContextSuccessReport(INodeEntry nodeentry, org.apache.tools.ant.Project project, org.apache.tools.ant.taskdefs.Sequential seq)
          Add internal success notification to inform parallel node dispatcher that execution was successful on this node.
static void addNodeContextTasks(INodeEntry nodeentry, org.apache.tools.ant.Project project, org.apache.tools.ant.taskdefs.Sequential seq)
          Add tasks to the Sequential to set threadlocal values for the node name and username
static void configureNodeContextThreadLocalsForProject(org.apache.tools.ant.Project project)
          Adds InheritableNodeLocal references to the Project for use by the node context tasks
 DispatcherResult dispatch(StepExecutionContext context, Dispatchable item)
           
 DispatcherResult dispatch(StepExecutionContext context, NodeStepExecutionItem item)
          XXX: perhaps remove this in lieu of other interface
 DispatcherResult dispatch(StepExecutionContext context, NodeStepExecutionItem item, Dispatchable toDispatch)
           
static java.lang.String getThreadLocalForProject(java.lang.String nodeNameLocalRefId, org.apache.tools.ant.Project project)
          Extract the threadlocal stored as a reference in the project, and return the string value or null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATUS_LISTENER_REF_ID

public static final java.lang.String STATUS_LISTENER_REF_ID

NODE_NAME_LOCAL_REF_ID

public static final java.lang.String NODE_NAME_LOCAL_REF_ID

NODE_USER_LOCAL_REF_ID

public static final java.lang.String NODE_USER_LOCAL_REF_ID
Constructor Detail

ParallelNodeDispatcher

public ParallelNodeDispatcher(Framework framework)
Method Detail

dispatch

public DispatcherResult dispatch(StepExecutionContext context,
                                 NodeStepExecutionItem item)
                          throws DispatcherException
Description copied from interface: NodeDispatcher
XXX: perhaps remove this in lieu of other interface

Specified by:
dispatch in interface NodeDispatcher
Throws:
DispatcherException

dispatch

public DispatcherResult dispatch(StepExecutionContext context,
                                 Dispatchable item)
                          throws DispatcherException
Specified by:
dispatch in interface NodeDispatcher
Throws:
DispatcherException

dispatch

public DispatcherResult dispatch(StepExecutionContext context,
                                 NodeStepExecutionItem item,
                                 Dispatchable toDispatch)
                          throws DispatcherException
Throws:
DispatcherException

configureNodeContextThreadLocalsForProject

public static void configureNodeContextThreadLocalsForProject(org.apache.tools.ant.Project project)
Adds InheritableNodeLocal references to the Project for use by the node context tasks

Parameters:
project - the project

getThreadLocalForProject

public static java.lang.String getThreadLocalForProject(java.lang.String nodeNameLocalRefId,
                                                        org.apache.tools.ant.Project project)
Extract the threadlocal stored as a reference in the project, and return the string value or null.

Parameters:
nodeNameLocalRefId - refid for the thread local variable
project - Project
Returns:
value of the variable, or null if it is not found or the refid doesn't refer to a valid thread local

addNodeContextTasks

public static void addNodeContextTasks(INodeEntry nodeentry,
                                       org.apache.tools.ant.Project project,
                                       org.apache.tools.ant.taskdefs.Sequential seq)
Add tasks to the Sequential to set threadlocal values for the node name and username

Parameters:
nodeentry - node entry
project - ant Project
seq - Sequential

addNodeContextSuccessReport

public static void addNodeContextSuccessReport(INodeEntry nodeentry,
                                               org.apache.tools.ant.Project project,
                                               org.apache.tools.ant.taskdefs.Sequential seq)
Add internal success notification to inform parallel node dispatcher that execution was successful on this node.

Parameters:
nodeentry - the node
project - the project
seq - the Sequential task