Watchlist(ReactorChannel reactorChannel, ConsumerRole consumerRole) { _reactorChannel = reactorChannel; _reactor = _reactorChannel.reactor(); _role = consumerRole; _watchlistOptions = _role.watchlistOptions(); if (_watchlistOptions.itemCountHint() > 0) { _streamIdtoWlRequestTable = new HashMap<WlInteger,WlRequest>(_watchlistOptions.itemCountHint() + 10, 1); _streamIdtoWlStreamTable = new HashMap<WlInteger,WlStream>(_watchlistOptions.itemCountHint() + 10, 1); } else { _streamIdtoWlRequestTable = new HashMap<WlInteger,WlRequest>(); _streamIdtoWlStreamTable = new HashMap<WlInteger,WlStream>(); } _loginHandler = new WlLoginHandler(this); _directoryHandler = new WlDirectoryHandler(this); _itemHandler = new WlItemHandler(this); _tempByteBuffer1 = ByteBuffer.allocate(8192); _tempBuffer1.data(_tempByteBuffer1); _tempByteBuffer2 = ByteBuffer.allocate(8192); _tempBuffer2.data(_tempByteBuffer2); }
WlItemHandler(Watchlist watchlist) { _watchlist = watchlist; _defaultQos.clear(); _defaultQos.timeliness(QosTimeliness.REALTIME); _defaultQos.rate(QosRates.TICK_BY_TICK); _statusMsg.msgClass(MsgClasses.STATUS); _wlViewHandler = new WlViewHandler(watchlist); _itemAggregationKeytoWlStreamTable = new HashMap<WlItemAggregationKey,WlStream>(_watchlist.role().watchlistOptions().itemCountHint() + 10, 1); }
void copy(ConsumerWatchlistOptions watchlistOptions) { _enableWatchlist = watchlistOptions.enableWatchlist(); _channelOpenCallback = watchlistOptions.channelOpenCallback(); _itemCountHint = watchlistOptions.itemCountHint(); _obeyOpenWindow = watchlistOptions.obeyOpenWindow(); _maxOutstandingPosts = watchlistOptions.maxOutstandingPosts(); _postAckTimeout = watchlistOptions.postAckTimeout(); _requestTimeout = watchlistOptions.requestTimeout(); } }
_role.watchlistOptions().itemCountHint(_consPerfConfig.itemRequestCount());
chnlInfo.consumerRole.directoryMsgCallback(this); chnlInfo.consumerRole.watchlistOptions().enableWatchlist(true); chnlInfo.consumerRole.watchlistOptions().itemCountHint(4); chnlInfo.consumerRole.watchlistOptions().maxOutstandingPosts(5); chnlInfo.consumerRole.watchlistOptions().obeyOpenWindow(true);
void initializeConsumerRole(LoginRequest loginReq, DirectoryRequest dirReq) { ConsumerRole consumerRole = ReactorFactory.createConsumerRole(); loginReq.applyHasRole(); loginReq.role(Login.RoleTypes.CONS); consumerRole.rdmLoginRequest(loginReq); consumerRole.rdmDirectoryRequest(dirReq); consumerRole.dictionaryDownloadMode(DictionaryDownloadModes.NONE); consumerRole.loginMsgCallback(_baseImpl.loginCallbackClient()); consumerRole.dictionaryMsgCallback(_baseImpl.dictionaryCallbackClient()); consumerRole.directoryMsgCallback(_baseImpl.directoryCallbackClient()); consumerRole.channelEventCallback(_baseImpl.channelCallbackClient()); consumerRole.defaultMsgCallback(_baseImpl.itemCallbackClient()); ConsumerWatchlistOptions watchlistOptions = consumerRole.watchlistOptions(); watchlistOptions.channelOpenCallback(this); watchlistOptions.enableWatchlist(true); watchlistOptions.itemCountHint(_baseImpl.activeConfig().itemCountHint); watchlistOptions.obeyOpenWindow(_baseImpl.activeConfig().obeyOpenWindow > 0 ? true : false); watchlistOptions.postAckTimeout(_baseImpl.activeConfig().postAckTimeout); watchlistOptions.requestTimeout(_baseImpl.activeConfig().requestTimeout); watchlistOptions.maxOutstandingPosts(_baseImpl.activeConfig().maxOutstandingPosts); _rsslReactorRole = consumerRole; initializeReactor(); }
assertTrue(consumerRole.watchlistOptions().channelOpenCallback() == reactorChnlConsumerRole.watchlistOptions().channelOpenCallback()); assertTrue(consumerRole.watchlistOptions().enableWatchlist() == reactorChnlConsumerRole.watchlistOptions().enableWatchlist()); assertTrue(consumerRole.watchlistOptions().itemCountHint() == reactorChnlConsumerRole.watchlistOptions().itemCountHint()); assertTrue(consumerRole.watchlistOptions().maxOutstandingPosts() == reactorChnlConsumerRole.watchlistOptions().maxOutstandingPosts()); assertTrue(consumerRole.watchlistOptions().obeyOpenWindow() == reactorChnlConsumerRole.watchlistOptions().obeyOpenWindow());
consumerRole.watchlistOptions().itemCountHint(4); consumerRole.watchlistOptions().maxOutstandingPosts(5); consumerRole.watchlistOptions().obeyOpenWindow(true); assertEquals(2, consumerCallbackHandler._reactorChannelEventCallbackCount); assertTrue(consumerRole.watchlistOptions().enableWatchlist()); assertEquals(4, consumerRole.watchlistOptions().itemCountHint()); assertEquals(5, consumerRole.watchlistOptions().maxOutstandingPosts()); assertTrue(consumerRole.watchlistOptions().obeyOpenWindow());