private boolean isClassOfServiceValid(ClassOfService classOfService) { return (classOfService.common().maxMsgSize() == _expectedClassOfService.common().maxMsgSize() && classOfService.common().protocolType() == _expectedClassOfService.common().protocolType() && classOfService.common().protocolMajorVersion() == _expectedClassOfService.common().protocolMajorVersion() && classOfService.common().protocolMinorVersion() == _expectedClassOfService.common().protocolMinorVersion() && (classOfService.authentication().type() == _expectedClassOfService.authentication().type() || classOfService.authentication().type() == ClassesOfService.AuthenticationTypes.NOT_REQUIRED) && classOfService.flowControl().type() == _expectedClassOfService.flowControl().type() && classOfService.dataIntegrity().type() == _expectedClassOfService.dataIntegrity().type() && classOfService.guarantee().type() == _expectedClassOfService.guarantee().type()); }
/** * Setup buffer pool. */ void setupBufferPool() { _bufferPool = new SlicedBufferPool(_classOfService.common().maxFragmentSize(), guaranteedOutputBuffers()); }
void copy(ConsumerRole role) { super.copy(role); _loginMsgCallback = role.loginMsgCallback(); _directoryMsgCallback = role.directoryMsgCallback(); _dictionaryMsgCallback = role.dictionaryMsgCallback(); _dictionaryDownloadMode = role.dictionaryDownloadMode(); _consumerWatchlistOptions.copy(role.watchlistOptions()); copyLoginRequest(role.rdmLoginRequest()); copyDirectoryRequest(role.rdmDirectoryRequest()); }
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; }
public TunnelStreamHandler() { // set the expected class of service for this provider (use defaults for common properties) _expectedClassOfService.authentication().type(ClassesOfService.AuthenticationTypes.OMM_LOGIN); _expectedClassOfService.flowControl().type(ClassesOfService.FlowControlTypes.BIDIRECTIONAL); _expectedClassOfService.dataIntegrity().type(ClassesOfService.DataIntegrityTypes.RELIABLE); }
void copy(ProviderRole role) { super.copy(role); _loginMsgCallback = role.loginMsgCallback(); _directoryMsgCallback = role.directoryMsgCallback(); _dictionaryMsgCallback = role.dictionaryMsgCallback(); _tunnelStreamListenerCallback = role.tunnelStreamListenerCallback(); } }
void copy(NIProviderRole role) { super.copy(role); _loginMsgCallback = role.loginMsgCallback(); copyLoginRequest(role.rdmLoginRequest()); copyDirectoryRefresh(role.rdmDirectoryRefresh()); }
int getMaxFragmentSize(TunnelStream tunnelStream) { return tunnelStream.classOfService().common().maxFragmentSize(); }
private void processWorkerShutdown(WorkerEvent event, String location, ReactorErrorInfo errorInfo) { populateErrorInfo(errorInfo, ReactorReturnCodes.FAILURE, location, "Worker has shutdown, " + event.errorInfo().toString()); }
/** Disconnect a consumer and provider component and clean them up. */ public static void closeSession(Consumer consumer, Provider provider) { /* Make sure there's nothing left in the dispatch queue. */ consumer.testReactor().dispatch(0); provider.testReactor().dispatch(0); consumer.close(); provider.close(); }
void getBufferSlice(TunnelStreamBuffer bufferImpl, int length, boolean isForUser) { if (_numberOfCalls++ < _numberBuffersToReturn) { super.getBufferSlice(bufferImpl, length, isForUser); } else { bufferImpl.data(null); } } }
/** * Returns a String representation of this object. * * @return a String representation of this object */ public String toString() { return super.toString() + ", " + (_reactorChannel == null ? "ReactorChannel null" : _reactorChannel.toString()) + ", " + ReactorChannelEventTypes.toString(_eventType); } }
/** Sends an RDM message to the component's channel, and dispatches to ensure no events are received and any internal flush events are processed. */ int submitAndDispatch(MsgBase msg, ReactorSubmitOptions submitOptions) { int ret = submit(msg, submitOptions); testReactor().dispatch(0); return ret; }
private WlView removeRequestView(WlStream wlStream, WlRequest wlRequest, ReactorErrorInfo errorInfo) { _wlViewHandler.removeRequestView(wlStream, wlRequest, errorInfo); wlStream._pendingViewChange = true; return wlRequest.view(); }
@Override void releasePersistenceBuffer(TunnelStreamPersistenceBuffer persistBuffer) { persistenceBufferListMove( _savedMsgList, Header.SAVED_HEAD_POS, _persistentBufferPool, Header.POOL_HEAD_POS, persistBuffer); persistBuffer.reset(); }
void channelDown() { _loginHandler.channelDown(); _directoryHandler.deleteAllServices(true); // Delete all services (this will also trigger item status fanout) }