class Actions extends (State) ⇒ Actions
Actions consists of functions to process incoming commands
and persisted events. Actions
is an immutable class.
- Source
- PersistentEntity.scala
- Alphabetic
- By Inheritance
- Actions
- Function1
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Actions(eventHandler: EventHandler, commandHandlers: Map[Class[_], CommandHandler])
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (Actions, B)
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
andThen[A](g: (Actions) ⇒ A): (State) ⇒ A
- Definition Classes
- Function1
- Annotations
- @unspecialized()
-
def
apply(state: State): Actions
Extends
State => Actions
so that it can be used directly in PersistentEntity#behavior when there is only one set of actions independent of state.Extends
State => Actions
so that it can be used directly in PersistentEntity#behavior when there is only one set of actions independent of state.- Definition Classes
- Actions → Function1
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- val commandHandlers: Map[Class[_], CommandHandler]
-
def
compose[A](g: (A) ⇒ State): (A) ⇒ Actions
- Definition Classes
- Function1
- Annotations
- @unspecialized()
- def ensuring(cond: (Actions) ⇒ Boolean, msg: ⇒ Any): Actions
- def ensuring(cond: (Actions) ⇒ Boolean): Actions
- def ensuring(cond: Boolean, msg: ⇒ Any): Actions
- def ensuring(cond: Boolean): Actions
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val eventHandler: EventHandler
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- def formatted(fmtstr: String): String
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
onCommand[C <: Command with ReplyType[Reply], Reply](handler: PartialFunction[(Command, CommandContext[Reply], State), Persist])(implicit arg0: ClassTag[C]): Actions
Add a command handler.
Add a command handler. For each command class the handler is a
PartialFunction
. Adding a handler for a command class that was previously defined will replace the previous handler for that class. It is possible to combine handlers from two differentActions
with #orElse method. -
def
onEvent(handler: EventHandler): Actions
Add an event handler.
Add an event handler. Each handler is a
PartialFunction
and they will be tried in the order they were added, i.e. they are combined withorElse
. -
def
onReadOnlyCommand[C <: Command with ReplyType[Reply], Reply](handler: PartialFunction[(Command, ReadOnlyCommandContext[Reply], State), Unit])(implicit arg0: ClassTag[C]): Actions
Add a command handler that will not persist any events.
Add a command handler that will not persist any events. This is a convenience method to #onCommand. For each command class the handler is a
PartialFunction
. Adding a handler for a command class that was previously defined will replace the previous handler for that class. It is possible to combine handlers from two differentActions
with #orElse method. -
def
orElse(b: Actions): Actions
Append
eventHandler
andcommandHandlers
fromb
to the handlers of thisActions
.Append
eventHandler
andcommandHandlers
fromb
to the handlers of thisActions
.Event handlers are combined with
orElse
of the partial functions.Command handlers for a specific command class that are defined in both
b
and thisActions
will be combined withorElse
of the partial functions. -
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- Function1 → AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- def →[B](y: B): (Actions, B)