Package com.wombat.mamda
Class MamdaMultiSecurityManager
- java.lang.Object
-
- com.wombat.mamda.MamdaMultiSecurityManager
-
- All Implemented Interfaces:
MamdaMsgListener
public class MamdaMultiSecurityManager extends java.lang.Object implements MamdaMsgListener
MamdaMultiSecurityManager is a class that manages updates on a group symbol which provides a single subscription to multiple different securities. Developers are notified of each element available for the group and can choose which elements they wish to provide handling for (e.g. based on wildcards). Specialized Listeners can be added to theMamdaMultiSecurityManager
in response to the callbacks on theMamdaMultiSecurityHandler
being invoked. Alternatively, the Listeners can be added up front if the participants are known in advance.
-
-
Constructor Summary
Constructors Constructor Description MamdaMultiSecurityManager(java.lang.String symbol)
Only constructor for the class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addHandler(MamdaMultiSecurityHandler handler)
Add a specialized handler for notifications about new securities.void
addListener(MamdaMsgListener listener, java.lang.String symbol)
Add a specialized message listener (e.g.void
onMsg(MamdaSubscription subscription, com.wombat.mama.MamaMsg msg, short msgType)
Implementation of the MamdaMsgListener Interface.
-
-
-
Method Detail
-
addHandler
public void addHandler(MamdaMultiSecurityHandler handler)
Add a specialized handler for notifications about new securities.- Parameters:
handler
- Concrete instance of the MamdaMultiSecurityHandler interface.
-
addListener
public void addListener(MamdaMsgListener listener, java.lang.String symbol)
Add a specialized message listener (e.g. a MamdaQuoteListener, MamdaTradeListener, etc.) for a security. Multiple listeners for each security can be added.- Parameters:
listener
- Concrete instance of the MamdaMsgListener interface.symbol
- The symbol for the instrument.
-
onMsg
public void onMsg(MamdaSubscription subscription, com.wombat.mama.MamaMsg msg, short msgType)
Implementation of the MamdaMsgListener Interface.- Specified by:
onMsg
in interfaceMamdaMsgListener
- Parameters:
subscription
- The MamdaSubscription to which this listener was registered.msg
- The MamaMsg received by the underlying MAMA API and which resulted in this callback being invoked.msgType
- The message type. e.g. INITIAL, RECAP, UPDATE etc.
-
-