_marketPriceDecoder = new MarketPriceDecoder(_postUserInfo); _reactorOptions = ReactorFactory.createReactorOptions(); _role = ReactorFactory.createConsumerRole(); _errorInfo = ReactorFactory.createReactorErrorInfo(); _connectOptions = ReactorFactory.createReactorConnectOptions(); _dispatchOptions = ReactorFactory.createReactorDispatchOptions(); _submitOptions = ReactorFactory.createReactorSubmitOptions(); _connectInfo = ReactorFactory.createReactorConnectInfo(); _reactorChannnelInfo = ReactorFactory.createReactorChannelInfo(); _postMsg = (PostMsg)CodecFactory.createMsg(); _postBuffer = CodecFactory.createBuffer();
/** Creates a TestReactor. */ public TestReactor() { ReactorOptions reactorOptions = ReactorFactory.createReactorOptions(); _eventQueue = new LinkedList<TestReactorEvent>(); _componentList = new LinkedList<TestReactorComponent>(); _errorInfo = ReactorFactory.createReactorErrorInfo(); if (_enableReactorXmlTracing) reactorOptions.enableXmlTracing(); _reactor = ReactorFactory.createReactor(reactorOptions, _errorInfo); try { _selector = Selector.open(); } catch (IOException e) { e.printStackTrace(); fail("Caught I/O exception"); } }
if (_role == null || _role.type() != role.type()) consumerRole = ReactorFactory.createConsumerRole(); _role = consumerRole; if (_role == null || _role.type() != role.type()) niProviderRole = ReactorFactory.createNIProviderRole(); _role = niProviderRole; if (_role == null || _role.type() != role.type()) providerRole = ReactorFactory.createProviderRole(); _role = providerRole;
public IDirectoryProvider() { super(); _directoryRequest = (DirectoryRequest)DirectoryMsgFactory.createMsg(); _directoryRequest.rdmMsgType(DirectoryMsgType.REQUEST); _errorInfo = ReactorFactory.createReactorErrorInfo(); _reactorSubmitOptions = ReactorFactory.createReactorSubmitOptions(); _reactorSubmitOptions.clear(); _reactorSubmitOptions.writeArgs().priority(WritePriorities.HIGH); }
assertEquals(0, reactorRole.type()); ConsumerRole consumerRole = ReactorFactory.createConsumerRole(); ProviderRole providerRole = ReactorFactory.createProviderRole(); NIProviderRole niProviderRole = ReactorFactory.createNIProviderRole(); ProviderCallbackHandler providerCallbackHandler = new ProviderCallbackHandler(); NIProviderCallbackHandler niproviderCallbackHandler = new NIProviderCallbackHandler(); ReactorChannelEvent reactorChannelEvent = ReactorFactory.createReactorChannelEvent(); ReactorMsgEvent reactorMsgEvent = ReactorFactory.createReactorMsgEvent(); RDMLoginMsgEvent rdmLoginMsgEvent = ReactorFactory.createRDMLoginMsgEvent(); RDMDirectoryMsgEvent rdmDirectoryMsgEvent = ReactorFactory.createRDMDirectoryMsgEvent(); RDMDictionaryMsgEvent rdmDictionaryMsgEvent = ReactorFactory.createRDMDictionaryMsgEvent();
ReactorEvent() { _errorInfo = ReactorFactory.createReactorErrorInfo(); }
static ReactorConnectOptions createDefaultConsumerConnectOptions(String serviceName) { ReactorConnectOptions rcOpts = ReactorFactory.createReactorConnectOptions(); ReactorConnectInfo connectInfo = ReactorFactory.createReactorConnectInfo(); assertNotNull(rcOpts); assertEquals(ReactorReturnCodes.PARAMETER_OUT_OF_RANGE, connectInfo.initTimeout(0)); assertEquals(ReactorReturnCodes.SUCCESS, connectInfo.initTimeout(10)); connectInfo.connectOptions().connectionType(ConnectionTypes.SOCKET); connectInfo.connectOptions().majorVersion(Codec.majorVersion()); connectInfo.connectOptions().minorVersion(Codec.minorVersion()); connectInfo.connectOptions().unifiedNetworkInfo().serviceName(serviceName); connectInfo.connectOptions().unifiedNetworkInfo().address(LOCAL_ADDRESS); rcOpts.connectionList().add(connectInfo); return rcOpts; }
reactor = ReactorFactory.createReactor(reactorOptions, errorInfo); if (errorInfo.code() != ReactorReturnCodes.SUCCESS)
/** * Instantiates a new dictionary provider. */ public DictionaryProvider() { _encodeIter = CodecFactory.createEncodeIterator(); _dictionary = CodecFactory.createDataDictionary(); _dictionaryRefresh = (DictionaryRefresh)DictionaryMsgFactory.createMsg(); _dictionaryRefresh.rdmMsgType(DictionaryMsgType.REFRESH); _dictionaryRequest = (DictionaryRequest)DictionaryMsgFactory.createMsg(); _dictionaryRequest.rdmMsgType(DictionaryMsgType.REQUEST); _dictionaryStatus = (DictionaryStatus)DictionaryMsgFactory.createMsg(); _dictionaryStatus.rdmMsgType(DictionaryMsgType.STATUS); _chnlInfo = TransportFactory.createChannelInfo(); _errorInfo = ReactorFactory.createReactorErrorInfo(); _reactorSubmitOptions = ReactorFactory.createReactorSubmitOptions(); _reactorSubmitOptions.clear(); _reactorSubmitOptions.writeArgs().priority(WritePriorities.HIGH); _reactorChnlInfo = ReactorFactory.createReactorChannelInfo(); }
ReactorErrorInfo errorInfo = ReactorFactory.createReactorErrorInfo(); ReactorDispatchOptions dispatchOptions = ReactorFactory.createReactorDispatchOptions();
@Override public int defaultMsgCallback(ReactorMsgEvent event) { ReactorSubmitOptions submitOptions = ReactorFactory.createReactorSubmitOptions(); CloseMsg closeMsg = (CloseMsg)CodecFactory.createMsg(); super.defaultMsgCallback(event); closeMsg.clear(); closeMsg.msgClass(MsgClasses.CLOSE); closeMsg.domainType(event.msg().domainType()); closeMsg.streamId(event.msg().streamId()); submit(closeMsg, submitOptions); return ReactorReturnCodes.SUCCESS; } }
ReactorChannelInfo rci = ReactorFactory.createReactorChannelInfo(); ReactorErrorInfo ei = ReactorFactory.createReactorErrorInfo(); reactorChannel.info(rci, ei);
public Consumer(TestReactor testReactor) { super(testReactor); _reactorRole = ReactorFactory.createConsumerRole(); }
ChannelCallbackClient(OmmBaseImpl<T> baseImpl, Reactor rsslReactor) { _baseImpl = baseImpl; _rsslReactor = rsslReactor; _rsslReactorConnOptions.connectionList().add(ReactorFactory.createReactorConnectInfo()); _bInitialChannelReadyEventReceived = false; if (_baseImpl.loggerClient().isTraceEnabled()) { _baseImpl.loggerClient().trace(_baseImpl.formatLogMessage(CLIENT_NAME, "Created ChannelCallbackClient", Severity.TRACE).toString()); } _productVersion = _package.getImplementationVersion(); if (_productVersion == null) _productVersion = "EMA Java Edition"; }
static Reactor createReactor(ReactorErrorInfo errorInfo) { ReactorOptions reactorOptions = ReactorFactory.createReactorOptions(); assertNotNull(reactorOptions); assertEquals(ReactorReturnCodes.PARAMETER_INVALID, reactorOptions.userSpecObj(null)); String userSpecObject = "test"; assertEquals(ReactorReturnCodes.SUCCESS, reactorOptions.userSpecObj(userSpecObject)); Reactor reactor = ReactorFactory.createReactor(reactorOptions, errorInfo); assertNotNull(reactor); assertEquals(ReactorReturnCodes.SUCCESS, errorInfo.code()); assertEquals(userSpecObject, reactor.userSpecObj()); return reactor; }
@Test public void watchlistItemAggregationKeyTest() ConsumerRole consumerRole = ReactorFactory.createConsumerRole(); assertNotNull(consumerRole); consumerRole.initDefaultRDMLoginRequest(); WlItemAggregationKey itemAggregationKey1 = ReactorFactory.createWlItemAggregationKey(); WlItemAggregationKey itemAggregationKey2 = ReactorFactory.createWlItemAggregationKey(); itemAggregationKey1.clear(); itemAggregationKey2.clear();
ReactorSubmitOptions submitOptions = ReactorFactory.createReactorSubmitOptions(); TestReactorEvent event; ReactorMsgEvent msgEvent; requestMsg.msgKey().serviceId(1); requestMsg.msgKey().applyHasFilter(); TunnelStreamOpenOptions tsOpenOpts = ReactorFactory.createTunnelStreamOpenOptions(); tsOpenOpts.classOfService().dataIntegrity().type(DataIntegrityTypes.RELIABLE); requestMsg.msgKey().filter(tsOpenOpts.classOfService().filterFlags());
@Test public void VerifyNIProviderRoleMsgCopyTest() { /* Verify message attached to the NIProviderRole are copied. */ /* Create dummy ReactorChannel for test. */ ReactorChannel reactorChannel = ReactorFactory.createReactorChannel(); /* Create user NIProviderRole, initialize default messages and set on dummy ReactorChannel. */ NIProviderRole userNIProviderRole = ReactorFactory.createNIProviderRole(); userNIProviderRole.initDefaultRDMLoginRequest(); userNIProviderRole.initDefaultRDMDirectoryRefresh("DIRECT_FEED", 1); reactorChannel.role(userNIProviderRole); /* Obtain reference to ReactorChannel NIProviderRole and verify that * user NIProviderRole and ReactorChannel NIProviderRole are not the same. */ NIProviderRole reactorChnlNIProviderRole = (NIProviderRole)reactorChannel.role(); assertFalse(userNIProviderRole == reactorChnlNIProviderRole); /* Verify that user NIProviderRole messages and ReactorChannel * NIProviderRole messages are not the same. */ assertFalse(userNIProviderRole.rdmLoginRequest() == reactorChnlNIProviderRole.rdmLoginRequest()); assertFalse(userNIProviderRole.rdmDirectoryRefresh() == reactorChnlNIProviderRole.rdmDirectoryRefresh()); /* Verify that other user NIProviderRole and ReactorChannel NIProviderRole attributes are equal. */ assertTrue(userNIProviderRole.channelEventCallback() == reactorChnlNIProviderRole.channelEventCallback()); assertTrue(userNIProviderRole.defaultMsgCallback() == reactorChnlNIProviderRole.defaultMsgCallback()); assertTrue(userNIProviderRole.loginMsgCallback() == reactorChnlNIProviderRole.loginMsgCallback()); } }
void initializeNiProviderRole(LoginRequest loginReq, DirectoryRefresh directoryRefresh) { NIProviderRole niProviderRole = ReactorFactory.createNIProviderRole(); loginReq.applyHasRole(); loginReq.role(Login.RoleTypes.PROV); niProviderRole.rdmLoginRequest(loginReq); niProviderRole.loginMsgCallback(_baseImpl.loginCallbackClient()); niProviderRole.channelEventCallback(this); niProviderRole.defaultMsgCallback(_baseImpl.itemCallbackClient()); niProviderRole.rdmDirectoryRefresh(directoryRefresh); _rsslReactorRole = niProviderRole; initializeReactor(); }
void reactorConnectOptions(ReactorConnectOptions reactorConnectOptions) { if (_reactorConnectOptions == null) _reactorConnectOptions = ReactorFactory.createReactorConnectOptions(); reactorConnectOptions.copy(_reactorConnectOptions); _reconnectDelay = 0; _nextRecoveryTime = 0; }