Packages

trait ActorModule extends AbstractModule

Facilitates runtime dependency injection of "functional programming"-style actor behaviors.

1. Mix this trait into the object defining the actor message(s) and behavior(s); 2. Define the Message type with actor message class; 3. Annotate with Provides the "create" method that returns the (possibly just initial) Behavior of the actor; 4. Use the bindTypedActor in AkkaGuiceSupport, passing the object as the actor module.

For example:

object ConfiguredActor extends ActorModule {
  type Message = GetConfig

  final case class GetConfig(replyTo: ActorRef[String])

  @Provides def apply(configuration: Configuration): Behavior[GetConfig] = {
    // TODO: Define ConfiguredActor's behavior using the injected configuration.
    Behaviors.empty
  }
}

final class AppModule extends AbstractModule with AkkaGuiceSupport {
  override def configure() = {
    bindTypedActor(classOf[ConfiguredActor], "configured-actor")
  }
}

Message is a type member rather than a type parameter is because you can't define, using the example above, GetConfig inside the object and also have the object extend ActorModule[ConfiguredActor.GetConfig].

Annotations
@ApiMayChange()
Source
ActorModule.scala
See also

https://doc.akka.io/docs/akka/snapshot/typed/style-guide.html#functional-versus-object-oriented-style

Linear Supertypes
AbstractModule, Module, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ActorModule
  2. AbstractModule
  3. Module
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. abstract type Message

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 addError(arg0: com.google.inject.spi.Message): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  5. def addError(arg0: Throwable): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  6. def addError(arg0: String, arg1: <repeated...>[AnyRef]): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
    Annotations
    @transient()
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def bind[T](arg0: Class[T]): AnnotatedBindingBuilder[T]
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  9. def bind[T](arg0: TypeLiteral[T]): AnnotatedBindingBuilder[T]
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  10. def bind[T](arg0: Key[T]): LinkedBindingBuilder[T]
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  11. def bindConstant(): AnnotatedConstantBindingBuilder
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  12. def bindInterceptor(arg0: Matcher[_ >: Class[_]], arg1: Matcher[_ >: Method], arg2: <repeated...>[MethodInterceptor]): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
    Annotations
    @transient()
  13. def bindListener(arg0: Matcher[_ >: Binding[_]], arg1: <repeated...>[ProvisionListener]): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
    Annotations
    @transient()
  14. def bindListener(arg0: Matcher[_ >: TypeLiteral[_]], arg1: TypeListener): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  15. def bindScope(arg0: Class[_ <: Annotation], arg1: Scope): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  16. def binder(): Binder
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  17. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  18. def configure(): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  19. final def configure(arg0: Binder): Unit
    Definition Classes
    AbstractModule → Module
  20. def convertToTypes(arg0: Matcher[_ >: TypeLiteral[_]], arg1: TypeConverter): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  21. def currentStage(): Stage
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  22. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  23. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  24. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  25. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  26. def getMembersInjector[T](arg0: TypeLiteral[T]): MembersInjector[T]
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  27. def getMembersInjector[T](arg0: Class[T]): MembersInjector[T]
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  28. def getProvider[T](arg0: Class[T]): Provider[T]
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  29. def getProvider[T](arg0: Key[T]): Provider[T]
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  30. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  31. def install(arg0: Module): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  32. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  33. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  34. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  35. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  36. def requestInjection(arg0: Any): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  37. def requestStaticInjection(arg0: <repeated...>[Class[_]]): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
    Annotations
    @transient()
  38. def requireBinding(arg0: Class[_]): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  39. def requireBinding(arg0: Key[_]): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  40. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  41. def toString(): String
    Definition Classes
    AnyRef → Any
  42. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from AbstractModule

Inherited from Module

Inherited from AnyRef

Inherited from Any

Ungrouped