/** * Creates a provider-side tunnel stream. * * @param reactorChannel the reactor channel * @param event the event * @param options the options */ public TunnelStream(ReactorChannel reactorChannel, TunnelStreamRequestEvent event, TunnelStreamAcceptOptions options) { this(reactorChannel); _streamId = event.streamId(); _domainType = event.domainType(); _serviceId = event.serviceId(); _guaranteedOutputBuffers = options.guaranteedOutputBuffers(); options.classOfService().copy(_classOfService); _defaultMsgCallback = options.defaultMsgCallback(); _statusEventCallback = options.statusEventCallback(); _name = event.name(); _userSpecObject = options.userSpecObject(); _isProvider = true; _bigBufferPool = new TunnelStreamBigBufferPool(options.classOfService().common().maxFragmentSize(), options.guaranteedOutputBuffers()); }
/** * 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()); }
/** Construct a tunnel stream request event. */ public TestReactorEvent(TunnelStreamRequestEvent tunnelStreamRequestEvent) { _type = TestReactorEventTypes.TUNNEL_STREAM_REQUEST; _tunnelStreamRequestEvent = new TunnelStreamRequestEvent(); /* Copy the event. */ _tunnelStreamRequestEvent.reactorChannel(tunnelStreamRequestEvent.reactorChannel()); _tunnelStreamRequestEvent.domainType(tunnelStreamRequestEvent.domainType()); _tunnelStreamRequestEvent.streamId(tunnelStreamRequestEvent.streamId()); _tunnelStreamRequestEvent.serviceId(tunnelStreamRequestEvent.serviceId()); _tunnelStreamRequestEvent.name(tunnelStreamRequestEvent.name()); _tunnelStreamRequestEvent.msg((RequestMsg)CodecFactory.createMsg()); tunnelStreamRequestEvent.msg().copy(_tunnelStreamRequestEvent.msg(), CopyMsgFlags.ALL_FLAGS); if (tunnelStreamRequestEvent.errorInfo() != null) { _tunnelStreamRequestEvent.errorInfo(ReactorFactory.createReactorErrorInfo()); TestUtil.copyErrorInfo(tunnelStreamRequestEvent.errorInfo(), _tunnelStreamRequestEvent.errorInfo()); } _tunnelStreamRequestEvent.classOfServiceFilter(tunnelStreamRequestEvent.classOfServiceFilter()); tunnelStreamRequestEvent.classOfService().copy(_tunnelStreamRequestEvent.classOfService()); } }