Class ConfigurationFactory
This class contains methods used to retrieve configuration information from a variety of sources including user-supplied strings, configuration files and assembly resources.
Inherited Members
Namespace: Akka.Configuration
Assembly: Akka.dll
Syntax
public class ConfigurationFactory
Properties
| Improve this Doc View SourceEmpty
Generates an empty configuration.
Declaration
public static Config Empty { get; }
Property Value
Type | Description |
---|---|
Config |
Methods
| Improve this Doc View SourceDefault()
Retrieves the default configuration that Akka.NET uses when no configuration has been defined.
Declaration
public static Config Default()
Returns
Type | Description |
---|---|
Config | The configuration that contains default values for all options. |
FromObject(Object)
Creates a configuration based on the supplied source object
Declaration
public static Config FromObject(object source)
Parameters
Type | Name | Description |
---|---|---|
Object | source | The source object |
Returns
Type | Description |
---|---|
Config | The configuration created from the source object |
FromResource(String, Object)
Retrieves a configuration defined in a resource of the assembly containing the supplied instance object.
Declaration
public static Config FromResource(string resourceName, object instanceInAssembly)
Parameters
Type | Name | Description |
---|---|---|
String | resourceName | The name of the resource that contains the configuration. |
Object | instanceInAssembly | An instance object located in the assembly to search. |
Returns
Type | Description |
---|---|
Config | The configuration defined in the assembly that contains the instanced object. |
FromResource(String, Assembly)
Retrieves a configuration defined in a resource of the supplied assembly.
Declaration
public static Config FromResource(string resourceName, Assembly assembly)
Parameters
Type | Name | Description |
---|---|---|
String | resourceName | The name of the resource that contains the configuration. |
Assembly | assembly | The assembly that contains the given resource. |
Returns
Type | Description |
---|---|
Config | The configuration defined in the assembly that contains the given resource. |
FromResource<TAssembly>(String)
Retrieves a configuration defined in a resource of the assembly
containing the supplied type TAssembly
.
Declaration
public static Config FromResource<TAssembly>(string resourceName)
Parameters
Type | Name | Description |
---|---|---|
String | resourceName | The name of the resource that contains the configuration. |
Returns
Type | Description |
---|---|
Config | The configuration defined in the assembly that contains the type |
Type Parameters
Name | Description |
---|---|
TAssembly | A type located in the assembly to search. |
Load()
Loads a configuration defined in the current application's configuration file, e.g. app.config or web.config
Declaration
public static Config Load()
Returns
Type | Description |
---|---|
Config | The configuration defined in the configuration file. |
ParseString(String)
Generates a configuration defined in the supplied HOCON (Human-Optimized Config Object Notation) string.
Declaration
public static Config ParseString(string hocon)
Parameters
Type | Name | Description |
---|---|---|
String | hocon | A string that contains configuration options to use. |
Returns
Type | Description |
---|---|
Config | The configuration defined in the supplied HOCON string. |
ParseString(String, Func<String, HoconRoot>)
Generates a configuration defined in the supplied HOCON (Human-Optimized Config Object Notation) string.
Declaration
public static Config ParseString(string hocon, Func<string, HoconRoot> includeCallback)
Parameters
Type | Name | Description |
---|---|---|
String | hocon | A string that contains configuration options to use. |
Func<String, HoconRoot> | includeCallback | callback used to resolve includes |
Returns
Type | Description |
---|---|
Config | The configuration defined in the supplied HOCON string. |