Package org.apache.pekko.actor
Class Props
java.lang.Object
org.apache.pekko.actor.Props
- All Implemented Interfaces:
Serializable,scala.Equals,scala.Product
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionObtain an upper-bound approximation of the actor class which is going to be created by these Props.static PropsScala API: create a Props given a class and its constructor arguments.static PropsProps is a configuration object using in creating anActor; it is immutable, so it is thread-safe and fully shareable.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.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.scala.collection.immutable.Seq<Object>args()booleanClass<?>clazz()Class<?>scala.collection.immutable.Seq<Object>static Propsstatic Propsstatic final scala.Function0<Actor>The defaultCreator, simply throws an UnsupportedOperationException when applied, which is used when creating a Propsstatic final DeployThe default Deploy instance which is used when creating a Propsstatic final RouterConfigThe defaultRoutedProps is NoRouter which is used when creating a Propsdeploy()Convenience method for extracting the dispatcher information from the containedDeployinstance.static final Propsempty()A Props instance whose creator will create an actor that doesn't respond to any messagebooleaninthashCode()mailbox()Convenience method for extracting the mailbox information from the containedDeployinstance.intproductElement(int x$1) productElementName(int x$1) scala.collection.Iterator<Object>Convenience method for extracting the router configuration from the containedDeployinstance.toString()withActorTags(String... tags) Returns a new Props with the specified set of tags.withActorTags(scala.collection.immutable.Seq<String> tags) Returns a new Props with the specified set of tags.withActorTags(scala.collection.immutable.Set<String> tags) Scala API: Returns a new Props with the specified set of tags.withDeploy(Deploy d) Returns a new Props with the specified deployment configuration.Returns a new Props with the specified dispatcher set.Returns a new Props with the specified mailbox set.Returns a new Props with the specified router config set.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface scala.Product
productElementNames
-
Constructor Details
-
Props
-
-
Method Details
-
defaultCreator
The defaultCreator, simply throws an UnsupportedOperationException when applied, which is used when creating a Props -
defaultRoutedProps
The defaultRoutedProps is NoRouter which is used when creating a Props -
defaultDeploy
The default Deploy instance which is used when creating a Props -
empty
A Props instance whose creator will create an actor that doesn't respond to any message -
apply
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 static <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
DequeBasedMessageQueueSemanticsas defined inStash:
Instead you must create a named class that mixin the trait, e.g.'Props(new Actor with Stash { ... })class MyActor extends Actor with Stash. -
apply
Scala API: create a Props given a class and its constructor arguments. -
apply
public static Props apply(Deploy deploy, Class<?> clazz, scala.collection.immutable.Seq<Object> args) Props is a configuration object using in creating anActor; 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
-
create
-
create
-
create
-
withActorTags
Returns a new Props with the specified set of tags. -
deploy
-
clazz
-
args
-
dispatcher
Convenience method for extracting the dispatcher information from the containedDeployinstance. -
mailbox
Convenience method for extracting the mailbox information from the containedDeployinstance. -
routerConfig
Convenience method for extracting the router configuration from the containedDeployinstance. -
withDispatcher
Returns a new Props with the specified dispatcher set. -
withMailbox
Returns a new Props with the specified mailbox set. -
withRouter
Returns a new Props with the specified router config set. -
withDeploy
Returns a new Props with the specified deployment configuration. -
withActorTags
Returns a new Props with the specified set of tags. -
withActorTags
Scala API: Returns a new Props with the specified set of tags. -
actorClass
Obtain an upper-bound approximation of the actor class which is going to be created by these Props. In other words, the actor factory method will produce an instance of this class or a subclass thereof. This is used by the actor system to select special dispatchers or mailboxes in case dependencies are encoded in the actor type. -
copy
-
copy$default$1
-
copy$default$2
-
copy$default$3
-
productPrefix
- Specified by:
productPrefixin interfacescala.Product
-
productArity
public int productArity()- Specified by:
productArityin interfacescala.Product
-
productElement
- Specified by:
productElementin interfacescala.Product
-
productIterator
- Specified by:
productIteratorin interfacescala.Product
-
canEqual
- Specified by:
canEqualin interfacescala.Equals
-
productElementName
- Specified by:
productElementNamein interfacescala.Product
-
hashCode
public int hashCode() -
toString
-
equals
-