public class Protocols

Summary

Concrete, predefined IProtocol instances ready for use with ConnectionFactory.

Remarks

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.

Field Summary

Flags Type Name Summary
public initonly static string DefaultAppSettingsKey

The default App.config appSettings key used by FromConfiguration and FromEnvironment. At the time of writing, "AMQP_PROTOCOL".

public initonly static string EnvironmentVariable

The environment variable read by FromEnvironmentVariable() and FromEnvironment(). At the time of writing, "AMQP_PROTOCOL".

Property Summary

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 AMQP_0_9_1 (r)

(undocumented)

public static IProtocol DefaultProtocol (r)

Retrieve the current default protocol variant (currently AMQP_0_8)

Method Summary

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 EnvironmentVariable to retrieve an IProtocol instance.

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)

Field Detail

public initonly static string DefaultAppSettingsKey

Summary

The default App.config appSettings key used by FromConfiguration and FromEnvironment. At the time of writing, "AMQP_PROTOCOL".

public initonly static string EnvironmentVariable

Summary

The environment variable read by FromEnvironmentVariable() and FromEnvironment(). At the time of writing, "AMQP_PROTOCOL".

Property Detail

public static IProtocol AMQP_0_8 (r)

Summary

Protocol version 0-8 as standardised.

public static IProtocol AMQP_0_8_QPID (r)

Summary

Protocol version 0-8, as modified by QPid.

public static IProtocol AMQP_0_9 (r)

Summary

Protocol version 0-9 as standardised (omitting sections marked "WIP", "work in progress", including in particular the Message class of operations).

public static IProtocol AMQP_0_9_1 (r)

public static IProtocol DefaultProtocol (r)

Summary

Retrieve the current default protocol variant (currently AMQP_0_8)

Method Detail

FromConfiguration

public static IProtocol FromConfiguration(string appSettingsKey)

Flags public static
Return type IProtocol
Parameters
Name Type
appSettingsKey string

Summary

Uses App.config's appSettings section to retrieve an IProtocol instance.

Remarks

If the appSettings key is missing, Protocols.DefaultProtocol is used. If the protocol variant named is not found, ConfigurationException is thrown.

Exception

FromConfiguration

public static IProtocol FromConfiguration()

Flags public static
Return type IProtocol

Summary

Returns FromConfiguration(DefaultAppSettingsKey).

FromEnvironment

public static IProtocol FromEnvironment()

Flags public static
Return type IProtocol

Summary

Returns FromEnvironment(DefaultAppSettingsKey).

FromEnvironment

public static IProtocol FromEnvironment(string appSettingsKey)

Flags public static
Return type IProtocol
Parameters
Name Type
appSettingsKey string

Summary

Tries FromConfiguration() first, followed by FromEnvironmentVariable() if no setting was found in the App.config.

Exception

FromEnvironmentVariable

public static IProtocol FromEnvironmentVariable()

Flags public static
Return type IProtocol

Summary

Uses the process environment variable
EnvironmentVariable
to retrieve an IProtocol instance.

Remarks

If the environment variable is unset, Protocols.DefaultProtocol is used. If the protocol variant named is not found, ConfigurationException is thrown.

Exception

Lookup

public static IProtocol Lookup(string name)

Flags public static
Return type IProtocol
Parameters
Name Type
name string

Summary

Low-level method for retrieving a protocol version by name (of one of the static properties on this class)

Remarks

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?"

SafeLookup

public static IProtocol SafeLookup(string name)

Flags public static
Return type IProtocol
Parameters
Name Type
name string

Summary

Retrieve a protocol version by name (of one of the static properties on this class)

Remarks

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.

Exception