Classes Files

com::wombat::mama::MamaSubscription

Public Functions

  Name
  MamaSubscription()
void createSubscription(MamaSubscriptionCallback callback, MamaQueue queue, MamaSource source, String symbol, Object closure)
MamaDictionary createDictionarySubscription(MamaDictionaryCallback callback, MamaQueue queue, MamaSource source)
MamaDictionary createDictionarySubscription(MamaDictionaryCallback callback, MamaQueue queue, MamaSource source, double timeout, int retries)
void createSnapshotSubscription(MamaSubscriptionCallback callback, MamaQueue queue, MamaSource source, String symbol, Object closure)
Object getClosure()
long getPointerVal()
MamaSource getSource()
MamaQueue getQueue()
MamaSubscriptionState getState()
void setupSubscription(MamaSubscriptionCallback callback, MamaQueue queue, MamaSource source, String symbol, Object closure)
void setAppDataType(MamaMdDataType type)
MamaMdDataType getAppDataType()
void setDebugLevel(Level level)
void setMessageQualifierFilter(MamaMsgQualifier qualifier)
MamaMsgQualifier getMessageQualifierFilter()
void setSubscriptionType(MamaSubscriptionType type)
MamaSubscriptionType getSubscriptionType()
MamaTransport getTransport()
native void activate()
native void deactivate()
native void deallocate()
native void destroy()
native void destroyEx()
native boolean getReceivedInitial()
native String getSubscSource()
native String getSymbol()
native double getTimeout()
native boolean isActive()
native boolean isValid()
native void setRequiresInitial(boolean value)
native void setTimeout(double timeout)
native Object getItemClosure()
native int getPreInitialCacheSize()
native boolean getRecoverGaps()
native boolean getRequiresInitital()
native int getRetries()
native short getServiceLevel()
native long getServiceLevelOptions()
native void setPreInitialCacheSize(int size)
native void setItemClosure(Object closure)
native void setRecoverGaps(boolean recover)
native void setServiceLevel(short level, long options)
native void setRetries(int retries)

Protected Functions

  Name
void finalize()

Public Attributes

  Name
final int DEFAULT_RETRIES
final double DEFAULT_TIMEOUT

Public Functions Documentation

function MamaSubscription

inline MamaSubscription()

The constructor allocates the underlying C subscription.

function createSubscription

inline void createSubscription(
    MamaSubscriptionCallback callback,
    MamaQueue queue,
    MamaSource source,
    String symbol,
    Object closure
)

Parameters:

  • callback The object implementing the callback functions.
  • queue The MamaQueue.
  • source The MamaSource identifying the publisher for this symbol.
  • symbol The symbol name.
  • closure The closure will be passed to subsequent callback invocations for this subscription.

Create and activate subscription. This is effectively a pair of calls to mamaSubscription_setup() and mamaSubscription_activate().

function createDictionarySubscription

inline MamaDictionary createDictionarySubscription(
    MamaDictionaryCallback callback,
    MamaQueue queue,
    MamaSource source
)

Parameters:

  • callback The object implementing the callback functions, this can also be an instance of MamaSubscriptionCallbackEx to be notified when the subscription has been destroyed.
  • queue The MamaQueue.
  • source The MamaSource identifying the publisher for this symbol.

Create a dictionary subscription using default values for the timeout and number of retries.

function createDictionarySubscription

inline MamaDictionary createDictionarySubscription(
    MamaDictionaryCallback callback,
    MamaQueue queue,
    MamaSource source,
    double timeout,
    int retries
)

Parameters:

  • callback The object implementing the callback functions.
  • queue The MamaQueue.
  • source The MamaSource identifying the publisher for this symbol.
  • timeout The timeout value in seconds.
  • retries The number of retries.

Create a dictionary subscription using default values for the timeout and number of retries.

function createSnapshotSubscription

inline void createSnapshotSubscription(
    MamaSubscriptionCallback callback,
    MamaQueue queue,
    MamaSource source,
    String symbol,
    Object closure
)

Parameters:

  • callback The object implementing the callback functions.
  • queue The MamaQueue.
  • source The MamaSource identifying the publisher for this symbol.
  • symbol The symbol name.
  • closure The closure will be passed to subsequent callback invocations for this subscription.

Create a snapshot subscription for initial value only (no updates). This function is equivalent to mamaSubscription_create () with svcLevel set to MAMA_SERVICE_LEVEL_SNAPSHOT and default arguments for type, svcLevelOpt, requiresInitial, retries, timeout.

function getClosure

inline Object getClosure()

Return: The closure object.

This function returns the closure supplied to the createSubscription function.

function getPointerVal

inline long getPointerVal()

Return: The pointer.

This function returns the pointer to the underlying C subscription.

function getSource

inline MamaSource getSource()

Return: The MamaSource object.

Return the source associated with the subscription.

function getQueue

inline MamaQueue getQueue()

Return: The MamaQueue object

Return the queue used for this subscription

function getState

inline MamaSubscriptionState getState()

Return: The MamaSubscriptionState that represents the current state of the subscription.

This function returns the current state of the subscription as one of the MamaSubscriptionState instances, see this class for more information.

function setupSubscription

inline void setupSubscription(
    MamaSubscriptionCallback callback,
    MamaQueue queue,
    MamaSource source,
    String symbol,
    Object closure
)

Parameters:

  • callback The object implementing the callback functions.
  • queue The MamaQueue.
  • source The MamaSource identifying the publisher for this symbol.
  • symbol The symbol name.
  • closure The closure will be passed to subsequent callback invocations for this subscription.

Setup a basic subscription without marketdata semantics. Note that activate must still be called.

function setAppDataType

inline void setAppDataType(
    MamaMdDataType type
)

function getAppDataType

inline MamaMdDataType getAppDataType()

function setDebugLevel

inline void setDebugLevel(
    Level level
)

function setMessageQualifierFilter

inline void setMessageQualifierFilter(
    MamaMsgQualifier qualifier
)

function getMessageQualifierFilter

inline MamaMsgQualifier getMessageQualifierFilter()

function setSubscriptionType

inline void setSubscriptionType(
    MamaSubscriptionType type
)

function getSubscriptionType

inline MamaSubscriptionType getSubscriptionType()

function getTransport

inline MamaTransport getTransport()

function activate

native void activate()

Activate a subscription that has been set up by calling MamaSubscription.setup. Subscription creation actually occurs on the throttle queue. An individual subscription cannot be assumed to be fully created until its onCreate() callback has been successfully invoked. The subscription rate can be governed via the MamaTransport.setOutboundThrottle () function. Any subscription properties should be set prior to calling this function.

function deactivate

native void deactivate()

Deactivate a subscription. The subscription can be reactivated if desired using MamaSubscription.activate(). Note that the subscription will not be fully deactivated until the onDestroy callback is received.

function deallocate

native void deallocate()

De-allocates the underlying C subscription. This can be used to reduce time during finalization.

function destroy

native void destroy()

This function will destroy the subscription, it must be called from the same thread that is processing the queue for the subscription. Use destroyEx to destroy the subscription from any thread. Note that the subscription will not be fully destroyed until the onDestroy callback is received.

function destroyEx

native void destroyEx()

This function will destroy the subscription and can be called from any thread. Note that the subscription will not be fully destroyed until the onDestroy callback is received. To destroy from the dispatching thread the destroy function should be used in preference.

function getReceivedInitial

native boolean getReceivedInitial()

Return: True if an initial has been received.

Get whether we have received an Initial.

function getSubscSource

native String getSubscSource()

Return: The source string.

Return the source for this subscription.

function getSymbol

native String getSymbol()

Return: The symbol string.

Return the symbol for this subscription.

function getTimeout

native double getTimeout()

Return: The timeout in seconds.

To return the subscription timeout.

function isActive

native boolean isActive()

Return: whether the subscription is valid.

Returns whether the subscription is valid, note that this function has been deprecated, use mamaSubscription_getState instead.

function isValid

native boolean isValid()

Return: whether the subscription is valid.

Returns whether the subscription is valid, note that this function has been deprecated, use mamaSubscription_getState instead.

function setRequiresInitial

native void setRequiresInitial(
    boolean value
)

Parameters:

  • value True if the subscription needs an initial.

Set whether subscriptoin requires initial value.

function setTimeout

native void setTimeout(
    double timeout
)

Parameters:

  • timeout The timeout in seconds.

Set the timeout for this subscription.

function getItemClosure

native Object getItemClosure()

function getPreInitialCacheSize

native int getPreInitialCacheSize()

function getRecoverGaps

native boolean getRecoverGaps()

function getRequiresInitital

native boolean getRequiresInitital()

function getRetries

native int getRetries()

function getServiceLevel

native short getServiceLevel()

function getServiceLevelOptions

native long getServiceLevelOptions()

function setPreInitialCacheSize

native void setPreInitialCacheSize(
    int size
)

function setItemClosure

native void setItemClosure(
    Object closure
)

function setRecoverGaps

native void setRecoverGaps(
    boolean recover
)

function setServiceLevel

native void setServiceLevel(
    short level,
    long options
)

function setRetries

native void setRetries(
    int retries
)

Protected Functions Documentation

function finalize

inline void finalize()

Exceptions:

  • Throwable A MamaException will be thrown if the underlying subscription could not be de-allocated.

The finalizer deallocates the underlying C subscription.

Public Attributes Documentation

variable DEFAULT_RETRIES

static final int DEFAULT_RETRIES = 2;

variable DEFAULT_TIMEOUT

static final double DEFAULT_TIMEOUT = 10.0;

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