no.nextgentel.oss.akkatools.aggregate

GeneralAggregate

Related Doc: package aggregate

abstract class GeneralAggregate[E, S <: AggregateState[E, S]] extends EnhancedPersistentShardingActor[E, AggregateError]

Dispatcher - When sending something to an ES, use its dispatcher Command - Dispatchable message - When sent to the dispatcher, it will be sent to the correct ES.

Event - Represents a change of state for an ES

State is immutable. Represents the full state of the entity. based on its state it can accept or reject an event. Has with method transition(event) - if ok, it returns new state. If not, an error is thrown.

Can be used to try an event (since it is mutable)

DurableMessage: method of sending a message which with retry-mechanism until confirm() is called.

GeneralAggregate pseudocode:

for each received cmd: convert it to event try the event (by calling state.transition() ) if it failed: maybe do something if it works: persist event generate and send DurableMessages change our current state (by calling state.transition() and keeping the result )

Linear Supertypes
EnhancedPersistentShardingActor[E, AggregateError], EnhancedPersistentActor[E, AggregateError], MdcSupport[E], BeforeAndAfterEventAndCommand[E], DiagnosticActorLogging, AtLeastOnceDelivery, Processor, PersistentActor, Eventsourced, ProcessorImpl, Recovery, StashFactory, Stash, RequiresMessageQueue[DequeBasedMessageQueueSemantics], UnrestrictedStash, StashSupport, Snapshotter, Actor, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. GeneralAggregate
  2. EnhancedPersistentShardingActor
  3. EnhancedPersistentActor
  4. MdcSupport
  5. BeforeAndAfterEventAndCommand
  6. DiagnosticActorLogging
  7. AtLeastOnceDelivery
  8. Processor
  9. PersistentActor
  10. Eventsourced
  11. ProcessorImpl
  12. Recovery
  13. StashFactory
  14. Stash
  15. RequiresMessageQueue
  16. UnrestrictedStash
  17. StashSupport
  18. Snapshotter
  19. Actor
  20. AnyRef
  21. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new GeneralAggregate(ourDispatcherActor: ActorPath)(implicit arg0: ClassTag[E], arg1: ClassTag[S])

  2. new GeneralAggregate(idleTimeout: FiniteDuration, ourDispatcherActor: ActorPath)(implicit arg0: ClassTag[E], arg1: ClassTag[S])

Type Members

  1. type Receive = PartialFunction[Any, Unit]

    Definition Classes
    Actor

Abstract Value Members

  1. abstract def cmdToEvent: PartialFunction[AnyRef, ResultingEvent[E]]

  2. abstract def generateResultingDurableMessages: PartialFunction[E, ResultingDurableMessages]

  3. abstract val state: S

Concrete Value Members

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

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

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

    Definition Classes
    AnyRef → Any
  4. def afterOnEvent(): Unit

    Attributes
    protected
    Definition Classes
    BeforeAndAfterEventAndCommand
  5. def afterTryCommand(): Unit

    Attributes
    protected
    Definition Classes
    BeforeAndAfterEventAndCommand
  6. def aroundPostRestart(reason: Throwable): Unit

    Attributes
    protected[akka]
    Definition Classes
    Actor
  7. def aroundPostStop(): Unit

    Attributes
    protected[akka]
    Definition Classes
    AtLeastOnceDelivery → ProcessorImpl → Actor
  8. def aroundPreRestart(reason: Throwable, message: Option[Any]): Unit

    Attributes
    protected[akka]
    Definition Classes
    AtLeastOnceDelivery → ProcessorImpl → Actor
  9. def aroundPreStart(): Unit

    Attributes
    protected[akka]
    Definition Classes
    ProcessorImpl → Actor
  10. def aroundReceive(receive: akka.actor.Actor.Receive, msg: Any): Unit

    Attributes
    protected[akka]
    Definition Classes
    DiagnosticActorLogging → Actor
  11. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  12. def beforeOnEvent(event: E): Unit

    Attributes
    protected
    Definition Classes
    MdcSupportBeforeAndAfterEventAndCommand
  13. def beforeTryCommand(cmd: AnyRef): Unit

    Attributes
    protected
    Definition Classes
    MdcSupportBeforeAndAfterEventAndCommand
  14. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  15. def confirmDelivery(deliveryId: Long): Boolean

    Definition Classes
    AtLeastOnceDelivery
  16. implicit val context: ActorContext

    Definition Classes
    Actor
  17. var currentLogLevelInfo: Boolean

    Attributes
    protected
    Definition Classes
    EnhancedPersistentActor
  18. def defaultMdc(): Unit

    Attributes
    protected
    Definition Classes
    MdcSupport
  19. final def defer[A](events: Seq[A])(handler: (A) ⇒ Unit): Unit

    Definition Classes
    Eventsourced
  20. final def defer[A](event: A)(handler: (A) ⇒ Unit): Unit

    Definition Classes
    Eventsourced
  21. def deleteMessages(toSequenceNr: Long, permanent: Boolean): Unit

    Definition Classes
    ProcessorImpl
  22. def deleteMessages(toSequenceNr: Long): Unit

    Definition Classes
    ProcessorImpl
  23. def deleteSnapshot(sequenceNr: Long, timestamp: Long): Unit

    Definition Classes
    Snapshotter
  24. def deleteSnapshots(criteria: SnapshotSelectionCriteria): Unit

    Definition Classes
    Snapshotter
  25. def deliver(destination: ActorPath, deliveryIdToMessage: (Long) ⇒ Any): Unit

    Definition Classes
    AtLeastOnceDelivery
  26. lazy val dispatchId: String

  27. def doUnconfirmedWarningProcessing(): Boolean

    Attributes
    protected
    Definition Classes
    EnhancedPersistentActor
  28. def durableMessageNotDeliveredHandler(originalPayload: Any, errorMsg: String): Unit

    If doUnconfirmedWarningProcessing is turned on, then override this method to try to do something useful before we give up

    If doUnconfirmedWarningProcessing is turned on, then override this method to try to do something useful before we give up

    originalPayload

    Attributes
    protected
    Definition Classes
    GeneralAggregateEnhancedPersistentActor
  29. implicit val ec: ExecutionContextExecutor

    Definition Classes
    EnhancedPersistentActor
  30. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  31. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  32. def extractMdc(eventOrCmd: AnyRef): Unit

    Attributes
    protected
    Definition Classes
    MdcSupport
  33. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  34. def generateEventsForFailedDurableMessage(originalPayload: Any, errorMsg: String): Seq[E]

    Override this to decide if the failed outbound durableMessage should result in a persisted event.

    Override this to decide if the failed outbound durableMessage should result in a persisted event. If so, return these events. When these have been persisted, generateResultingDurableMessages() will be called as usual enabling you to perform some outbound action.

    originalPayload
    errorMsg
    returns

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

    Definition Classes
    AnyRef → Any
  36. def getDeliverySnapshot: AtLeastOnceDeliverySnapshot

    Definition Classes
    AtLeastOnceDelivery
  37. def getDurableMessageSender(): ActorPath

    Attributes
    protected
    Definition Classes
    EnhancedPersistentShardingActorEnhancedPersistentActor
  38. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  39. val initialBehavior: Receive

    Attributes
    protected[akka.persistence]
    Definition Classes
    Eventsourced
  40. def internalProcessUnconfirmedWarning(unconfirmedWarning: UnconfirmedWarning): Unit

    Attributes
    protected
    Definition Classes
    GeneralAggregateEnhancedPersistentActor
  41. def isExpectedError(e: Exception): Boolean

    Attributes
    protected
    Definition Classes
    EnhancedPersistentActor
  42. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  43. def lastSequenceNr: Long

    Definition Classes
    Recovery
  44. def loadSnapshot(persistenceId: String, criteria: SnapshotSelectionCriteria, toSequenceNr: Long): Unit

    Definition Classes
    Snapshotter
  45. val log: DiagnosticLoggingAdapter

    Definition Classes
    DiagnosticActorLogging
  46. def logMessage(message: String): Unit

    Definition Classes
    EnhancedPersistentActor
  47. def maxUnconfirmedMessages: Int

    Definition Classes
    AtLeastOnceDelivery
  48. def mdc(currentMessage: Any): MDC

    Definition Classes
    MdcSupport → DiagnosticActorLogging
  49. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  50. final def notify(): Unit

    Definition Classes
    AnyRef
  51. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  52. def numberOfUnconfirmed: Int

    Definition Classes
    AtLeastOnceDelivery
  53. def onApplyingLiveEvent(event: E): Unit

    Attributes
    protected
    Definition Classes
    EnhancedPersistentActor
  54. final def onEvent: PartialFunction[E, Unit]

  55. def onInactiveTimeout(): Unit

    Called when actor has been idle for too long..

    Called when actor has been idle for too long..

    If running in sharding, you should stop like this:

    getContext().parent().tell(new ShardRegion.Passivate(PoisonPill.getInstance()), self());

    Attributes
    protected
    Definition Classes
    EnhancedPersistentShardingActorEnhancedPersistentActor
  56. def onReceiveRecover(event: E): Unit

    Attributes
    protected
    Definition Classes
    EnhancedPersistentActor
  57. final def persist[A](events: Seq[A])(handler: (A) ⇒ Unit): Unit

    Definition Classes
    Eventsourced
  58. final def persist[A](event: A)(handler: (A) ⇒ Unit): Unit

    Definition Classes
    Eventsourced
  59. def persistAndApplyEvent(event: E): Unit

    Attributes
    protected
    Definition Classes
    EnhancedPersistentActor
  60. def persistAndApplyEvents(events: List[E]): Unit

    Attributes
    protected
    Definition Classes
    EnhancedPersistentActor
  61. final def persistAsync[A](events: Seq[A])(handler: (A) ⇒ Unit): Unit

    Definition Classes
    Eventsourced
  62. final def persistAsync[A](event: A)(handler: (A) ⇒ Unit): Unit

    Definition Classes
    Eventsourced
  63. def persistenceId: String

    Definition Classes
    EnhancedPersistentShardingActor → Processor → Recovery
  64. def postRestart(reason: Throwable): Unit

    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  65. def postStop(): Unit

    Definition Classes
    EnhancedPersistentActor → Eventsourced → UnrestrictedStash → Actor
  66. def preRestart(reason: Throwable, message: Option[Any]): Unit

    Definition Classes
    Eventsourced → ProcessorImpl → UnrestrictedStash → Actor
  67. def preRestartDefault(reason: Throwable, message: Option[Any]): Unit

    Definition Classes
    ProcessorImpl
  68. def preStart(): Unit

    Definition Classes
    EnhancedPersistentActor → ProcessorImpl → Actor
  69. def receive: Receive

    Definition Classes
    PersistentActor → Actor
  70. def receiveCommand: Receive

    Definition Classes
    EnhancedPersistentActor → Eventsourced
  71. def receiveRecover: Receive

    Definition Classes
    EnhancedPersistentActor → Eventsourced
  72. def recoveryFinished: Boolean

    Definition Classes
    ProcessorImpl
  73. def recoveryRunning: Boolean

    Definition Classes
    ProcessorImpl
  74. def redeliverInterval: FiniteDuration

    Definition Classes
    AtLeastOnceDelivery
  75. def saveSnapshot(snapshot: Any): Unit

    Definition Classes
    Snapshotter
  76. implicit final val self: ActorRef

    Definition Classes
    Actor
  77. def sendAsDurableMessage(sendAsDurableMessage: SendAsDurableMessage): Unit

    Attributes
    protected
    Definition Classes
    EnhancedPersistentShardingActorEnhancedPersistentActor
  78. def sendAsDurableMessage(payload: AnyRef, destinationActor: ActorPath): Unit

    Attributes
    protected
    Definition Classes
    EnhancedPersistentShardingActorEnhancedPersistentActor
  79. def sendAsDurableMessage(payload: AnyRef, destinationActor: ActorPath, confirmationRoutingInfo: AnyRef): Unit

    Attributes
    protected
    Definition Classes
    EnhancedPersistentActor
  80. final def sender(): ActorRef

    Definition Classes
    Actor
  81. def setDeliverySnapshot(snapshot: AtLeastOnceDeliverySnapshot): Unit

    Definition Classes
    AtLeastOnceDelivery
  82. def setLogLevels(eventLogLevelInfo: Boolean, recoveringEventLogLevelInfo: Boolean, cmdLogLevelInfo: Boolean): Unit

    eventLogLevelInfo

    Used when processing events live - not recovering

    recoveringEventLogLevelInfo

    Used when recovering events

    cmdLogLevelInfo

    Used when processing commands

    Attributes
    protected
    Definition Classes
    EnhancedPersistentActor
  83. def setMdcValue(name: String, value: String): Unit

    Attributes
    protected
    Definition Classes
    MdcSupport
  84. def snapshotSequenceNr: Long

    Definition Classes
    Recovery → Snapshotter
  85. def snapshotterId: String

    Definition Classes
    ProcessorImpl → Snapshotter
  86. def stash(): Unit

    Definition Classes
    StashSupport
  87. final def stateInfo(): String

    Attributes
    protected
    Definition Classes
    GeneralAggregateEnhancedPersistentActor
  88. def supervisorStrategy: SupervisorStrategy

    Definition Classes
    Actor
  89. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  90. def toString(): String

    Definition Classes
    AnyRef → Any
  91. final def tryCommand: PartialFunction[AnyRef, Unit]

  92. def unhandled(message: Any): Unit

    Definition Classes
    ProcessorImpl → Actor
  93. def unstashAll(): Unit

    Definition Classes
    Eventsourced → StashSupport
  94. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  97. def warnAfterNumberOfUnconfirmedAttempts: Int

    Definition Classes
    AtLeastOnceDelivery

Deprecated Value Members

  1. implicit def currentPersistentMessage: Option[Persistent]

    Definition Classes
    Recovery
    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.4) currentPersistentMessage will be removed, sequence number can be retrieved with lastSequenceNr.

  2. def deleteMessage(sequenceNr: Long, permanent: Boolean): Unit

    Definition Classes
    ProcessorImpl
    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.4) deleteMessage(sequenceNr) will be removed. Instead, validate before persist, and use deleteMessages for pruning.

  3. def deleteMessage(sequenceNr: Long): Unit

    Definition Classes
    ProcessorImpl
    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.4) deleteMessage(sequenceNr) will be removed. Instead, validate before persist, and use deleteMessages for pruning.

  4. def getCurrentPersistentMessage: Persistent

    Definition Classes
    Recovery
    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.4) getCurrentPersistentMessage will be removed, sequence number can be retrieved with lastSequenceNr.

  5. def processorId: String

    Definition Classes
    ProcessorImpl → Recovery
    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.4) Override persistenceId: String instead. Processor will be removed.

Inherited from MdcSupport[E]

Inherited from BeforeAndAfterEventAndCommand[E]

Inherited from DiagnosticActorLogging

Inherited from AtLeastOnceDelivery

Inherited from Processor

Inherited from PersistentActor

Inherited from Eventsourced

Inherited from ProcessorImpl

Inherited from Recovery

Inherited from StashFactory

Inherited from Stash

Inherited from RequiresMessageQueue[DequeBasedMessageQueueSemantics]

Inherited from UnrestrictedStash

Inherited from StashSupport

Inherited from Snapshotter

Inherited from Actor

Inherited from AnyRef

Inherited from Any

Ungrouped