|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.devexperts.qd.qtp.MessageConsumerAdapter
com.devexperts.qd.qtp.MessageAdapter
com.devexperts.qd.qtp.AgentAdapter
public class AgentAdapter
The AgentAdapter
adapts agent side of QD to message API.
The agent side of an QD is an aggregation of agents
for all its data sources.
Thus, the AgentAdapter
can be used to represent an outside data consumer
in the specific QD.
if you are a QD publisher - use this Adapter
Nested Class Summary | |
---|---|
static class |
AgentAdapter.Factory
The factory for agent side of an QD. |
Nested classes/interfaces inherited from class com.devexperts.qd.qtp.MessageAdapter |
---|
MessageAdapter.AbstractFactory, MessageAdapter.CloseListener |
Field Summary |
---|
Fields inherited from class com.devexperts.qd.qtp.MessageAdapter |
---|
closeListener, messageListener |
Constructor Summary | |
---|---|
AgentAdapter(DataScheme scheme,
QDStats stats)
Creates new agent adapter for specified scheme and stats. |
|
AgentAdapter(QDTicker ticker,
QDStream stream,
QDHistory history,
SubscriptionFilter filter,
QDStats stats)
Creates new agent adapter for specified ticker, stream, history, filter and stats. |
Method Summary | |
---|---|
protected void |
closeImpl()
|
protected QDAgent |
createAgent(QDCollector collector,
SubscriptionFilter filter,
java.lang.String keyProperties)
This method is used internally by agent adapter to create agent for the corresponding collector, filter, and keyProperties when the corresponding subscription arrives for a first time. |
DataScheme |
getScheme()
|
java.lang.String |
getSymbol(char[] chars,
int offset,
int length)
Returns symbol used for specified characters or null if not found. |
AgentAdapter |
initialize(ChannelShaper... shapers)
Initializes the adapter with specified channel shapers. |
boolean |
isProtocolDescriptorCompatible(ProtocolDescriptor desc)
|
long |
nextRetrieveTime(long currentTime)
|
void |
prepareProtocolDescriptor(ProtocolDescriptor desc)
Prepares outgoing protocol descriptor. |
void |
processDescribeProtocol(ProtocolDescriptor desc)
Process incoming protocol descriptor. |
protected void |
processSubscription(SubscriptionIterator iterator,
MessageType message)
|
protected boolean |
retrieveDataMessages(MessageVisitor visitor)
|
boolean |
retrieveMessages(MessageVisitor visitor)
Retrieves accumulated message into specified message visitor. |
void |
updateChannel(ChannelShaper shaper)
|
protected boolean |
visitData(MessageVisitor visitor,
DataProvider provider,
MessageType message)
|
Methods inherited from class com.devexperts.qd.qtp.MessageConsumerAdapter |
---|
processData, processHistoryAddSubscription, processHistoryData, processHistoryRemoveSubscription, processOtherMessage, processStreamAddSubscription, processStreamData, processStreamRemoveSubscription, processTickerAddSubscription, processTickerData, processTickerRemoveSubscription |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AgentAdapter(QDTicker ticker, QDStream stream, QDHistory history, SubscriptionFilter filter, QDStats stats)
null
.
The resulting adapter will be initiailized
.
It will use equal weight of 1 and no aggregation for all collectors.
ticker
- tickerstream
- streamhistory
- historyfilter
- filterstats
- statspublic AgentAdapter(DataScheme scheme, QDStats stats)
initialized
with shapers before being used.
scheme
- data schemestats
- statsMethod Detail |
---|
public AgentAdapter initialize(ChannelShaper... shapers)
AgentAdapter(QDTicker, QDStream, QDHistory, SubscriptionFilter, QDStats)
constructor in which case
it ia allready initialized).
shapers
- shaping configuration for adapter channels
protected QDAgent createAgent(QDCollector collector, SubscriptionFilter filter, java.lang.String keyProperties)
this
adapter's lock.
This implementation returns collector.createAgent(filter, keyProperties)
.
This method may be overriden to create agent with other filter, otherwise customize the agent
that is being created, or to keep track of created agents.
collector
- collector to create agent forfilter
- subscription filter for the agentkeyProperties
- key properties for stats
public DataScheme getScheme()
getScheme
in class MessageAdapter
public java.lang.String getSymbol(char[] chars, int offset, int length)
MessageConsumerAdapter
null
if not found.
getSymbol
in class MessageConsumerAdapter
public void updateChannel(ChannelShaper shaper)
protected void processSubscription(SubscriptionIterator iterator, MessageType message)
processSubscription
in class MessageConsumerAdapter
protected void closeImpl()
closeImpl
in class MessageAdapter
public boolean retrieveMessages(MessageVisitor visitor)
MessageProvider
true
if some messages still remains in the provider
or false
if all accumulated messages were retrieved.
retrieveMessages
in interface MessageProvider
retrieveMessages
in class MessageAdapter
public void prepareProtocolDescriptor(ProtocolDescriptor desc)
MessageAdapter
super.prepareProtocolDescriptor(desc)
.
prepareProtocolDescriptor
in class MessageAdapter
desc
- outgoing protocol descriptorpublic void processDescribeProtocol(ProtocolDescriptor desc)
MessageAdapter
super.processDescribeProtocol(desc)
.
processDescribeProtocol
in interface MessageConsumer
processDescribeProtocol
in class MessageAdapter
desc
- incoming protocol descriptorpublic boolean isProtocolDescriptorCompatible(ProtocolDescriptor desc)
isProtocolDescriptorCompatible
in class MessageAdapter
protected boolean retrieveDataMessages(MessageVisitor visitor)
public long nextRetrieveTime(long currentTime)
nextRetrieveTime
in class MessageAdapter
protected boolean visitData(MessageVisitor visitor, DataProvider provider, MessageType message)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |