void reactorChannel(ReactorChannel reactorChannel) { _reactorChannel = reactorChannel; _reactor = _reactorChannel.reactor(); }
reactorChannel.state(State.INITIALIZING); reactorChannel.role(role); reactorChannel.reactor(this); reactorChannel.userSpecObj(reactorConnectOptions.connectionList().get(0).connectOptions().userSpecObject()); reactorChannel.initializationTimeout(reactorConnectOptions.connectionList().get(0).initTimeout());
return ReactorReturnCodes.FAILURE; else if (submitOptions == null) return reactor().populateErrorInfo(errorInfo, ReactorReturnCodes.FAILURE, "ReactorChannel.submit", "submitOptions cannot be null."); return reactor().populateErrorInfo(errorInfo, ReactorReturnCodes.INVALID_USAGE, "ReactorChannel.submit", "Cannot submit buffer when watchlist is enabled.");
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); }
.append(OmmLoggerClient.CR).append("Instance Name ").append(_baseImpl.instanceName()) .append(OmmLoggerClient.CR).append("RsslReactor ") .append(Integer.toHexString(tunnelStreamQueueMsgEvent.reactorChannel().reactor().hashCode()));
.append("Instance Name ").append(_baseImpl.instanceName()) .append(OmmLoggerClient.CR) .append("RsslReactor ").append(Integer.toHexString(clientSession.channel().reactor().hashCode())) .append(OmmLoggerClient.CR); if (event.reactorChannel() != null && event.reactorChannel().selectableChannel() != null) .append("Instance Name ").append(_baseImpl.instanceName()) .append(OmmLoggerClient.CR) .append("RsslReactor ").append(Integer.toHexString(clientSession.channel().reactor().hashCode())) .append(OmmLoggerClient.CR); if (event.reactorChannel() != null && event.reactorChannel().selectableChannel() != null)
.append(OmmLoggerClient.CR).append("Instance Name ").append(_baseImpl.instanceName()) .append(OmmLoggerClient.CR).append("RsslReactor ") .append(Integer.toHexString(tunnelStreamMsgEvent.reactorChannel().reactor().hashCode()));
/** * Process this channel's events and messages from the Reactor. These are * passed to the calling application via the callback methods associated * with the channel. * * @param dispatchOptions options for how to dispatch * @param errorInfo error structure to be populated in the event of failure * * @return a positive value if dispatching succeeded and there are more messages to process or * {@link ReactorReturnCodes#SUCCESS} if dispatching succeeded and there are no more messages to process or * {@link ReactorReturnCodes#FAILURE}, if dispatching failed (refer to errorInfo for additional information) */ public int dispatch(ReactorDispatchOptions dispatchOptions, ReactorErrorInfo errorInfo) { if (errorInfo == null) return ReactorReturnCodes.FAILURE; else if (dispatchOptions == null) return reactor().populateErrorInfo(errorInfo, ReactorReturnCodes.FAILURE, "ReactorChannel.dispatch", "dispatchOptions cannot be null."); else if (_reactor.isShutdown()) return _reactor.populateErrorInfo(errorInfo, ReactorReturnCodes.FAILURE, "ReactorChannel.dispatch", "Reactor is shutdown, dispatch aborted."); return _reactor.dispatchChannel(this, dispatchOptions, errorInfo); }
return ReactorReturnCodes.FAILURE; else if (submitOptions == null) return reactor().populateErrorInfo(errorInfo, ReactorReturnCodes.FAILURE, "ReactorChannel.submit", "submitOptions cannot be null.");
return ReactorReturnCodes.FAILURE; else if (submitOptions == null) return reactor().populateErrorInfo(errorInfo, ReactorReturnCodes.FAILURE, "ReactorChannel.submit", "submitOptions cannot be null.");
if (rsslReactorChannel != null && rsslReactorChannel.channel() != null) temp.append("RsslReactor ").append("@").append(Integer.toHexString(rsslReactorChannel.reactor().hashCode())).append(OmmLoggerClient.CR).append("RsslChannel ").append("@") .append(Integer.toHexString(rsslReactorChannel.channel().hashCode())).append(OmmLoggerClient.CR); temp.append("RsslReactor ").append("@").append(Integer.toHexString(rsslReactorChannel.reactor().hashCode())) .append(OmmLoggerClient.CR).append("RsslChannel ").append("@").append(Integer.toHexString(rsslReactorChannel.channel().hashCode())).append(OmmLoggerClient.CR); temp.append("RsslReactor ").append("@").append(Integer.toHexString(rsslReactorChannel.reactor().hashCode())) .append(OmmLoggerClient.CR).append("RsslChannel ").append("@").append(Integer.toHexString(rsslReactorChannel.channel().hashCode())).append(OmmLoggerClient.CR); temp.append("RsslReactor ").append("@").append(Integer.toHexString(rsslReactorChannel.reactor().hashCode())) .append(OmmLoggerClient.CR).append("RsslChannel ").append("@").append(Integer.toHexString(rsslReactorChannel.channel().hashCode())).append(OmmLoggerClient.CR); temp.append("RsslReactor ").append("@").append(Integer.toHexString(rsslReactorChannel.reactor().hashCode())) .append(OmmLoggerClient.CR).append("RsslChannel ").append("@").append(Integer.toHexString(rsslReactorChannel.channel().hashCode())).append(OmmLoggerClient.CR); temp.append("RsslReactor ").append("@").append(Integer.toHexString(rsslReactorChannel.reactor().hashCode())) .append(OmmLoggerClient.CR).append("RsslChannel ").append("@").append(Integer.toHexString(rsslReactorChannel.channel().hashCode())).append(OmmLoggerClient.CR); temp.append("RsslReactor ").append("@").append(Integer.toHexString(rsslReactorChannel.reactor().hashCode())) .append(OmmLoggerClient.CR).append("RsslChannel ").append("@").append(Integer.toHexString(rsslReactorChannel.channel().hashCode())).append(OmmLoggerClient.CR); temp.append("RsslReactor ").append("@").append(Integer.toHexString(rsslReactorChannel.reactor().hashCode())).append(OmmLoggerClient.CR) .append("RsslChannel ").append("@").append(Integer.toHexString(rsslReactorChannel.channel().hashCode())).append(OmmLoggerClient.CR); temp.append("RsslReactor ").append("@").append(Integer.toHexString(rsslReactorChannel.reactor().hashCode())).append(OmmLoggerClient.CR).append("RsslChannel ") .append("@").append(Integer.toHexString(rsslReactorChannel.channel().hashCode())).append(OmmLoggerClient.CR);
int initializeReactor(ReactorErrorInfo errorInfo) { try { // create SelectableBiDirectionalQueue _workerQueue = new SelectableBiDirectionalQueue(); // create a new ReactorChannel and populate with the readChannel // side of our _workerQueue. _reactorChannel = ReactorFactory.createReactorChannel(); _reactorChannel.reactor(this); _reactorChannel.userSpecObj(this); _reactorChannel.selectableChannel(_workerQueue.readChannel()); // create the worker thread. _worker = new Worker(_reactorChannel, _workerQueue.remote()); _esWorker = Executors.newSingleThreadExecutor(); _esWorker.execute(_worker); } catch (RejectedExecutionException | NullPointerException e) { return populateErrorInfo(errorInfo, ReactorReturnCodes.FAILURE, "Reactor.initializeReactor", "failed to initialize the Worker, exception=" + e.getLocalizedMessage()); } return ReactorReturnCodes.SUCCESS; }
.append("RsslReactor ").append("@").append(Integer.toHexString(rsslReactorChannel != null ? rsslReactorChannel.reactor().hashCode() : 0)).append(OmmLoggerClient.CR) .append("RsslChannel ").append("@").append(Integer.toHexString(error.channel() != null ? error.channel().hashCode() : 0)).append(OmmLoggerClient.CR) .append("Error Id ").append(error.errorId()).append(OmmLoggerClient.CR)
.append(OmmLoggerClient.CR).append("Instance Name ").append(_baseImpl.instanceName()) .append(OmmLoggerClient.CR).append("RsslReactor ") .append(Integer.toHexString(tunnelStreamStatusEvent.reactorChannel().reactor().hashCode()));
requestItems(chnlInfo.reactorChannel.reactor(), chnlInfo.reactorChannel);
return ReactorReturnCodes.FAILURE; else if (options == null) return reactor().populateErrorInfo(errorInfo, ReactorReturnCodes.FAILURE, "ReactorChannel.openTunnelStream", "TunnelStreamOpenOptions cannot be null");
_reactor = _reactorChannel.reactor(); _queueData = QueueMsgFactory.createQueueData(); _queueDataExpired = QueueMsgFactory.createQueueDataExpired();
reactorChannel.state(State.INITIALIZING); reactorChannel.role(role); reactorChannel.reactor(this); reactorChannel.initializationTimeout(reactorAcceptOptions.initTimeout()); reactorChannel.server(server);
return ReactorReturnCodes.FAILURE; else if (event == null) return reactor().populateErrorInfo(errorInfo, ReactorReturnCodes.FAILURE, "ReactorChannel.rejectTunnelStream", "TunnelStreamRequestEvent cannot be null"); else if (options == null) return reactor().populateErrorInfo(errorInfo, ReactorReturnCodes.FAILURE, "ReactorChannel.rejectTunnelStream", "options cannot be null");
return ReactorReturnCodes.FAILURE; else if (event == null) return reactor().populateErrorInfo(errorInfo, ReactorReturnCodes.FAILURE, "ReactorChannel.acceptTunnelStream", "TunnelStreamRequestEvent cannot be null"); else if (options == null) return reactor().populateErrorInfo(errorInfo, ReactorReturnCodes.FAILURE, "ReactorChannel.acceptTunnelStream", "TunnelStreamAcceptOptions cannot be null");