Package akka.actor
Class Props
- java.lang.Object
 - 
- akka.actor.Props
 
 
- 
- All Implemented Interfaces:
 java.io.Serializable,scala.Equals,scala.Product
public final class Props extends java.lang.Object implements scala.Product, java.io.Serializable- See Also:
 - Serialized Form
 
 
- 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<? extends Actor>actorClass()Obtain an upper-bound approximation of the actor class which is going to be created by these Props.static Propsapply(Deploy deploy, java.lang.Class<?> clazz, scala.collection.immutable.Seq<java.lang.Object> args)Props is a configuration object using in creating anActor; it is immutable, so it is thread-safe and fully shareable.static Propsapply(java.lang.Class<?> clazz, scala.collection.immutable.Seq<java.lang.Object> args)Scala API: create a Props given a class and its constructor arguments.static <T extends Actor>
Propsapply(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.static <T extends Actor>
Propsapply(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<java.lang.Object>args()booleancanEqual(java.lang.Object x$1)java.lang.Class<?>clazz()Propscopy(Deploy deploy, java.lang.Class<?> clazz, scala.collection.immutable.Seq<java.lang.Object> args)Deploycopy$default$1()java.lang.Class<?>copy$default$2()scala.collection.immutable.Seq<java.lang.Object>copy$default$3()static <T extends Actor>
Propscreate(Creator<T> creator)static Propscreate(java.lang.Class<?> clazz, java.lang.Object... args)static Propscreate(java.lang.Class<?> clazz, scala.collection.immutable.Seq<java.lang.Object> args)static <T extends Actor>
Propscreate(java.lang.Class<T> actorClass, Creator<T> creator)static scala.Function0<Actor>defaultCreator()The defaultCreator, simply throws an UnsupportedOperationException when applied, which is used when creating a Propsstatic DeploydefaultDeploy()The default Deploy instance which is used when creating a Propsstatic RouterConfigdefaultRoutedProps()The defaultRoutedProps is NoRouter which is used when creating a PropsDeploydeploy()java.lang.Stringdispatcher()Convenience method for extracting the dispatcher information from the containedDeployinstance.static Propsempty()A Props instance whose creator will create an actor that doesn't respond to any messagebooleanequals(java.lang.Object x$1)inthashCode()java.lang.Stringmailbox()Convenience method for extracting the mailbox information from the containedDeployinstance.intproductArity()java.lang.ObjectproductElement(int x$1)java.lang.StringproductElementName(int x$1)scala.collection.Iterator<java.lang.Object>productIterator()java.lang.StringproductPrefix()RouterConfigrouterConfig()Convenience method for extracting the router configuration from the containedDeployinstance.java.lang.StringtoString()static scala.Option<scala.Tuple3<Deploy,java.lang.Class<?>,scala.collection.immutable.Seq<java.lang.Object>>>unapply(Props x$0)PropswithActorTags(java.lang.String... tags)Returns a new Props with the specified set of tags.PropswithActorTags(scala.collection.immutable.Seq<java.lang.String> tags)Returns a new Props with the specified set of tags.PropswithActorTags(scala.collection.immutable.Set<java.lang.String> tags)Scala API: Returns a new Props with the specified set of tags.PropswithDeploy(Deploy d)Returns a new Props with the specified deployment configuration.PropswithDispatcher(java.lang.String d)Returns a new Props with the specified dispatcher set.PropswithMailbox(java.lang.String m)Returns a new Props with the specified mailbox set.PropswithRouter(RouterConfig r)Returns a new Props with the specified router config set. 
 - 
 
- 
- 
Constructor Detail
- 
Props
public Props(Deploy deploy, java.lang.Class<?> clazz, scala.collection.immutable.Seq<java.lang.Object> args)
 
 - 
 
- 
Method Detail
- 
defaultCreator
public static final scala.Function0<Actor> defaultCreator()
The defaultCreator, simply throws an UnsupportedOperationException when applied, which is used when creating a Props 
- 
defaultRoutedProps
public static final RouterConfig defaultRoutedProps()
The defaultRoutedProps is NoRouter which is used when creating a Props 
- 
defaultDeploy
public static final Deploy defaultDeploy()
The default Deploy instance which is used when creating a Props 
- 
empty
public static final Props empty()
A Props instance whose creator will create an actor that doesn't respond to any message 
- 
apply
public static <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 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
public static Props apply(java.lang.Class<?> clazz, scala.collection.immutable.Seq<java.lang.Object> args)
Scala API: create a Props given a class and its constructor arguments. 
- 
apply
public static Props apply(Deploy deploy, java.lang.Class<?> clazz, scala.collection.immutable.Seq<java.lang.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
public static scala.Option<scala.Tuple3<Deploy,java.lang.Class<?>,scala.collection.immutable.Seq<java.lang.Object>>> unapply(Props x$0)
 
- 
create
public static Props create(java.lang.Class<?> clazz, scala.collection.immutable.Seq<java.lang.Object> args)
 
- 
create
public static <T extends Actor> Props create(java.lang.Class<T> actorClass, Creator<T> creator)
 
- 
create
public static Props create(java.lang.Class<?> clazz, java.lang.Object... args)
 
- 
withActorTags
public Props withActorTags(java.lang.String... tags)
Returns a new Props with the specified set of tags. 
- 
deploy
public Deploy deploy()
 
- 
clazz
public java.lang.Class<?> clazz()
 
- 
args
public scala.collection.immutable.Seq<java.lang.Object> args()
 
- 
dispatcher
public java.lang.String dispatcher()
Convenience method for extracting the dispatcher information from the containedDeployinstance. 
- 
mailbox
public java.lang.String mailbox()
Convenience method for extracting the mailbox information from the containedDeployinstance. 
- 
routerConfig
public RouterConfig routerConfig()
Convenience method for extracting the router configuration from the containedDeployinstance. 
- 
withDispatcher
public Props withDispatcher(java.lang.String d)
Returns a new Props with the specified dispatcher set. 
- 
withMailbox
public Props withMailbox(java.lang.String m)
Returns a new Props with the specified mailbox set. 
- 
withRouter
public Props withRouter(RouterConfig r)
Returns a new Props with the specified router config set. 
- 
withDeploy
public Props withDeploy(Deploy d)
Returns a new Props with the specified deployment configuration. 
- 
withActorTags
public Props withActorTags(scala.collection.immutable.Seq<java.lang.String> tags)
Returns a new Props with the specified set of tags. 
- 
withActorTags
public Props withActorTags(scala.collection.immutable.Set<java.lang.String> tags)
Scala API: Returns a new Props with the specified set of tags. 
- 
actorClass
public java.lang.Class<? extends Actor> 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
public Props copy(Deploy deploy, java.lang.Class<?> clazz, scala.collection.immutable.Seq<java.lang.Object> args)
 
- 
copy$default$1
public Deploy copy$default$1()
 
- 
copy$default$2
public java.lang.Class<?> copy$default$2()
 
- 
copy$default$3
public scala.collection.immutable.Seq<java.lang.Object> copy$default$3()
 
- 
productPrefix
public java.lang.String productPrefix()
- Specified by:
 productPrefixin interfacescala.Product
 
- 
productArity
public int productArity()
- Specified by:
 productArityin interfacescala.Product
 
- 
productElement
public java.lang.Object productElement(int x$1)
- Specified by:
 productElementin interfacescala.Product
 
- 
productIterator
public scala.collection.Iterator<java.lang.Object> productIterator()
- Specified by:
 productIteratorin interfacescala.Product
 
- 
canEqual
public boolean canEqual(java.lang.Object x$1)
- Specified by:
 canEqualin interfacescala.Equals
 
- 
productElementName
public java.lang.String productElementName(int x$1)
- Specified by:
 productElementNamein interfacescala.Product
 
- 
hashCode
public int hashCode()
- Overrides:
 hashCodein classjava.lang.Object
 
- 
toString
public java.lang.String toString()
- Overrides:
 toStringin classjava.lang.Object
 
- 
equals
public boolean equals(java.lang.Object x$1)
- Specified by:
 equalsin interfacescala.Equals- Overrides:
 equalsin classjava.lang.Object
 
 - 
 
 -