public class TradeAdapter extends Object
Constructor and Description |
---|
TradeAdapter(com.caplin.datasource.DataSource dataSource)
Constructs the TradeAdapter that will utilise the specified
DataSource and its configuration for communication with the motif.
|
Modifier and Type | Method and Description |
---|---|
void |
addUserSessionListener(UserSessionListener listener)
Adds a listener that will be notified whenever a user session is
created and closed.
|
com.caplin.datasource.DataSource |
getDataSource()
Returns the DataSource contained by this TradeAdapter.
|
void |
registerPostAllocationTradeViewListener(SubjectParser<AllocationViewEvent> subjectParser,
PostTradeAllocationViewListener listener)
Registers the listener that will service the request to view the allocations
of an already allocated trade.
|
void |
registerTradeListenerFactory(String protocol,
TradeListenerFactory listener)
Registers a TradeListenerFactory that will be notified when a
trade with the specified protocol has been initiated.
|
void |
removeUserSessionListener(UserSessionListener listener)
Removes a listener UserSessionListener to stop receiving session events.
|
public TradeAdapter(com.caplin.datasource.DataSource dataSource) throws IOException
dataSource
- The DataSource that will be used to receive requests
for ESP and RFS trades.IOException
- If an error occured reading configuration files for
the adapter.public void registerTradeListenerFactory(String protocol, TradeListenerFactory listener)
protocol
- The protocol of the trade to add the listener for.
This should match the protocol specified in the trade
model xml, for example, ESP or RFS.listener
- The listener that will be notified when a trade with the
specified protocol has initiated.public void addUserSessionListener(UserSessionListener listener)
listener
- the listener to be notified of session lifecycle events.public void removeUserSessionListener(UserSessionListener listener)
listener
- the listener to be removed from receiving session lifecycle events.public void registerPostAllocationTradeViewListener(SubjectParser<AllocationViewEvent> subjectParser, PostTradeAllocationViewListener listener)
subjectParser
- The parser that will parse the clients request to view allocations into a domain specific object.listener
- The listener that will be called to service the request to view details of already allocated trades.public com.caplin.datasource.DataSource getDataSource()
Copyright © 2015 Caplin Systems.