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/2.6/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. Protected

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(message: com.google.inject.spi.Message): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  5. def addError(t: Throwable): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  6. def addError(message: String, arguments: <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 <: AnyRef](clazz: Class[T]): AnnotatedBindingBuilder[T]
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  9. def bind[T <: AnyRef](typeLiteral: TypeLiteral[T]): AnnotatedBindingBuilder[T]
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  10. def bind[T <: AnyRef](key: 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(classMatcher: Matcher[_ >: Class[_ <: AnyRef] <: AnyRef], methodMatcher: Matcher[_ >: Method <: AnyRef], interceptors: <repeated...>[MethodInterceptor]): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
    Annotations
    @transient()
  13. def bindListener(bindingMatcher: Matcher[_ >: Binding[_ <: AnyRef] <: AnyRef], listener: <repeated...>[ProvisionListener]): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
    Annotations
    @transient()
  14. def bindListener(typeMatcher: Matcher[_ >: TypeLiteral[_ <: AnyRef] <: AnyRef], listener: TypeListener): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  15. def bindScope(scopeAnnotation: Class[_ <: Annotation], scope: 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(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  18. def configure(): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  19. final def configure(builder: Binder): Unit
    Definition Classes
    AbstractModule → Module
  20. def convertToTypes(typeMatcher: Matcher[_ >: TypeLiteral[_ <: AnyRef] <: AnyRef], converter: 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: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  24. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  25. def getMembersInjector[T <: AnyRef](type: TypeLiteral[T]): MembersInjector[T]
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  26. def getMembersInjector[T <: AnyRef](type: Class[T]): MembersInjector[T]
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  27. def getProvider[T <: AnyRef](type: Class[T]): Provider[T]
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  28. def getProvider[T <: AnyRef](key: Key[T]): Provider[T]
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  29. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  30. def install(module: Module): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  31. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  32. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  33. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  34. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  35. def requestInjection[T <: AnyRef](type: TypeLiteral[T], instance: T): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  36. def requestInjection(instance: AnyRef): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  37. def requestStaticInjection(types: <repeated...>[Class[_ <: AnyRef]]): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
    Annotations
    @transient()
  38. def requireBinding(type: Class[_ <: AnyRef]): Unit
    Attributes
    protected[com.google.inject]
    Definition Classes
    AbstractModule
  39. def requireBinding(key: Key[_ <: AnyRef]): 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(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  43. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  44. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AbstractModule

Inherited from Module

Inherited from AnyRef

Inherited from Any

Ungrouped