| Modifier and Type | Field and Description |
|---|---|
static long |
HIGH_ROOT_ID |
| Modifier and Type | Method and Description |
|---|---|
Protocols |
actorFor(Class<?>[] protocols,
Class<? extends Actor> type,
Object... parameters)
Answers a
Protocols that provides one or more supported protocols for the
newly created Actor according to definition. |
Protocols |
actorFor(Class<?>[] protocols,
Definition definition)
Answers a
Protocols that provides one or more supported protocols for the
newly created Actor according to definition. |
<T,A extends Actor> |
actorFor(Class<T> protocol,
Class<? extends Actor> type,
ActorInstantiator<A> instantiator)
Answers the
T protocol of the newly created Actor that implements the protocol. |
<T> T |
actorFor(Class<T> protocol,
Class<? extends Actor> type,
Object... parameters)
Answers the
T protocol of the newly created Actor that implements the protocol. |
<T> T |
actorFor(Class<T> protocol,
Definition definition)
Answers the
T protocol of the newly created Actor that is defined by
the parameters of definition that implements the protocol. |
AddressFactory |
addressFactory()
Answers the
AddressFactory for this World. |
CompletesEventually |
completesFor(Address address,
Returns<Object> clientReturns)
Answers a
CompletesEventually instance identified by address that backs the clientReturns. |
<T> CompletesEventually |
completesFor(Returns<T> clientReturns)
Answers a new
CompletesEventually instance that backs the clientReturns. |
Configuration |
configuration()
Answers the
Configuration for this World. |
DeadLetters |
deadLetters()
Answers the
DeadLetters for this World, which is backed
by an Actor. |
Logger |
defaultLogger()
Answers the default
Logger that is registered with this World. |
Actor |
defaultParent()
Answers the
Actor that serves as the default parent for this World. |
Supervisor |
defaultSupervisor()
Answers the
Supervisor protocol for sending messages to the default supervisor. |
boolean |
isTerminated()
Answers whether or not this
World has been terminated or is in the process of termination. |
Logger |
logger(String name)
Answers the
Logger named with name, or null of it does not exist. |
String |
name()
Answers the
String name of this World. |
void |
register(String name,
boolean isDefault,
LoggerProvider loggerProvider)
Registers the
LoggerProvider plugin by name. |
void |
register(String name,
boolean isDefault,
MailboxProvider mailboxProvider)
Registers the
MailboxProvider plugin by name. |
void |
register(String name,
CompletesEventuallyProvider completesEventuallyProvider)
Registers the
CompletesEventuallyProvider plugin by name. |
void |
registerCommonSupervisor(String stageName,
String name,
Class<?> supervisedProtocol,
Class<? extends Actor> supervisorClass)
Registers the
supervisorClass plugin by name that will supervise all Actors that implement the supervisedProtocol. |
void |
registerCompletesEventuallyProviderKeeper(CompletesEventuallyProviderKeeper keeper)
Registers the
CompletesEventuallyProviderKeeper plugin. |
void |
registerDefaultSupervisor(String stageName,
String name,
Class<? extends Actor> supervisorClass)
Registers the
supervisorClass plugin by name that will serve as the default supervise for all Actors
that are not supervised by a specific supervisor. |
void |
registerDynamic(String name,
Object value)
Registers the dynamic
value with the name key. |
void |
registerLoggerProviderKeeper(LoggerProviderKeeper keeper)
Registers the
LoggerProviderKeeper plugin. |
void |
registerMailboxProviderKeeper(MailboxProviderKeeper keeper)
Registers the
MailboxProviderKeeper plugin. |
<DEPENDENCY> |
resolveDynamic(String name,
Class<DEPENDENCY> anyDependencyClass)
Answers the
DEPENDENCY instance of the name named dependency. |
Stage |
stage()
Answers the default
Stage, which is the Stage created when this World was started. |
Stage |
stageNamed(String name)
Answers the
Stage named by name, or the newly created Stage instance named by name
if the Stage does not already exist. |
Stage |
stageNamed(String name,
Class<? extends Stage> stageType,
AddressFactory addressFactory)
Answers the
Stage named by name, or the newly created Stage instance named by name
if the Stage does not already exist. |
static World |
start(String name)
Answers a new
World with the given name and that is configured with
the contents of the xoom-actors.properties file. |
static World |
start(String name,
Configuration configuration)
Answers a new
World with the given name and that is configured with
the contents of the configuration. |
static World |
start(String name,
Properties properties)
Answers a new
World with the given name and that is configured with
the contents of the properties. |
static World |
startWithDefaults(String name)
Answers a new
World with the given name and that is configured with
the contents of the default Configuration of sensible settings. |
void |
terminate()
Initiates the
World terminate process if the process has not already been initiated. |
World |
world()
Answers this
World instance. |
public static final long HIGH_ROOT_ID
public static World start(String name)
World with the given name and that is configured with
the contents of the xoom-actors.properties file.name - the String name to assign to the new World instanceWorldpublic static World start(String name, Properties properties)
World with the given name and that is configured with
the contents of the properties.name - the String name to assign to the new World instanceproperties - the java.util.Properties used for configurationWorldpublic static World start(String name, Configuration configuration)
World with the given name and that is configured with
the contents of the configuration.name - the String name to assign to the new World instanceconfiguration - the Configuration used for configurationWorldpublic static World startWithDefaults(String name)
World with the given name and that is configured with
the contents of the default Configuration of sensible settings.name - the String name to assign to the new World instanceWorldpublic <T,A extends Actor> T actorFor(Class<T> protocol, Class<? extends Actor> type, ActorInstantiator<A> instantiator)
T protocol of the newly created Actor that implements the protocol.T - the protocol typeA - the Actor typeprotocol - the Class<T> protocoltype - the Class<? extends Actor> of the Actor to createinstantiator - the ActorInstantiator<A> used to instantiate the Actorpublic <T> T actorFor(Class<T> protocol, Class<? extends Actor> type, Object... parameters)
T protocol of the newly created Actor that implements the protocol.T - the protocol typeprotocol - the Class<T> protocoltype - the Class<? extends Actor> of the Actor to createparameters - the Object[] of constructor parameterspublic <T> T actorFor(Class<T> protocol, Definition definition)
T protocol of the newly created Actor that is defined by
the parameters of definition that implements the protocol.T - the protocol typeprotocol - the Class<T> protocol that the Actor supportsdefinition - the Definition providing parameters to the Actorpublic Protocols actorFor(Class<?>[] protocols, Class<? extends Actor> type, Object... parameters)
Protocols that provides one or more supported protocols for the
newly created Actor according to definition.protocols - the Class<?>[] array of protocols that the Actor supportstype - the Class<? extends Actor> of the Actor to createparameters - the Object[] of constructor parametersProtocolspublic Protocols actorFor(Class<?>[] protocols, Definition definition)
Protocols that provides one or more supported protocols for the
newly created Actor according to definition.protocols - the Class<?>[] array of protocols that the Actor supportsdefinition - the Definition providing parameters to the ActorProtocolspublic AddressFactory addressFactory()
AddressFactory for this World.AddressFactorypublic Configuration configuration()
Configuration for this World.Configurationpublic DeadLetters deadLetters()
DeadLetters for this World, which is backed
by an Actor. Interested parties may register for notifications
as a DeadLettersListener via the DeadLetters protocol.public <T> CompletesEventually completesFor(Returns<T> clientReturns)
CompletesEventually instance that backs the clientReturns.
This manages the Returns using the CompletesEventually plugin Actor pool.T - the type of the ReturnsclientReturns - the CompletesEventually allocated for eventual completion of clientReturnspublic CompletesEventually completesFor(Address address, Returns<Object> clientReturns)
CompletesEventually instance identified by address that backs the clientReturns.
This manages the Returns using the CompletesEventually plugin Actor pool.address - the Address of the CompletesEventually actor to reuseclientReturns - the CompletesEventually allocated for eventual completion of clientReturnspublic Logger defaultLogger()
Logger that is registered with this World. The
Logger protocol is implemented by an Actor such that all logging is
asynchronous.public Actor defaultParent()
Actor that serves as the default parent for this World.
Unless overridden using Configuration (e.g. Properties or fluent Configuration)
the default parent is the single PublicRootActor.public Supervisor defaultSupervisor()
Supervisor protocol for sending messages to the default supervisor.
Unless overridden using Configuration (e.g. Properties or fluent Configuration)
the default supervisor is the single PublicRootActor.public Logger logger(String name)
Logger named with name, or null of it does not exist.name - the String name of the Loggerpublic String name()
String name of this World.public void register(String name, CompletesEventuallyProvider completesEventuallyProvider)
CompletesEventuallyProvider plugin by name.public void register(String name, boolean isDefault, LoggerProvider loggerProvider)
LoggerProvider plugin by name.public void register(String name, boolean isDefault, MailboxProvider mailboxProvider)
MailboxProvider plugin by name.public void registerCommonSupervisor(String stageName, String name, Class<?> supervisedProtocol, Class<? extends Actor> supervisorClass)
supervisorClass plugin by name that will supervise all Actors that implement the supervisedProtocol.registerCommonSupervisor in interface RegistrarstageName - the String name of the Stage in which the supervisorClass is to be registeredname - the String name of the supervisor to registersupervisedProtocol - the protocol of Class<?> for which the supervisor will supervisesupervisorClass - the Class<? extends Actor> to register as a supervisorpublic void registerDefaultSupervisor(String stageName, String name, Class<? extends Actor> supervisorClass)
supervisorClass plugin by name that will serve as the default supervise for all Actors
that are not supervised by a specific supervisor.registerDefaultSupervisor in interface RegistrarstageName - the String name of the Stage in which the supervisorClass is to be registeredname - the String name of the supervisor to registersupervisorClass - the Class<? extends Actor> to register as a supervisorpublic void registerCompletesEventuallyProviderKeeper(CompletesEventuallyProviderKeeper keeper)
CompletesEventuallyProviderKeeper plugin.registerCompletesEventuallyProviderKeeper in interface Registrarkeeper - the CompletesEventuallyProviderKeeper to registerpublic void registerLoggerProviderKeeper(LoggerProviderKeeper keeper)
LoggerProviderKeeper plugin.registerLoggerProviderKeeper in interface Registrarkeeper - the LoggerProviderKeeper to registerpublic void registerMailboxProviderKeeper(MailboxProviderKeeper keeper)
MailboxProviderKeeper plugin.registerMailboxProviderKeeper in interface Registrarkeeper - the MailboxProviderKeeper to registerpublic void registerDynamic(String name, Object value)
value with the name key. The
value cannot not be replaced by a subsequent registration
using the same name.name - the String name of the dynamic dependenciesvalue - the Object to registerpublic <DEPENDENCY> DEPENDENCY resolveDynamic(String name, Class<DEPENDENCY> anyDependencyClass)
DEPENDENCY instance of the name named dependency.DEPENDENCY - the dependency typename - the String name of the dynamic dependencyanyDependencyClass - the Class<DEPENDENCY>public Stage stage()
Stage, which is the Stage created when this World was started.public Stage stageNamed(String name)
Stage named by name, or the newly created Stage instance named by name
if the Stage does not already exist.name - the String name of the Stage to answerpublic Stage stageNamed(String name, Class<? extends Stage> stageType, AddressFactory addressFactory)
Stage named by name, or the newly created Stage instance named by name
if the Stage does not already exist.name - the String name of the Stage to answerstageType - the Class<? extends Stage>addressFactory - the AddressFactory of the Stage if not existingpublic boolean isTerminated()
World has been terminated or is in the process of termination.public void terminate()
World terminate process if the process has not already been initiated.Copyright © 2021. All rights reserved.