Classes Files

Wombat::MamdaSubscription

A MamdaSubscription is used to register interest in a particular symbol and source. A MamaTransport is required to actually activate the subscription. More…

Inherits from Wombat.MamdaResourceContainer, IDisposable

Public Functions

  Name
  MamdaSubscription()
Default constructor. The subscription is not created until either create() or activate() is called.
void create(MamaTransport transport, MamaQueue queue, string source, string symbol, object closure)
Create and activate a subscription. Any properties for the subscription should be set prior to calling this method.
void setSource(string source)
Set the data source name. Do this before calling activate().
void setSymbol(string symbol)
Set the symbol. Do this before calling activate().
void setTransport(MamaTransport transport)
Set the MAMA transport. Do this before calling activate().
void setQueue(MamaQueue queue)
Set the MAMA queue. Do this before calling activate().
void setType(mamaSubscriptionType type)
Set the subscrption type. Do this before calling activate() Default is
void setServiceLevel(mamaServiceLevel serviceLevel, int serviceLevelOpt)
Set the MAMA service level. In the future, certain service levels may have an optional argument (e.g., an interval for conflated data). Do this before calling activate(). Default value is
void setRequireInitial(bool require)
Set whether an initial value is required. Do this before calling activate(). Default is
void setTimeout(double timeout)
Set the timeout (in seconds) for this subscription. Do this before calling activate(). Default is 10 seconds.
void setRetries(int retries)
Set the retries for this subscription. Do this before calling activate(). Default is 10 seconds.
void setClosure(Object closure)
Set the closure. Do this before calling activate().
void addMsgListener(MamdaMsgListener listener)
Add a listener for regular messages.
ArrayList getMsgListeners()
get a listener for regular messages.
void addStaleListener(MamdaStaleListener listener)
Add a listener for changes in stale status.
void addErrorListener(MamdaErrorListener listener)
Add a listener for error events.
void activate()
Activate the subscription. Until this method is invoked, no updates will be received.
void deactivate()
Deactivate the subscription. No more updates will be received for this subscription (unless activate() is invoked again).
void requestRecap()
Force a recap request to be sent for this subscription.
string getSource()
double getTimout()
int getRetries()
string getSymbol()
MamaQueue getQueue()
MamaTransport getTransport()
Object getClosure()
Get the additional object passed as the closure to the create() method.
MamaSubscription getMamaSubscription()

Additional inherited members

Public Functions inherited from Wombat.MamdaResourceContainer

  Name
void Dispose()
Destroys the resources

Protected Functions inherited from Wombat.MamdaResourceContainer

  Name
  MamdaResourceContainer()
void AddResource(IDisposable resource)

Detailed Description

class Wombat::MamdaSubscription;

A MamdaSubscription is used to register interest in a particular symbol and source. A MamaTransport is required to actually activate the subscription.

Multiple listeners can be added to the MamdaSubscription. In this way, an application can make use of more than one of the specialized value added MAMDA listeners, such as MamdaTradeListener and MamdaQuoteListener.

Public Functions Documentation

function MamdaSubscription

MamdaSubscription()

Default constructor. The subscription is not created until either create() or activate() is called.

function create

void create(
    MamaTransport transport,
    MamaQueue queue,
    string source,
    string symbol,
    object closure
)

Create and activate a subscription. Any properties for the subscription should be set prior to calling this method.

Parameters:

  • transport
  • queue
  • source
  • symbol
  • closure

function setSource

void setSource(
    string source
)

Set the data source name. Do this before calling activate().

Parameters:

  • source

function setSymbol

void setSymbol(
    string symbol
)

Set the symbol. Do this before calling activate().

Parameters:

  • symbol

function setTransport

void setTransport(
    MamaTransport transport
)

Set the MAMA transport. Do this before calling activate().

Parameters:

  • transport

function setQueue

void setQueue(
    MamaQueue queue
)

Set the MAMA queue. Do this before calling activate().

Parameters:

  • queue

function setType

void setType(
    mamaSubscriptionType type
)

Set the subscrption type. Do this before calling activate() Default is

Parameters:

  • type

mamaSubscriptionType.MAMA_SUBSC_TYPE_NORMAL

function setServiceLevel

void setServiceLevel(
    mamaServiceLevel serviceLevel,
    int serviceLevelOpt
)

Set the MAMA service level. In the future, certain service levels may have an optional argument (e.g., an interval for conflated data). Do this before calling activate(). Default value is

Parameters:

  • serviceLevel
  • serviceLevelOpt

MamaServiceLevel.MAMA_SERVICE_LEVEL_REAL_TIME and 0

function setRequireInitial

void setRequireInitial(
    bool require
)

Set whether an initial value is required. Do this before calling activate(). Default is

Parameters:

  • require

true

function setTimeout

void setTimeout(
    double timeout
)

Set the timeout (in seconds) for this subscription. Do this before calling activate(). Default is 10 seconds.

Parameters:

  • timeout

function setRetries

void setRetries(
    int retries
)

Set the retries for this subscription. Do this before calling activate(). Default is 10 seconds.

Parameters:

  • retries

function setClosure

void setClosure(
    Object closure
)

Set the closure. Do this before calling activate().

Parameters:

  • closure

function addMsgListener

void addMsgListener(
    MamdaMsgListener listener
)

Add a listener for regular messages.

Parameters:

  • listener

function getMsgListeners

ArrayList getMsgListeners()

get a listener for regular messages.

function addStaleListener

void addStaleListener(
    MamdaStaleListener listener
)

Add a listener for changes in stale status.

Parameters:

  • listener

function addErrorListener

void addErrorListener(
    MamdaErrorListener listener
)

Add a listener for error events.

Parameters:

  • listener

function activate

void activate()

Activate the subscription. Until this method is invoked, no updates will be received.

function deactivate

void deactivate()

Deactivate the subscription. No more updates will be received for this subscription (unless activate() is invoked again).

This function must be called from the same thread dispatching on the associated event queue unless both the default queue and dispatch queue are not actively dispatching.

function requestRecap

void requestRecap()

Force a recap request to be sent for this subscription.

Note: there is still a possibility that the feed handler will reject such recap requests (based on configurable feature(s) of a feed handler).

function getSource

string getSource()

Return:

function getTimout

double getTimout()

Return:

function getRetries

int getRetries()

Return:

function getSymbol

string getSymbol()

Return:

function getQueue

MamaQueue getQueue()

Return:

function getTransport

MamaTransport getTransport()

Return:

function getClosure

Object getClosure()

Get the additional object passed as the closure to the create() method.

Return:

function getMamaSubscription

MamaSubscription getMamaSubscription()

Updated on 2023-03-31 at 15:30:14 +0100