RDMLoginMsgCallback callback = null; switch (reactorChannel.role().type()) callback = ((ConsumerRole)reactorChannel.role()).loginMsgCallback(); break; case ReactorRoleTypes.PROVIDER: callback = ((ProviderRole)reactorChannel.role()).loginMsgCallback(); break; case ReactorRoleTypes.NIPROVIDER: callback = ((NIProviderRole)reactorChannel.role()).loginMsgCallback(); break; default:
RDMDirectoryMsgCallback callback = null; switch (reactorChannel.role().type()) callback = ((ConsumerRole)reactorChannel.role()).directoryMsgCallback(); break; case ReactorRoleTypes.PROVIDER: callback = ((ProviderRole)reactorChannel.role()).directoryMsgCallback(); break; case ReactorRoleTypes.NIPROVIDER:
RDMDictionaryMsgCallback callback = null; switch (reactorChannel.role().type()) callback = ((ConsumerRole)reactorChannel.role()).dictionaryMsgCallback(); break; case ReactorRoleTypes.PROVIDER: callback = ((ProviderRole)reactorChannel.role()).dictionaryMsgCallback(); break; case ReactorRoleTypes.NIPROVIDER:
private int sendChannelEventCallback(int eventType, ReactorChannel reactorChannel, ReactorErrorInfo errorInfo) { ReactorChannelEvent reactorChannelEvent = ReactorFactory.createReactorChannelEvent(); reactorChannelEvent.reactorChannel(reactorChannel); reactorChannelEvent.eventType(eventType); populateErrorInfo(reactorChannelEvent.errorInfo(), errorInfo.code(), errorInfo.location(), errorInfo.error().text()); int retval = reactorChannel.role().channelEventCallback().reactorChannelEventCallback(reactorChannelEvent); reactorChannelEvent.returnToPool(); return retval; }
/** * Creates a consumer-side tunnel stream. * * @param reactorChannel the reactor channel * @param options the options */ public TunnelStream(ReactorChannel reactorChannel, TunnelStreamOpenOptions options) { this(reactorChannel); _streamId = options.streamId(); _domainType = options.domainType(); _serviceId = options.serviceId(); _guaranteedOutputBuffers = options.guaranteedOutputBuffers(); options.classOfService().copy(_classOfService); _defaultMsgCallback = options.defaultMsgCallback(); _statusEventCallback = options.statusEventCallback(); _queueMsgCallback = options.queueMsgCallback(); _authLoginRequest = options.authLoginRequest(); if (_authLoginRequest == null && reactorChannel.role() != null) { _authLoginRequest = ((ConsumerRole)reactorChannel.role()).rdmLoginRequest(); } _name = options.name(); _userSpecObject = options.userSpecObject(); _responseTimeout = options.responseTimeout(); _bigBufferPool = new TunnelStreamBigBufferPool(options.classOfService().common().maxFragmentSize(), options.guaranteedOutputBuffers()); }
private int sendDefaultMsgCallback(ReactorChannel reactorChannel, TransportBuffer transportBuffer, Msg msg, WatchlistStreamInfo streamInfo) { ReactorMsgEvent reactorMsgEvent = ReactorFactory.createReactorMsgEvent(); reactorMsgEvent.reactorChannel(reactorChannel); reactorMsgEvent.transportBuffer(transportBuffer); reactorMsgEvent.msg(msg); if (streamInfo != null) { reactorMsgEvent.streamInfo().serviceName(streamInfo.serviceName()); reactorMsgEvent.streamInfo().userSpecObject(streamInfo.userSpecObject()); } else { reactorMsgEvent.streamInfo().clear(); } int retval = reactorChannel.role().defaultMsgCallback().defaultMsgCallback(reactorMsgEvent); reactorMsgEvent.returnToPool(); return retval; }
@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()); } }
ReactorRole reactorRole = reactorChannel.role(); && reactorChannel.role().type() == ReactorRoleTypes.CONSUMER && msg.streamId() == ((ConsumerRole)reactorRole).rdmLoginRequest().streamId() && _loginMsg.rdmMsgType() == LoginMsgType.REFRESH && reactorChannel.role().type() == ReactorRoleTypes.NIPROVIDER && msg.streamId() == ((NIProviderRole)reactorRole).rdmLoginRequest().streamId() && _loginMsg.rdmMsgType() == LoginMsgType.REFRESH
reactorChannel.role(role); reactorChannel.reactor(this); reactorChannel.initializationTimeout(reactorAcceptOptions.initTimeout());
ReactorRole reactorRole = reactorChannel.role(); if (reactorChannel.state() == State.UP && reactorChannel.role().type() == ReactorRoleTypes.CONSUMER && _dictionaryMsg.rdmMsgType() == DictionaryMsgType.REFRESH && ((ConsumerRole)reactorRole).dictionaryDownloadMode() == DictionaryDownloadModes.FIRST_AVAILABLE)
reactorChannel.role(role); reactorChannel.reactor(this); reactorChannel.userSpecObj(reactorConnectOptions.connectionList().get(0).connectOptions().userSpecObject());
private void processChannelUp(WorkerEvent event, ReactorErrorInfo errorInfo) ReactorRole reactorRole = reactorChannel.role();