Classes Files

Wombat::Mama

MAMA - Middleware Agnostic Messaging API More…

Public Functions

  Name
MamaLogLevel GetLogLevelForString(string level)
void setLogCallback(MamaLogFileCallback2 callback)
Sets the log callback, this will be invoked every time a log is written in MAMA.
void setLogSizeCb(MamaLogFileCallback callback)
Set callback for log max size exceeded. Applies only to USER policy.
void onNativeLogCallback(int level, string message)
This handler is called by the C layer whenever a log comes in, it will invoke the managed object.
MamaBridge loadBridge(string middleware)
Load the bridge specified by middleware string. If the bridge has already been loaded then the existing bridge instance will be returned.
MamaBridge loadBridge(string middleware, string path)
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
MamaPayloadBridge loadPayloadBridge(string payload)
Load the payload brige specified by the payload string.
void open()
void openWithProperties(string path, string filename)
void setProperty(string name, string value)
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.
string getProperty(string name)
Retrieve a specific property from the API. If the property has not been set, a null value will be returned.
void loadDefaultProperties()
Load in default mama.properties from the default WOMBAT_PATH directory.
string getProperty(string name, string defaultValue)
Retrieve a specific property from the API. If the property has not been set, the default value will be returned
Dictionary< string, string > getProperties()
Retrieve all configured properties as a dictionary from the current configuration.
string getVersion(MamaBridge bridgeImpl)
Return the version information for the library The version of Mama follows in parenthesis
void start(MamaBridge bridgeImpl)
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.
void startAll()
Starts and starts dispatching on all currently loaded MAMA bridges and blocks until they have been stopped.
void startAll(bool isBlocking)
Starts and starts dispatching on all currently loaded MAMA bridges and optionally blocks until they have been stopped.
void stopAll()
Stops dispatching for all currently started MAMA bridges.
void close()
void startBackground(MamaBridge bridgeImpl, MamaStartBackgroundCallback callback)
Start Mama in the background. This method invokes Mama.start() in a separate thread.
void stop(MamaBridge bridgeImpl)
Stop dispatching on the default event queue for the specified bridge.
void enableLogging(MamaLogLevel level)
Enable logging.
void logToFile(string fileName, MamaLogLevel level)
Enable logging, accepts a string representing the file location.
void disableLogging()
Disable logging.
void logDestroy()
Close any underlying log resources.
void setLogLevel(MamaLogLevel level)
Set the log level.
MamaLogLevel getLogLevel()
Get the log level.
void setLogSize(ulong size)
Set the log file max size.
void setNumLogFiles(int numFiles)
Set the max number of log files.
void setLogFilePolicy(MamaLogFilePolicy policy)
Set logging policy.
void setAppendToLogFile(bool append)
Set append to prevent overwriting existing logfiles.
bool loggingToFile()
Get logging to file status
void log(MamaLogLevel level, string text)
Add string to mama log at specified mama level.
void defaultLogFunction(MamaLogLevel level, string text)
This function will invoke the default log function.
void setDefaultQueueHighWatermark(int highWatermark)
Set the high watermark for the internal default MAMA queue. See
void setDefaultQueueLowWatermark(int lowWatermark)
Set the low watermark for the internal default MAMA queue. See
MamaQueue getDefaultEventQueue(MamaBridge bridgeImpl)

Public Properties

  Name
bool opened

Public Attributes

  Name
const string DllName
Name of DLL containing Native code

Detailed Description

class 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.

Public Functions Documentation

function GetLogLevelForString

static MamaLogLevel GetLogLevelForString(
    string level
)

function setLogCallback

static void setLogCallback(
    MamaLogFileCallback2 callback
)

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

Parameters:

  • callback The callback to invoke.

function setLogSizeCb

static void setLogSizeCb(
    MamaLogFileCallback callback
)

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

Parameters:

  • callback The callback object to invoke whenever the log size is exceeded.

function onNativeLogCallback

static void onNativeLogCallback(
    int level,
    string message
)

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

Parameters:

  • level The log level.
  • message The log message.

function loadBridge

static MamaBridge loadBridge(
    string middleware
)

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

Parameters:

  • middleware

Return: mama_status Whether the call was successful or not

The middleware string. Can be “wmw”, “lbm” or “tibrv”.

function loadBridge

static MamaBridge loadBridge(
    string middleware,
    string path
)

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

Parameters:

  • middleware
  • path

Return: mama_status Whether the call was successful or not

The middleware string. Can be “wmw”, “lbm” or “tibrv”. The path to the bridge library

function loadPayloadBridge

static MamaPayloadBridge loadPayloadBridge(
    string payload
)

Load the payload brige specified by the payload string.

Parameters:

  • payload

The payload string.

function open

static 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.

function openWithProperties

static void openWithProperties(
    string path,
    string filename
)

Parameters:

  • path Fully qualified path to the directory containing the properties file
  • filename The name of the file containing MAMA properties.

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

function setProperty

static void setProperty(
    string name,
    string value
)

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.

function getProperty

static string getProperty(
    string name
)

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

function loadDefaultProperties

static void loadDefaultProperties()

Load in default mama.properties from the default WOMBAT_PATH directory.

function getProperty

static string getProperty(
    string name,
    string defaultValue
)

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

function getProperties

static Dictionary< string, string > getProperties()

Retrieve all configured properties as a dictionary from the current configuration.

function getVersion

static string getVersion(
    MamaBridge bridgeImpl
)

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

Return: Version string

function start

static void start(
    MamaBridge bridgeImpl
)

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.

Parameters:

  • bridgeImpl The bridge specific structure.

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.

function startAll

static void startAll()

Starts and starts dispatching on all currently loaded MAMA bridges and blocks until they have been stopped.

function startAll

static void startAll(
    bool isBlocking
)

Starts and starts dispatching on all currently loaded MAMA bridges and optionally blocks until they have been stopped.

function stopAll

static void stopAll()

Stops dispatching for all currently started MAMA bridges.

function close

static void 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.

function startBackground

static void startBackground(
    MamaBridge bridgeImpl,
    MamaStartBackgroundCallback callback
)

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

Parameters:

  • bridgeImpl The bridge specific structure.
  • callback The callback for asynchronous status.

function stop

static void stop(
    MamaBridge bridgeImpl
)

Stop dispatching on the default event queue for the specified bridge.

Parameters:

  • bridgeImpl The bridge specific structure.

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.

function enableLogging

static void enableLogging(
    MamaLogLevel level
)

Enable logging.

Parameters:

  • level The logging level allowed.

Exceptions:

  • ArgumentOutOfRangeException The file name contains invalid characters.

function logToFile

static void logToFile(
    string fileName,
    MamaLogLevel level
)

Enable logging, accepts a string representing the file location.

Parameters:

  • fileName The full path to the log file.
  • level The logging level allowed.

Exceptions:

  • ArgumentNullException The file name is null or blank.
  • ArgumentOutOfRangeException The file name contains invalid characters.

function disableLogging

static void disableLogging()

Disable logging.

function logDestroy

static void logDestroy()

Close any underlying log resources.

function setLogLevel

static void setLogLevel(
    MamaLogLevel level
)

Set the log level.

Parameters:

  • level The logging level allowed.

Exceptions:

  • ArgumentOutOfRangeException The file name contains invalid characters.

function getLogLevel

static MamaLogLevel getLogLevel()

Get the log level.

Return: Log level MamaLogLevel

function setLogSize

static void setLogSize(
    ulong size
)

Set the log file max size.

Parameters:

  • size

Exceptions:

  • ArgumentOutOfRangeException Thrown if the size is 0.

function setNumLogFiles

static void setNumLogFiles(
    int numFiles
)

Set the max number of log files.

Parameters:

  • numFiles

Exceptions:

  • ArgumentOutOfRangeException Thrown if the number of files is 0 or less.

function setLogFilePolicy

static void setLogFilePolicy(
    MamaLogFilePolicy policy
)

Set logging policy.

Parameters:

  • policy

function setAppendToLogFile

static void setAppendToLogFile(
    bool append
)

Set append to prevent overwriting existing logfiles.

Parameters:

  • append

function loggingToFile

static bool loggingToFile()

Get logging to file status

Return: Boolean true if logging to file

function log

static void log(
    MamaLogLevel level,
    string text
)

Add string to mama log at specified mama level.

Parameters:

  • level The level to log at.
  • text The log message.

Exceptions:

  • ArgumentOutOfRangeException The logging level is invalid.

function defaultLogFunction

static void defaultLogFunction(
    MamaLogLevel level,
    string text
)

This function will invoke the default log function.

Parameters:

  • level The level to log at.
  • text The log message.

Exceptions:

  • ArgumentNullException The logging text has not been supplied.
  • ArgumentOutOfRangeException The logging level is invalid.

function setDefaultQueueHighWatermark

static void setDefaultQueueHighWatermark(
    int highWatermark
)

Set the high watermark for the internal default MAMA queue. See

Parameters:

  • highWatermark

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.

function setDefaultQueueLowWatermark

static void setDefaultQueueLowWatermark(
    int lowWatermark
)

Set the low watermark for the internal default MAMA queue. See

Parameters:

  • lowWatermark

mamaQueue_setLowWatermark() for details.

Currently supported only on Wombat TCP middleware.

function getDefaultEventQueue

static MamaQueue getDefaultEventQueue(
    MamaBridge bridgeImpl
)

Public Property Documentation

property opened

static bool opened;

Public Attributes Documentation

variable DllName

static const string DllName = "libmamacmd.dll";

Name of DLL containing Native code


Updated on 2023-03-31 at 15:29:32 +0100