C# Class Apache.NMS.NMSConnectionFactory

Implementation of a factory for IConnection instances.
Inheritance: IConnectionFactory
Show file Open project: ThorTech/apache-nms Class Usage Examples

Protected Properties

Property Type Description
factory IConnectionFactory
schemaProviderFactoryMap ProviderFactoryInfo>.Dictionary

Public Methods

Method Description
CreateConnection ( ) : IConnection

Creates a new connection.

CreateConnection ( string userName, string password ) : IConnection

Creates a new connection with the given userName and password credentials.

CreateConnectionFactory ( Uri uriProvider ) : IConnectionFactory

Create a connection factory that can create connections for the given scheme in the URI.

NMSConnectionFactory ( Uri uriProvider ) : System

The ConnectionFactory object must define a constructor that takes as a minimum a Uri object. Any additional parameters are optional, but will typically include a Client ID string.

NMSConnectionFactory ( string providerURI ) : System

The ConnectionFactory object must define a constructor that takes as a minimum a Uri object. Any additional parameters are optional, but will typically include a Client ID string.

Private Methods

Method Description
GetConfigSearchPaths ( ) : string[]

Get an array of search paths to look for config files.

GetTypeForScheme ( string scheme ) : Type

Finds the System.Type associated with the given scheme.

LookupConnectionFactoryInfo ( string paths, string scheme, string &assemblyFileName, string &factoryClassName ) : bool

Lookup the connection factory assembly filename and class name. Read an external configuration file that maps scheme to provider implementation. Load XML config files named: nmsprovider-{scheme}.config Following is a sample configuration file named nmsprovider-jms.config. Replace the parenthesis with angle brackets for proper XML formatting. (?xml version="1.0" encoding="utf-8" ?) (configuration) (provider assembly="MyCompany.NMS.JMSProvider.dll" classFactory="MyCompany.NMS.JMSProvider.ConnectionFactory"/) (/configuration) This configuration file would be loaded and parsed when a connection uri with a scheme of 'jms' is used for the provider. In this example the connection string might look like: jms://localhost:7222

MakeParameterArray ( object firstParam ) : object[]

Converts a params object[] collection into a plain object[]s, to pass to the constructor.

NMSConnectionFactory ( ) : System

Static class constructor

Method Details

CreateConnection() public method

Creates a new connection.
public CreateConnection ( ) : IConnection
return IConnection

CreateConnection() public method

Creates a new connection with the given userName and password credentials.
public CreateConnection ( string userName, string password ) : IConnection
userName string The username to use when establishing the connection.
password string The password to use when establishing the connection.
return IConnection

CreateConnectionFactory() public static method

Create a connection factory that can create connections for the given scheme in the URI.
public static CreateConnectionFactory ( Uri uriProvider ) : IConnectionFactory
uriProvider System.Uri The URI for the ActiveMQ provider.
return IConnectionFactory

NMSConnectionFactory() public method

The ConnectionFactory object must define a constructor that takes as a minimum a Uri object. Any additional parameters are optional, but will typically include a Client ID string.
public NMSConnectionFactory ( Uri uriProvider ) : System
uriProvider System.Uri The URI for the ActiveMQ provider.
return System

NMSConnectionFactory() public method

The ConnectionFactory object must define a constructor that takes as a minimum a Uri object. Any additional parameters are optional, but will typically include a Client ID string.
public NMSConnectionFactory ( string providerURI ) : System
providerURI string The URI for the ActiveMQ provider.
return System

Property Details

factory protected property

protected IConnectionFactory factory
return IConnectionFactory

schemaProviderFactoryMap protected static property

protected static Dictionary schemaProviderFactoryMap
return ProviderFactoryInfo>.Dictionary