Package akka.dispatch
Class Dispatchers
- java.lang.Object
-
- akka.dispatch.Dispatchers
-
public class Dispatchers extends java.lang.ObjectThe one and only default dispatcher.
-
-
Constructor Summary
Constructors Constructor Description Dispatchers(ActorSystem.Settings settings, DispatcherPrerequisites prerequisites)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CachingConfigcachingConfig()com.typesafe.config.Configconfig(java.lang.String id)INTERNAL APIcom.typesafe.config.Configconfig(java.lang.String id, com.typesafe.config.Config appConfig)INTERNAL APIcom.typesafe.config.ConfigdefaultDispatcherConfig()static java.lang.StringDefaultDispatcherId()MessageDispatcherdefaultGlobalDispatcher()The one and only default dispatcher.MessageDispatcherfrom(com.typesafe.config.Config cfg)INTERNAL APIbooleanhasDispatcher(java.lang.String id)Checks that the configuration provides a section for the given dispatcher.MessageDispatcherlookup(java.lang.String id)Returns a dispatcher as specified in configuration.DispatcherPrerequisitesprerequisites()booleanregisterConfigurator(java.lang.String id, MessageDispatcherConfigurator configurator)Register aMessageDispatcherConfiguratorthat will be used bylookup(java.lang.String)andhasDispatcher(java.lang.String)instead of looking up the configurator from the system configuration.ActorSystem.Settingssettings()
-
-
-
Constructor Detail
-
Dispatchers
public Dispatchers(ActorSystem.Settings settings, DispatcherPrerequisites prerequisites)
-
-
Method Detail
-
DefaultDispatcherId
public static final java.lang.String DefaultDispatcherId()
-
settings
public ActorSystem.Settings settings()
-
prerequisites
public DispatcherPrerequisites prerequisites()
-
cachingConfig
public CachingConfig cachingConfig()
-
defaultDispatcherConfig
public com.typesafe.config.Config defaultDispatcherConfig()
-
defaultGlobalDispatcher
public MessageDispatcher defaultGlobalDispatcher()
The one and only default dispatcher.- Returns:
- (undocumented)
-
lookup
public MessageDispatcher lookup(java.lang.String id)
Returns a dispatcher as specified in configuration. Please note that this method _may_ create and return a NEW dispatcher, _every_ call.Throws ConfigurationException if the specified dispatcher cannot be found in the configuration.
- Parameters:
id- (undocumented)- Returns:
- (undocumented)
-
hasDispatcher
public boolean hasDispatcher(java.lang.String id)
Checks that the configuration provides a section for the given dispatcher. This does not guarantee that no ConfigurationException will be thrown when using this dispatcher, because the details can only be checked by trying to instantiate it, which might be undesirable when just checking.- Parameters:
id- (undocumented)- Returns:
- (undocumented)
-
registerConfigurator
public boolean registerConfigurator(java.lang.String id, MessageDispatcherConfigurator configurator)Register aMessageDispatcherConfiguratorthat will be used bylookup(java.lang.String)andhasDispatcher(java.lang.String)instead of looking up the configurator from the system configuration. This enables dynamic addition of dispatchers, as used by theBalancingPool.A configurator for a certain id can only be registered once, i.e. it can not be replaced. It is safe to call this method multiple times, but only the first registration will be used. This method returns
trueif the specified configurator was successfully registered.- Parameters:
id- (undocumented)configurator- (undocumented)- Returns:
- (undocumented)
-
config
public com.typesafe.config.Config config(java.lang.String id)
INTERNAL API- Parameters:
id- (undocumented)- Returns:
- (undocumented)
-
config
public com.typesafe.config.Config config(java.lang.String id, com.typesafe.config.Config appConfig)INTERNAL API- Parameters:
id- (undocumented)appConfig- (undocumented)- Returns:
- (undocumented)
-
from
public MessageDispatcher from(com.typesafe.config.Config cfg)
INTERNAL APICreates a dispatcher from a Config. Internal test purpose only.
ex: from(config.getConfig(id))
The Config must also contain a
idproperty, which is the identifier of the dispatcher.Throws: IllegalArgumentException if the value of "type" is not valid IllegalArgumentException if it cannot create the MessageDispatcherConfigurator
- Parameters:
cfg- (undocumented)- Returns:
- (undocumented)
-
-