org.licas.autonomic.script

## Class ActionParallel

- java.lang.Object
- - org.licas.autonomic.script.ActionParallel

-     public class ActionParallel
      extends java.lang.Object

  This manages a single parallel action executed on an `AutoEngine` script. This class is created internally, so only ever create an `ActionSequential` when writing the script code. This is then one event in the sequence.
  Author:
    Kieran Greer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ActionParallel(java.util.ArrayList<org.licas_xml.abs.Element> theSources, AutoEngineInfo theAutoInfo, boolean thisFirstOrBest)` Create a new instance of ActionParallel.
    `ActionParallel(java.lang.String theServiceType, AutoEngineInfo theAutoInfo, boolean thisFirstOrBest)` Create a new instance of ActionParallel.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected java.lang.Object` | `parallel(java.util.ArrayList<?> paramList, ObjectsMap objectsMap)` Invoke the parallel method list and return the result.
    `void` | `setCompleted()` To indicate that the call pool has completed
    `protected java.lang.Object` | `waitEvaluateBestReply(ObjectsMap objectsMap)` Execute the callpool and evaluate as the best reply returned over all replies.
    `protected java.lang.Object` | `waitEvaluateFirstReply(ObjectsMap objectsMap)` Execute the callpool and evaluate as the first reply returned.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ActionParallel

          public ActionParallel(java.lang.String theServiceType,
                                AutoEngineInfo theAutoInfo,
                                boolean thisFirstOrBest)

      Create a new instance of ActionParallel.
      Parameters:
        `theServiceType` - the type of service to invoke.
        `theAutoInfo` - the process element description to be executed.
        `thisFirstOrBest` - if true return first true result, if false return the best true result when all replies have been received.

    - #### ActionParallel

          public ActionParallel(java.util.ArrayList<org.licas_xml.abs.Element> theSources,
                                AutoEngineInfo theAutoInfo,
                                boolean thisFirstOrBest)

      Create a new instance of ActionParallel.
      Parameters:
        `theSources` - specific list of sources to invoke.
        `theAutoInfo` - the process element description to be executed.
        `thisFirstOrBest` - if true return first true result, if false return the best true result when all replies have been received.

  - ### Method Detail

    - #### parallel

          protected java.lang.Object parallel(java.util.ArrayList<?> paramList,
                                              ObjectsMap objectsMap)
                                       throws java.lang.Exception

      Invoke the parallel method list and return the result.
      Parameters:
        `paramList` - an external set of objects that can replace named or tagged fields in the method parameter lists. If empty or no match, then nothing gets changed.
        `objectsMap` - mapping of variable names to instances. This method can ad more variables, but should be for the method invocation only, so immediately cloned.
      Returns:
        the result of the evaluation. This is the `effectorList` of the input parameter if the evaluation is true, or an empty list if it is false. Evaluating to true can include matching exactly to an XML description, or just have any result, for example, by using a `checkReply` method.
      Throws:
        `java.lang.Exception` - any error.

    - #### waitEvaluateFirstReply

          protected java.lang.Object waitEvaluateFirstReply(ObjectsMap objectsMap)
                                                     throws java.lang.Exception

      Execute the callpool and evaluate as the first reply returned.
      Parameters:
        `objectsMap` - mapping of variable names to instances. This method can ad more variables, but should be for the method invocation only, so immediately cloned.
      Returns:
        the result of the evaluation. This is the `effectorList` of the input parameter if the evaluation is true, or an empty list if it is false. Evaluating to true can include matching exactly to an XML description, or just have any result, for example, by using a `checkReply` method.
      Throws:
        `java.lang.Exception` - any error.

    - #### waitEvaluateBestReply

          protected java.lang.Object waitEvaluateBestReply(ObjectsMap objectsMap)
                                                    throws java.lang.Exception

      Execute the callpool and evaluate as the best reply returned over all replies.
      Parameters:
        `objectsMap` - mapping of variable names to instances. This method can ad more variables, but should be for the method invocation only, so immediately cloned.
      Returns:
        the result of the evaluation. This is the `effectorList` of the input parameter if the evaluation is true, or an empty list if it is false. Evaluating to true can include matching exactly to an XML description, or just have any result, for example, by using a `checkReply` method.
      Throws:
        `java.lang.Exception` - any error.

    - #### setCompleted

          public void setCompleted()

      To indicate that the call pool has completed