Class

pt.tecnico.dsi.akkastrator

Task

Related Doc: package akkastrator

Permalink

abstract class Task[R] extends AnyRef

A task corresponds to sending a message to an actor, handling its response and possibly mutate the internal state of the Orchestrator.

The answer(s) to the sent message must be handled in behavior. behavior must invoke finish when no further processing is necessary or terminateEarly if the received message will prevent subsequent tasks from executing properly.

The pattern matching inside behavior must invoke matchId to ensure the received message is in fact the one that this task its waiting to receive.

The internal state of the orchestrator might be mutated inside behavior.

This class is very tightly coupled with Orchestrator and the reverse is also true. Because of this you can only create instances of Task inside an orchestrator.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Task
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Task(description: String, dependencies: Set[Task[_]] = Set.empty)(implicit orchestrator: AbstractOrchestrator)

    Permalink

Abstract Value Members

  1. abstract def behavior: Receive

    Permalink

    The behavior of this task.

    The behavior of this task. This is akin to the receive method of an actor, except for the fact that an all catching pattern match will cause the orchestrator to fail. For example:

    def behavior = Receive {
      case m => //Some code
    }

    This will cause the orchestrator to fail because the messages won't be handled by the correct tasks.

  2. abstract def createMessage(id: Long): Any

    Permalink

    The constructor of the message to be sent.

  3. abstract val destination: ActorPath

    Permalink

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

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def abort(receivedMessage: Serializable, id: Long): Unit

    Permalink

    Causes this task and its orchestrator to abort.

    Causes this task and its orchestrator to abort. This will have the following effects:

    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 and this task did not finish. 3. Waiting tasks will be untouched and the orchestrator will still be prepared to handle their responses. 4. The method onFinish will never be called. Similarly to the unstarted tasks, onFinish will only be invoked if all tasks have finished and this task did not finish. 5. The method onAbort will be invoked in the orchestrator.
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def canEqual(other: Any): Boolean

    Permalink
  7. final def canStart: Boolean

    Permalink

    returns

    whether this task state is Unstarted and all its dependencies have finished.

  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. val color: String

    Permalink
  10. val dependencies: Set[Task[_]]

    Permalink
  11. val description: String

    Permalink
  12. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. def equals(other: Any): Boolean

    Permalink
    Definition Classes
    Task → AnyRef → Any
  14. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. final def finish(receivedMessage: Serializable, id: Long, result: R): Unit

    Permalink

    Finishes this task, which implies:

    Finishes this task, which implies:

    1. Tasks that depend on this one will be started. 2. Messages that would be handled by this task will no longer be handled.

    Finishing an already finished task will throw an exception.

    receivedMessage

    the message which prompted the finish.

    id

    the id obtained from the message.

  16. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  17. final def hasAborted: Boolean

    Permalink
  18. final def hasFinished: Boolean

    Permalink
  19. def hashCode(): Int

    Permalink
    Definition Classes
    Task → AnyRef → Any
  20. final val index: Int

    Permalink
  21. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  22. final def isWaiting: Boolean

    Permalink
  23. final def matchId(id: Long): Boolean

    Permalink
  24. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  25. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  27. final def result: Option[R]

    Permalink

    returns

    The result of this task. A task will only have a result if it is finished.

  28. final def start(): Unit

    Permalink
    Attributes
    protected[pt.tecnico.dsi.akkastrator]
  29. final def state: TaskState

    Permalink

    returns

    the current state of this Task.

  30. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  31. def toString(): String

    Permalink
    Definition Classes
    Task → AnyRef → Any
  32. final def toTaskReport: TaskReport

    Permalink

    The immutable TaskReport of this task.

  33. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped