C# Класс Wombat.Mama

MAMA - Middleware Agnostic Messaging API
MAMA provides an abstraction layer over various messaging middleware platforms. In particular, MAMA adds market data semantics to messaging platforms that would otherwise be too limited for use as a market data distribution middleware. Features that MAMA adds to any messaging middleware are: Subscription management (initial values, throttling). Entitlements/permissioning. Data quality. MAMA currently supports the following middleware platforms: Wombat TCP Middleware 29West Latency Busters Messaging (see http://29west.com) Tibco TIB/RV versions 6 and 7 (see http://tibco.com)

Future supported platforms may include: Tibco SmartSockets (see http://tibco.com) Reuters SSL, SFC, TibMsg, etc.

A higher level market data API is also available: the Middleware Agnostic Market Data API (MAMDA). While MAMA provides a field-based abstraction to market data, MAMDA provides smart, specialized data types to deal with specific market data events, such as trades, quotes, order books, etc. MAMDA is particularly suitable for applications such as program trading and tick capture systems, where context is important. MAMA is more suited to applications that don't care about the meaning of fields, such as a simple, field-based market data display application.

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
close ( ) : void

Close MAMA and free all associated resource. MAMA employs a reference count to track multiple calls to Mama.open() and Mama.close(). The count is incremented every time Mama.open() is called and decremented when Mama.close() is called. The resources are not actually released until the count reaches zero. This function is thread safe.

defaultLogFunction ( MamaLogLevel level, string text ) : void

This function will invoke the default log function.

disableLogging ( ) : void

Disable logging.

enableLogging ( MamaLogLevel level ) : void

Enable logging.

getDefaultEventQueue ( Wombat.MamaBridge bridgeImpl ) : Wombat.MamaQueue

getLogLevel ( ) : MamaLogLevel

Get the log level.

getProperty ( string name ) : string

Retrieve a specific property from the API. If the property has not been set, a null value will be returned.

getVersion ( Wombat.MamaBridge bridgeImpl ) : string

Return the version information for the library The version of Mama follows in parenthesis

loadBridge ( string middleware ) : Wombat.MamaBridge

Load the bridge specified by middleware string. If the bridge has already been loaded then the existing bridge instance will be returned.

loadBridge ( string middleware, string path ) : Wombat.MamaBridge

Load the bridge specified by middleware string using the path specified by the user. If the bridge has already been loaded then the existing bridge instance will be returned

loadPayloadBridge ( string payload ) : Wombat.MamaPayloadBridge

Load the payload brige specified by the payload string.

log ( MamaLogLevel level, string text ) : void

Add string to mama log at specified mama level.

logToFile ( string fileName, MamaLogLevel level ) : void

Enable logging, accepts a string representing the file location.

loggingToFile ( ) : bool

Get logging to file status

onNativeLogCallback ( int level, string message ) : void

This handler is called by the C layer whenever a log comes in, it will invoke the managed object.

open ( ) : void

Initialize MAMA. MAMA employs a reference count to track multiple calls to Mama.open() and Mama.close(). The count is incremented every time Mama.open() is called and decremented when Mama.close() is called. The resources are not actually released until the count reaches zero. If entitlements are enabled for the library, the available entitlement server names are read from the entitlement.servers property in the mama.properties file located in the %WOMBAT_PATH% directory. This function is thread safe.

openWithProperties ( string path, string filename ) : void

Initialize MAMA. Allows users of the API to override the default behavior of mama_open() where a file mama.properties is required to be located in the directory specified by %WOMBAT_PATH%. The properties file must have the same structure as a standard mama.properties file. If null is passed as the path the API will look for the properties file on the %WOMBAT_PATH%. If null is passed as the filename the API will look for the default filename of mama.properties

setAppendToLogFile ( bool append ) : void

Set append to prevent overwriting existing logfiles.

setDefaultQueueHighWatermark ( int highWatermark ) : void

Set the high watermark for the internal default MAMA queue. See mamaQueue_setHighWatermark() for details. Although the monitoring callbacks on the default queue cannot be specified for RV, setting of the high water mark is still supported.

setDefaultQueueLowWatermark ( int lowWatermark ) : void

Set the low watermark for the internal default MAMA queue. See mamaQueue_setLowWatermark() for details. Currently supported only on Wombat TCP middleware.

setLogCallback ( MamaLogFileCallback2 callback ) : void

Sets the log callback, this will be invoked every time a log is written in MAMA.

setLogFilePolicy ( MamaLogFilePolicy policy ) : void

Set logging policy.

setLogLevel ( MamaLogLevel level ) : void

Set the log level.

setLogSize ( ulong size ) : void

Set the log file max size.

setLogSizeCb ( MamaLogFileCallback callback ) : void

Set callback for log max size exceeded. Applies only to USER policy.

setNumLogFiles ( int numFiles ) : void

Set the max number of log files.

setProperty ( string name, string value ) : void

Set a specific property for the API. If the property being set has already been given a value from a properties file that value will be replaced. See the example mama.properties provided with the distribution for examples of property formatting. The properties set via this function should be formatted in the same manner as those specified in mama.properties. The strings passed to the function are copied.

start ( Wombat.MamaBridge bridgeImpl ) : void

Start processing messages on the internal queue. This starts Mama's internal throttle, refresh logic, and other internal Mama processes as well as dispatching messages from the internal queue.

Mama.start( ) blocks until an invocation of Mama.stop() occurs. MAMA employs a reference count to track multiple calls to Mama.start() and Mama.stop(). The count is incremented every time Mama.start() is called and decremented when Mama.stop() is called. The first Mama.start() call does not unblock until the count reaches zero. This function is thread safe.

startBackground ( Wombat.MamaBridge bridgeImpl, MamaStartBackgroundCallback callback ) : void

Start Mama in the background. This method invokes Mama.start() in a separate thread.

stop ( Wombat.MamaBridge bridgeImpl ) : void

Stop dispatching on the default event queue for the specified bridge. MAMA employs a reference count to track multiple calls to Mama.start() and Mama.stop(). The count is incremented every time Mama.start() is called and decremented when Mama.stop() is called. The first Mama.start() call does not unblock until the count reaches zero. This function is thread safe.

Приватные методы

Метод Описание
getVersion ( IntPtr bridgeImpl ) : string

Return the version information for the library The version of Mama follows in parenthesis

initGetVersionWrapper ( ) : void
onNativeLogSizeExceeded ( ) : void

This event handler is called whenever the log size is exceeded.

Описание методов

close() публичный статический Метод

Close MAMA and free all associated resource. MAMA employs a reference count to track multiple calls to Mama.open() and Mama.close(). The count is incremented every time Mama.open() is called and decremented when Mama.close() is called. The resources are not actually released until the count reaches zero. This function is thread safe.
public static close ( ) : void
Результат void

defaultLogFunction() публичный статический Метод

This function will invoke the default log function.
/// The logging text has not been supplied. /// /// The logging level is invalid. ///
public static defaultLogFunction ( MamaLogLevel level, string text ) : void
level MamaLogLevel /// The level to log at. ///
text string /// The log message. ///
Результат void

disableLogging() публичный статический Метод

Disable logging.
public static disableLogging ( ) : void
Результат void

enableLogging() публичный статический Метод

Enable logging.
/// The file name contains invalid characters. ///
public static enableLogging ( MamaLogLevel level ) : void
level MamaLogLevel /// The logging level allowed. ///
Результат void

getDefaultEventQueue() публичный статический Метод

public static getDefaultEventQueue ( Wombat.MamaBridge bridgeImpl ) : Wombat.MamaQueue
bridgeImpl Wombat.MamaBridge
Результат Wombat.MamaQueue

getLogLevel() публичный статический Метод

Get the log level.
public static getLogLevel ( ) : MamaLogLevel
Результат MamaLogLevel

getProperty() публичный статический Метод

Retrieve a specific property from the API. If the property has not been set, a null value will be returned.
public static getProperty ( string name ) : string
name string
Результат string

getVersion() публичный статический Метод

Return the version information for the library The version of Mama follows in parenthesis
public static getVersion ( Wombat.MamaBridge bridgeImpl ) : string
bridgeImpl Wombat.MamaBridge
Результат string

loadBridge() публичный статический Метод

Load the bridge specified by middleware string. If the bridge has already been loaded then the existing bridge instance will be returned.
public static loadBridge ( string middleware ) : Wombat.MamaBridge
middleware string
Результат Wombat.MamaBridge

loadBridge() публичный статический Метод

Load the bridge specified by middleware string using the path specified by the user. If the bridge has already been loaded then the existing bridge instance will be returned
public static loadBridge ( string middleware, string path ) : Wombat.MamaBridge
middleware string
path string
Результат Wombat.MamaBridge

loadPayloadBridge() публичный статический Метод

Load the payload brige specified by the payload string.
public static loadPayloadBridge ( string payload ) : Wombat.MamaPayloadBridge
payload string
Результат Wombat.MamaPayloadBridge

log() публичный статический Метод

Add string to mama log at specified mama level.
/// The logging level is invalid. ///
public static log ( MamaLogLevel level, string text ) : void
level MamaLogLevel /// The level to log at. ///
text string /// The log message. ///
Результат void

logToFile() публичный статический Метод

Enable logging, accepts a string representing the file location.
/// The file name is null or blank. /// /// The file name contains invalid characters. ///
public static logToFile ( string fileName, MamaLogLevel level ) : void
fileName string /// The full path to the log file. ///
level MamaLogLevel /// The logging level allowed. ///
Результат void

loggingToFile() публичный статический Метод

Get logging to file status
public static loggingToFile ( ) : bool
Результат bool

onNativeLogCallback() публичный статический Метод

This handler is called by the C layer whenever a log comes in, it will invoke the managed object.
public static onNativeLogCallback ( int level, string message ) : void
level int /// The log level. ///
message string /// The log message. ///
Результат void

open() публичный статический Метод

Initialize MAMA. MAMA employs a reference count to track multiple calls to Mama.open() and Mama.close(). The count is incremented every time Mama.open() is called and decremented when Mama.close() is called. The resources are not actually released until the count reaches zero. If entitlements are enabled for the library, the available entitlement server names are read from the entitlement.servers property in the mama.properties file located in the %WOMBAT_PATH% directory. This function is thread safe.
public static open ( ) : void
Результат void

openWithProperties() публичный статический Метод

Initialize MAMA. Allows users of the API to override the default behavior of mama_open() where a file mama.properties is required to be located in the directory specified by %WOMBAT_PATH%. The properties file must have the same structure as a standard mama.properties file. If null is passed as the path the API will look for the properties file on the %WOMBAT_PATH%. If null is passed as the filename the API will look for the default filename of mama.properties
public static openWithProperties ( string path, string filename ) : void
path string /// Fully qualified path to the directory containing the properties /// file ///
filename string /// The name of the file containing MAMA properties. ///
Результат void

setAppendToLogFile() публичный статический Метод

Set append to prevent overwriting existing logfiles.
public static setAppendToLogFile ( bool append ) : void
append bool
Результат void

setDefaultQueueHighWatermark() публичный статический Метод

Set the high watermark for the internal default MAMA queue. See mamaQueue_setHighWatermark() for details. Although the monitoring callbacks on the default queue cannot be specified for RV, setting of the high water mark is still supported.
public static setDefaultQueueHighWatermark ( int highWatermark ) : void
highWatermark int
Результат void

setDefaultQueueLowWatermark() публичный статический Метод

Set the low watermark for the internal default MAMA queue. See mamaQueue_setLowWatermark() for details. Currently supported only on Wombat TCP middleware.
public static setDefaultQueueLowWatermark ( int lowWatermark ) : void
lowWatermark int
Результат void

setLogCallback() публичный статический Метод

Sets the log callback, this will be invoked every time a log is written in MAMA.
public static setLogCallback ( MamaLogFileCallback2 callback ) : void
callback MamaLogFileCallback2 /// The callback to invoke. ///
Результат void

setLogFilePolicy() публичный статический Метод

Set logging policy.
public static setLogFilePolicy ( MamaLogFilePolicy policy ) : void
policy MamaLogFilePolicy
Результат void

setLogLevel() публичный статический Метод

Set the log level.
/// The file name contains invalid characters. ///
public static setLogLevel ( MamaLogLevel level ) : void
level MamaLogLevel /// The logging level allowed. ///
Результат void

setLogSize() публичный статический Метод

Set the log file max size.
/// Thrown if the size is 0. ///
public static setLogSize ( ulong size ) : void
size ulong
Результат void

setLogSizeCb() публичный статический Метод

Set callback for log max size exceeded. Applies only to USER policy.
public static setLogSizeCb ( MamaLogFileCallback callback ) : void
callback MamaLogFileCallback /// The callback object to invoke whenever the log size is exceeded. ///
Результат void

setNumLogFiles() публичный статический Метод

Set the max number of log files.
/// Thrown if the number of files is 0 or less. ///
public static setNumLogFiles ( int numFiles ) : void
numFiles int
Результат void

setProperty() публичный статический Метод

Set a specific property for the API. If the property being set has already been given a value from a properties file that value will be replaced. See the example mama.properties provided with the distribution for examples of property formatting. The properties set via this function should be formatted in the same manner as those specified in mama.properties. The strings passed to the function are copied.
public static setProperty ( string name, string value ) : void
name string
value string
Результат void

start() публичный статический Метод

Start processing messages on the internal queue. This starts Mama's internal throttle, refresh logic, and other internal Mama processes as well as dispatching messages from the internal queue.

Mama.start( ) blocks until an invocation of Mama.stop() occurs. MAMA employs a reference count to track multiple calls to Mama.start() and Mama.stop(). The count is incremented every time Mama.start() is called and decremented when Mama.stop() is called. The first Mama.start() call does not unblock until the count reaches zero. This function is thread safe.

public static start ( Wombat.MamaBridge bridgeImpl ) : void
bridgeImpl Wombat.MamaBridge /// The bridge specific structure. ///
Результат void

startBackground() публичный статический Метод

Start Mama in the background. This method invokes Mama.start() in a separate thread.
public static startBackground ( Wombat.MamaBridge bridgeImpl, MamaStartBackgroundCallback callback ) : void
bridgeImpl Wombat.MamaBridge /// The bridge specific structure. ///
callback MamaStartBackgroundCallback /// The callback for asynchronous status. ///
Результат void

stop() публичный статический Метод

Stop dispatching on the default event queue for the specified bridge. MAMA employs a reference count to track multiple calls to Mama.start() and Mama.stop(). The count is incremented every time Mama.start() is called and decremented when Mama.stop() is called. The first Mama.start() call does not unblock until the count reaches zero. This function is thread safe.
public static stop ( Wombat.MamaBridge bridgeImpl ) : void
bridgeImpl Wombat.MamaBridge /// The bridge specific structure. ///
Результат void