c

pt.tecnico.dsi.akkastrator

TaskSpawnOrchestrator

class TaskSpawnOrchestrator[R, O <: AbstractOrchestrator[R]] extends Task[R]

In order for this task to work correctly either: · The created orchestrator must send to its parent a Orchestrator.Success when it finishes and a Orchestrator.Failure when it aborts. And terminate afterwords of sending the messages. · Or the method behavior must be overridden to handle the messages the inner orchestrator sends when it terminates or aborts.

R

the return type of this Task. Also the return type of the spawned orchestrator.

O

the type of AbstractOrchestrator the Props must create.

Source
TaskSpawnOrchestrator.scala
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TaskSpawnOrchestrator
  2. Task
  3. AnyRef
  4. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TaskSpawnOrchestrator(task: FullTask[R, _])(props: Props)(implicit arg0: ClassTag[O])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from TaskSpawnOrchestrator[R, O] to any2stringadd[TaskSpawnOrchestrator[R, O]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (TaskSpawnOrchestrator[R, O], B)
    Implicit
    This member is added by an implicit conversion from TaskSpawnOrchestrator[R, O] to ArrowAssoc[TaskSpawnOrchestrator[R, O]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def abort(cause: Throwable): Unit

    Aborts this task, which implies:

    Aborts this task, which implies:

    1. This task will change its state to Aborted. 2. Every unstarted task that depends on this one will never be started. This will happen because a task can only start if its dependencies have finished. 3. Waiting tasks or tasks which do not have this task as a dependency will remain untouched, unless the orchestrator is stopped or context.become is invoked in the onTaskAbort/onAbort callbacks of the orchestrator. 4. The method onTaskAbort will be invoked in the orchestrator. 5. The method onFinish in the orchestrator will never be invoked since this task did not finish.

    Aborting an already aborted task will throw an exception.

    cause

    what caused the abort to be invoked.

    Definition Classes
    Task
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def behavior: Receive

    The behavior of this task.

    The behavior of this task. This is akin to the receive method of an actor with the following exceptions: · An all catching pattern match is prohibited since it will cause the orchestrator to fail. · Every case must check if matchId returns true. This ensures the received message was in fact destined to this task. This choice of implementation allows the messages to have a free form, as it is the user that is responsible for extracting the id from the message. · Either finish or abort must be invoked after handling each response.

    Example of a well formed behavior:

    case Success(result, id) if matchId(id) =>
      orchestrator.state = // a new state
      finish("This task result") // The result is the value that the tasks that depend on this one will see.
    case SomethingWentWrong(why, id) if matchId(id) =>
      abort(why)
    case Timeout(id) =>
      abort(anError)
    Definition Classes
    TaskSpawnOrchestratorTask
  9. final def behaviorHandlingTimeout: Receive
    Definition Classes
    Task
  10. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  11. final def createMessage(id: Long): Serializable

    The constructor of the message to be sent.

    The constructor of the message to be sent. It must always return the same message, only the id must be different. If this Task is to be used inside a TaskQuorum then the created message should also implement equals.

    Definition Classes
    TaskSpawnOrchestratorTask
  12. final val destination: ActorPath

    The akka.actor.ActorPath to whom this task will send the message(s).

    The akka.actor.ActorPath to whom this task will send the message(s). This must be a value because the destination cannot change.

    Definition Classes
    TaskSpawnOrchestratorTask
  13. def ensuring(cond: (TaskSpawnOrchestrator[R, O]) ⇒ Boolean, msg: ⇒ Any): TaskSpawnOrchestrator[R, O]
    Implicit
    This member is added by an implicit conversion from TaskSpawnOrchestrator[R, O] to Ensuring[TaskSpawnOrchestrator[R, O]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: (TaskSpawnOrchestrator[R, O]) ⇒ Boolean): TaskSpawnOrchestrator[R, O]
    Implicit
    This member is added by an implicit conversion from TaskSpawnOrchestrator[R, O] to Ensuring[TaskSpawnOrchestrator[R, O]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. def ensuring(cond: Boolean, msg: ⇒ Any): TaskSpawnOrchestrator[R, O]
    Implicit
    This member is added by an implicit conversion from TaskSpawnOrchestrator[R, O] to Ensuring[TaskSpawnOrchestrator[R, O]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. def ensuring(cond: Boolean): TaskSpawnOrchestrator[R, O]
    Implicit
    This member is added by an implicit conversion from TaskSpawnOrchestrator[R, O] to Ensuring[TaskSpawnOrchestrator[R, O]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  19. final def expectedID: Option[ID]
    Definition Classes
    Task
  20. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  21. final def finish(result: R): Unit

    Finishes this task, which implies:

    Finishes this task, which implies:

    1. This task will change its state to Finished. 2. Tasks that depend on this one will be started. 3. Re-sends from destination will no longer be handled by the orchestrator. If destinations re-sends its answer it will be logged as an unhandled message. 4. The method onTaskFinish will be invoked on the orchestrator.

    Finishing an already finished task will throw an exception.

    result

    the result this task will produce. This is the value that the tasks that depend on this one will see.

    Definition Classes
    Task
  22. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from TaskSpawnOrchestrator[R, O] to StringFormat[TaskSpawnOrchestrator[R, O]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  23. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  24. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  25. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  26. val log: LoggingAdapter
    Definition Classes
    Task
  27. final def matchId(id: Long): Boolean
    Definition Classes
    Task
  28. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  29. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  30. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  31. final def recoveryAwarePersist(event: Any)(handler: ⇒ Unit): Unit
    Definition Classes
    Task
  32. final def scheduleTimeout(id: ID): Unit
    Definition Classes
    Task
  33. final val spawner: ActorRef
  34. final def start(): Unit
    Definition Classes
    Task
  35. final def state: State
    Definition Classes
    Task
  36. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  37. val task: FullTask[R, _]
    Definition Classes
    Task
  38. def toString(): String
    Definition Classes
    Task → AnyRef → Any
  39. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  42. final def withOrchestratorAndTaskPrefix(message: ⇒ String): String
    Definition Classes
    Task
  43. def [B](y: B): (TaskSpawnOrchestrator[R, O], B)
    Implicit
    This member is added by an implicit conversion from TaskSpawnOrchestrator[R, O] to ArrowAssoc[TaskSpawnOrchestrator[R, O]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from Task[R]

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from TaskSpawnOrchestrator[R, O] to any2stringadd[TaskSpawnOrchestrator[R, O]]

Inherited by implicit conversion StringFormat from TaskSpawnOrchestrator[R, O] to StringFormat[TaskSpawnOrchestrator[R, O]]

Inherited by implicit conversion Ensuring from TaskSpawnOrchestrator[R, O] to Ensuring[TaskSpawnOrchestrator[R, O]]

Inherited by implicit conversion ArrowAssoc from TaskSpawnOrchestrator[R, O] to ArrowAssoc[TaskSpawnOrchestrator[R, O]]

Ungrouped