Class Props$

java.lang.Object
org.apache.pekko.actor.Props$
All Implemented Interfaces:
Serializable, AbstractProps

public class Props$ extends Object implements AbstractProps, Serializable
Factory for Props instances.

Props is a ActorRef configuration object, that is immutable, so it is thread safe and fully sharable.

Used when creating new actors through ActorSystem.actorOf and ActorContext.actorOf.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Props$
    Static reference to the singleton instance of this Scala object.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    apply(Class<?> clazz, scala.collection.immutable.Seq<Object> args)
    Scala API: create a Props given a class and its constructor arguments.
    apply(Deploy deploy, Class<?> clazz, scala.collection.immutable.Seq<Object> args)
    Props is a configuration object using in creating an Actor; it is immutable, so it is thread-safe and fully shareable.
    <T extends Actor>
    Props
    apply(scala.Function0<T> creator, scala.reflect.ClassTag<T> evidence$2)
    Scala API: Returns a Props that has default values except for "creator" which will be a function that creates an instance using the supplied thunk.
    <T extends Actor>
    Props
    apply(scala.reflect.ClassTag<T> evidence$1)
    Scala API: Returns a Props that has default values except for "creator" which will be a function that creates an instance of the supplied type using the default constructor.
    final scala.Function0<Actor>
    The defaultCreator, simply throws an UnsupportedOperationException when applied, which is used when creating a Props
    final Deploy
    The default Deploy instance which is used when creating a Props
    The defaultRoutedProps is NoRouter which is used when creating a Props
    final Props
    A Props instance whose creator will create an actor that doesn't respond to any message
    scala.Option<scala.Tuple3<Deploy,Class<?>,scala.collection.immutable.Seq<Object>>>
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.pekko.actor.AbstractProps

    checkCreatorClosingOver, create, create, create, validate
  • Field Details

    • MODULE$

      public static final Props$ MODULE$
      Static reference to the singleton instance of this Scala object.
  • Constructor Details

    • Props$

      public Props$()
  • Method Details

    • defaultCreator

      public final scala.Function0<Actor> defaultCreator()
      The defaultCreator, simply throws an UnsupportedOperationException when applied, which is used when creating a Props
    • defaultRoutedProps

      public final RouterConfig defaultRoutedProps()
      The defaultRoutedProps is NoRouter which is used when creating a Props
    • defaultDeploy

      public final Deploy defaultDeploy()
      The default Deploy instance which is used when creating a Props
    • empty

      public final Props empty()
      A Props instance whose creator will create an actor that doesn't respond to any message
    • apply

      public <T extends Actor> Props apply(scala.reflect.ClassTag<T> evidence$1)
      Scala API: Returns a Props that has default values except for "creator" which will be a function that creates an instance of the supplied type using the default constructor.
    • apply

      public <T extends Actor> Props apply(scala.Function0<T> creator, scala.reflect.ClassTag<T> evidence$2)
      Scala API: Returns a Props that has default values except for "creator" which will be a function that creates an instance using the supplied thunk.

      CAVEAT: Required mailbox type cannot be detected when using anonymous mixin composition when creating the instance. For example, the following will not detect the need for DequeBasedMessageQueueSemantics as defined in Stash:

      
       'Props(new Actor with Stash { ... })
       
      Instead you must create a named class that mixin the trait, e.g. class MyActor extends Actor with Stash.
    • apply

      public Props apply(Class<?> clazz, scala.collection.immutable.Seq<Object> args)
      Scala API: create a Props given a class and its constructor arguments.
    • apply

      public Props apply(Deploy deploy, Class<?> clazz, scala.collection.immutable.Seq<Object> args)
      Props is a configuration object using in creating an Actor; it is immutable, so it is thread-safe and fully shareable.

      Examples on Scala API:

      
        val props = Props.empty
        val props = Props[MyActor]
        val props = Props(classOf[MyActor], arg1, arg2)
      
        val otherProps = props.withDispatcher("dispatcher-id")
        val otherProps = props.withDeploy(<deployment info>)
       

      Examples on Java API:

      
        final Props props = Props.empty();
        final Props props = Props.create(MyActor.class, arg1, arg2);
      
        final Props otherProps = props.withDispatcher("dispatcher-id");
        final Props otherProps = props.withDeploy(<deployment info>);
       
    • unapply

      public scala.Option<scala.Tuple3<Deploy,Class<?>,scala.collection.immutable.Seq<Object>>> unapply(Props x$0)