Applications will in the common case use the FromEnvironment() method to search a fallback-chain of configuration sources for the IProtocol instance to use. However, in some cases, the default fallback-chain is not appropriate; in these cases, other methods such as FromConfiguration(string) or SafeLookup(string) may suffice.
| Flags | Type | Name | Summary |
|---|---|---|---|
| public initonly static |
|
DefaultAppSettingsKey
|
The default App.config appSettings key used by FromConfiguration and FromEnvironment. At the time of writing, "AMQP_PROTOCOL". |
| public initonly static |
|
EnvironmentVariable
|
The environment variable read by FromEnvironmentVariable() and FromEnvironment(). At the time of writing, "AMQP_PROTOCOL". |
| Flags | Type | Name | Summary |
|---|---|---|---|
| public static |
IProtocol
|
AMQP_0_8
(r)
|
Protocol version 0-8 as standardised. |
| public static |
IProtocol
|
AMQP_0_8_QPID
(r)
|
Protocol version 0-8, as modified by QPid. |
| public static |
IProtocol
|
AMQP_0_9
(r)
|
Protocol version 0-9 as standardised (omitting sections marked "WIP", "work in progress", including in particular the Message class of operations). |
| public static |
IProtocol
|
DefaultProtocol
(r)
|
Retrieve the current default protocol variant (currently AMQP_0_8) |
| Flags | Name | Summary |
|---|---|---|
| public static |
IProtocol FromConfiguration(string appSettingsKey)
|
Uses App.config's appSettings section to retrieve an IProtocol instance. |
| public static |
IProtocol FromConfiguration()
|
Returns FromConfiguration(DefaultAppSettingsKey). |
| public static |
IProtocol FromEnvironment()
|
Returns FromEnvironment(DefaultAppSettingsKey). |
| public static |
IProtocol FromEnvironment(string appSettingsKey)
|
Tries FromConfiguration() first, followed by FromEnvironmentVariable() if no setting was found in the App.config. |
| public static |
IProtocol FromEnvironmentVariable()
|
Uses the process environment variable
|
| public static |
IProtocol Lookup(string name)
|
Low-level method for retrieving a protocol version by name (of one of the static properties on this class) |
| public static |
IProtocol SafeLookup(string name)
|
Retrieve a protocol version by name (of one of the static properties on this class) |
public static
IProtocol FromConfiguration(string appSettingsKey)
| Flags | public static | ||||
|---|---|---|---|---|---|
| Return type |
IProtocol
|
||||
| Parameters |
|
public static
IProtocol FromConfiguration()
| Flags | public static |
|---|---|
| Return type |
IProtocol
|
public static
IProtocol FromEnvironment()
| Flags | public static |
|---|---|
| Return type |
IProtocol
|
public static
IProtocol FromEnvironment(string appSettingsKey)
| Flags | public static | ||||
|---|---|---|---|---|---|
| Return type |
IProtocol
|
||||
| Parameters |
|
public static
IProtocol FromEnvironmentVariable()
| Flags | public static |
|---|---|
| Return type |
IProtocol
|
EnvironmentVariableto retrieve an IProtocol instance.
public static
IProtocol Lookup(string name)
| Flags | public static | ||||
|---|---|---|---|---|---|
| Return type |
IProtocol
|
||||
| Parameters |
|
Returns null if no suitable property could be found.
In many cases, FromEnvironment() will be a more appropriate method for applications to call; this method is provided for cases where the caller wishes to know the answer to the question "does a suitable IProtocol property with this name exist, and if so, what is its value?"
public static
IProtocol SafeLookup(string name)
| Flags | public static | ||||
|---|---|---|---|---|---|
| Return type |
IProtocol
|
||||
| Parameters |
|
If the argument is null, Protocols.DefaultProtocol is used. If the protocol variant named is not found, ConfigurationException is thrown.
In many cases, FromEnvironment() will be a more appropriate method for applications to call; this method is provided for cases where the caller wishes to know the answer to the question "does a suitable IProtocol property with this name exist, and if so, what is its value?", with the additional guarantee that if a suitable property does not exist, a ConfigurationException will be thrown.