MAMA - Middleware Agnostic Messaging API More…
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) |
Name | |
---|---|
bool | opened |
Name | |
---|---|
const string | DllName Name of DLL containing Native code |
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:
MAMA currently supports the following middleware platforms:
Tibco TIB/RV versions 6 and 7 (see http://tibco.com) Future supported platforms may include:
static MamaLogLevel GetLogLevelForString(
string level
)
static void setLogCallback(
MamaLogFileCallback2 callback
)
Sets the log callback, this will be invoked every time a log is written in MAMA.
Parameters:
static void setLogSizeCb(
MamaLogFileCallback callback
)
Set callback for log max size exceeded. Applies only to USER policy.
Parameters:
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:
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:
Return: mama_status Whether the call was successful or not
The middleware string. Can be “wmw”, “lbm” or “tibrv”.
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:
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
static MamaPayloadBridge loadPayloadBridge(
string payload
)
Load the payload brige specified by the payload string.
Parameters:
The payload string.
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.
static void openWithProperties(
string path,
string filename
)
Parameters:
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
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.
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.
static void loadDefaultProperties()
Load in default mama.properties from the default WOMBAT_PATH directory.
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
static Dictionary< string, string > getProperties()
Retrieve all configured properties as a dictionary from the current configuration.
static string getVersion(
MamaBridge bridgeImpl
)
Return the version information for the library The version of Mama follows in parenthesis
Return: Version string
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:
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.
static void startAll()
Starts and starts dispatching on all currently loaded MAMA bridges and blocks until they have been stopped.
static void startAll(
bool isBlocking
)
Starts and starts dispatching on all currently loaded MAMA bridges and optionally blocks until they have been stopped.
static void stopAll()
Stops dispatching for all currently started MAMA bridges.
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.
static void startBackground(
MamaBridge bridgeImpl,
MamaStartBackgroundCallback callback
)
Start Mama in the background. This method invokes Mama.start() in a separate thread.
Parameters:
static void stop(
MamaBridge bridgeImpl
)
Stop dispatching on the default event queue for the specified bridge.
Parameters:
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.
static void enableLogging(
MamaLogLevel level
)
Enable logging.
Parameters:
Exceptions:
static void logToFile(
string fileName,
MamaLogLevel level
)
Enable logging, accepts a string representing the file location.
Parameters:
Exceptions:
static void disableLogging()
Disable logging.
static void logDestroy()
Close any underlying log resources.
static void setLogLevel(
MamaLogLevel level
)
Set the log level.
Parameters:
Exceptions:
static MamaLogLevel getLogLevel()
Get the log level.
Return: Log level MamaLogLevel
static void setLogSize(
ulong size
)
Set the log file max size.
Parameters:
Exceptions:
static void setNumLogFiles(
int numFiles
)
Set the max number of log files.
Parameters:
Exceptions:
static void setLogFilePolicy(
MamaLogFilePolicy policy
)
Set logging policy.
Parameters:
static void setAppendToLogFile(
bool append
)
Set append to prevent overwriting existing logfiles.
Parameters:
static bool loggingToFile()
Get logging to file status
Return: Boolean true if logging to file
static void log(
MamaLogLevel level,
string text
)
Add string to mama log at specified mama level.
Parameters:
Exceptions:
static void defaultLogFunction(
MamaLogLevel level,
string text
)
This function will invoke the default log function.
Parameters:
Exceptions:
static void setDefaultQueueHighWatermark(
int highWatermark
)
Set the high watermark for the internal default MAMA queue. See
Parameters:
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.
static void setDefaultQueueLowWatermark(
int lowWatermark
)
Set the low watermark for the internal default MAMA queue. See
Parameters:
mamaQueue_setLowWatermark()
for details.
Currently supported only on Wombat TCP middleware.
static MamaQueue getDefaultEventQueue(
MamaBridge bridgeImpl
)
static bool opened;
static const string DllName = "libmamacmd.dll";
Name of DLL containing Native code
Updated on 2023-03-31 at 15:29:32 +0100