Classes Files

com::wombat::mama::Mama

Public Functions

  Name
native MamaBridge loadBridge(String middleware, String path)
MamaBridge loadBridge(String middleware)
native MamaPayloadBridge loadPayloadBridge(String name)
native MamaQueue getDefaultQueue(MamaBridge bridge)
native void open()
native void open(String path, String filename)
native void start(MamaBridge bridge)
native void startAll(boolean isBlocking)
void startAll()
native void startBackground(MamaBridge bridge, MamaStartBackgroundCallback callback)
native void stop(MamaBridge bridge)
native void stopAll()
native void close()
void enableLogging(Level level)
void setLogCallback(MamaLogFileCallback2 callback)
void log(MamaLogLevel level, String message)
void enableLogging(Level level, String file)
void logToFile(String file, Level level)
void disableLogging()
Level getLogLevel()
void setLogLevel(Level level)
void setLogFilePolicy(MamaLogFilePolicy policy)
native String getProperty(String name)
native void loadDefaultProperties()
String getProperty(String name, String defaultValue)
Map< String, String > getProperties()
native void setProperty(String name, String value)
native void setLogSize(long size)
native void setNumLogFiles(int numFiles)
native void setAppendToLogFile(boolean append)
native boolean loggingToFile()
native void setLogSizeCb(MamaLogFileCallback callback)
MamaLogLevel getMamaLogLevelForLevel(Level level)
int getMamaLevelForLevel(Level level)
native void setApplicationName(String applicationName)
native void setApplicationClassName(String applicationClassName)
native String getApplicationName()
native String getApplicationClassName()
native String getCUserName()
native String getCHostName()
String getUserName()
String getHostName()
String getIpAddress()
String getVersion(MamaBridge bridge)
native int getLastErrorCode()
String getLastErrorText()

Public Functions Documentation

function loadBridge

static native MamaBridge loadBridge(
    String middleware,
    String path
)

function loadBridge

static inline MamaBridge loadBridge(
    String middleware
)

function loadPayloadBridge

static native MamaPayloadBridge loadPayloadBridge(
    String name
)

function getDefaultQueue

static native MamaQueue getDefaultQueue(
    MamaBridge bridge
)

function open

static native 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 open

static native void open(
    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 start

static native void start(
    MamaBridge bridge
)

Parameters:

  • bridge The bridge specific structure.

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.

function startAll

static native void startAll(
    boolean isBlocking
)

Parameters:

  • isBlocking Whether to start blocking or run in background

Calls Mama::start for all currently loaded middleware bridges

This function is thread safe.

function startAll

static inline void startAll()

Calls Mama::start for all currently loaded middleware bridges and blocks.

This function is thread safe.

function startBackground

static native void startBackground(
    MamaBridge bridge,
    MamaStartBackgroundCallback callback
)

Parameters:

  • bridge The middleware-specific bridge structure
  • callback The callback for asynchronous status.

Start processing MAMA internal events in the background. This method invokes Mama::start () in a separate thread.

function stop

static native void stop(
    MamaBridge bridge
)

Parameters:

  • bridge The bridge specific structure.

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.

function stopAll

static native void stopAll()

Stop dispatching on the default event queue for all bridges.

function close

static native 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 enableLogging

static inline void enableLogging(
    Level level
)

function setLogCallback

static inline void setLogCallback(
    MamaLogFileCallback2 callback
)

function log

static inline void log(
    MamaLogLevel level,
    String message
)

function enableLogging

static inline void enableLogging(
    Level level,
    String file
)

function logToFile

static inline void logToFile(
    String file,
    Level level
)

function disableLogging

static inline void disableLogging()

function getLogLevel

static inline Level getLogLevel()

function setLogLevel

static inline void setLogLevel(
    Level level
)

function setLogFilePolicy

static inline void setLogFilePolicy(
    MamaLogFilePolicy policy
)

function getProperty

static native String getProperty(
    String name
)

Parameters:

  • name The name of the property to retrieve.

Return: the value of the property or NULL if unset.

Retrieve a specific property from the API.

If the property has not been set, a NULL value will be returned.

function loadDefaultProperties

static native void loadDefaultProperties()

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

function getProperty

static inline String getProperty(
    String name,
    String defaultValue
)

Parameters:

  • name The name of the property to retrieve.
  • defaultValue The value to return if this property does not exist.

Return: the value of the property or NULL if unset.

Retrieve a specific property from the API.

If the property has not been set, the default value will be returned.

function getProperties

static inline Map< String, String > getProperties()

Return: A map of all currently configured properties

Retrieve a list of all configured properties in key -> value format

function setProperty

static native void setProperty(
    String name,
    String value
)

function setLogSize

static native void setLogSize(
    long size
)

function setNumLogFiles

static native void setNumLogFiles(
    int numFiles
)

function setAppendToLogFile

static native void setAppendToLogFile(
    boolean append
)

function loggingToFile

static native boolean loggingToFile()

function setLogSizeCb

static native void setLogSizeCb(
    MamaLogFileCallback callback
)

function getMamaLogLevelForLevel

static inline MamaLogLevel getMamaLogLevelForLevel(
    Level level
)

function getMamaLevelForLevel

static inline int getMamaLevelForLevel(
    Level level
)

function setApplicationName

static native void setApplicationName(
    String applicationName
)

function setApplicationClassName

static native void setApplicationClassName(
    String applicationClassName
)

function getApplicationName

static native String getApplicationName()

function getApplicationClassName

static native String getApplicationClassName()

function getCUserName

static native String getCUserName()

function getCHostName

static native String getCHostName()

function getUserName

static inline String getUserName()

Return: String the user name

getUserName get the user name for the application

function getHostName

static inline String getHostName()

Return: String the hostname

getHostName get the host name of the machine

function getIpAddress

static inline String getIpAddress()

Return: String the IP address

getIpAddress get the ip address of the machine

function getVersion

static inline String getVersion(
    MamaBridge bridge
)

function getLastErrorCode

static native int getLastErrorCode()

function getLastErrorText

static inline String getLastErrorText()

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