/** * Constructor for the <code>ContinueDispatcher</code> object. This * will create an object that will deliver the continue status code. * Because the transport performs an asynchronous write this will * not block the execution of this method and delay execution. * * @param channel this is the channel used to deliver the prompt */ public ContinueDispatcher(Channel channel) { this.writer = channel.getWriter(); this.trace = channel.getTrace(); }
/** * Constructor for the <code>Expectation</code> object. This will * create an object that will deliver the continue status code. * Because the transport performs an asynchronous write this will * not block the execution of this method and delay execution. * * @param channel this is the channel used to deliver the prompt */ public Expectation(Channel channel) { this.sender = channel.getSender(); this.trace = channel.getTrace(); }
/** * Constructor for the <code>ContinueDispatcher</code> object. This * will create an object that will deliver the continue status code. * Because the transport performs an asynchronous write this will * not block the execution of this method and delay execution. * * @param channel this is the channel used to deliver the prompt */ public ContinueDispatcher(Channel channel) { this.writer = channel.getWriter(); this.trace = channel.getTrace(); }
/** * Constructor for the <code>RequestReader</code> object. This is * used to collect the data required to compose a HTTP request. * Once all the data has been read by this it is dispatched. * * @param controller the controller object used to process events * @param collector this is the task used to collect the entity */ public RequestReader(Controller controller, Collector collector){ this.channel = collector.getChannel(); this.trace = channel.getTrace(); this.collector = collector; this.controller = controller; }
/** * Constructor for the <code>RequestReader</code> object. This is * used to collect the data required to compose a HTTP request. * Once all the data has been read by this it is dispatched. * * @param controller the controller object used to process events * @param collector this is the task used to collect the entity */ public RequestReader(Controller controller, Collector collector){ this.channel = collector.getChannel(); this.trace = channel.getTrace(); this.collector = collector; this.controller = controller; }
/** * Constructor for the <code>Transfer</code> object, this is used * to create an object used to transfer a response body. This must * be given a <code>Conversation</code> that can be used to set * and get information regarding the type of transfer required. * * @param support this is used to determine the semantics * @param sender this is used to send data over the transport * @param monitor this is used to signal I/O events to the kernel */ public Transfer(Response response, Conversation support, Channel channel, Monitor monitor) { this.factory = new ProducerFactory(support, channel, monitor); this.trace = channel.getTrace(); this.response = response; this.support = support; }
/** * Constructor for the <code>ResponseEncoder</code> object, this is * used to create an object used to transfer a response body. This * must be given a <code>Conversation</code> that can be used to set * and get information regarding the type of transfer required. * * @param observer this is used to signal for response completion * @param response this is the actual response message * @param support this is used to determine the semantics * @param channel this is the connected TCP channel for the response */ public ResponseEncoder(BodyObserver observer, Response response, Conversation support, Channel channel) { this.factory = new BodyEncoderFactory(observer, support, channel); this.trace = channel.getTrace(); this.response = response; this.support = support; }
/** * Constructor for the <code>FlushMonitor</code> object. This is * used to create a monitor using a HTTP request entity and an * initiator which is used to reprocess a channel if there was a * successful deliver of a response. * * @param reactor this is the reactor used to process channels * @param entity this is the entity associated with the channel */ public FlushMonitor(Initiator reactor, Entity entity) { this.timer = new Timer(MILLISECONDS); this.channel = entity.getChannel(); this.trace = channel.getTrace(); this.reactor = reactor; }
/** * Constructor for the <code>FrameEncoder</code> object. This is * used to create an encoder to sending frames over the provided * channel. Frames send remain unflushed so they can be batched * on a single output buffer. * * @param request contains the opening handshake information * @param charset this is the character encoding to encode with */ public FrameEncoder(Request request, String charset) { this.barrier = new OutputBarrier(request, 5000); this.channel = request.getChannel(); this.trace = channel.getTrace(); this.charset = charset; }
/** * Constructor for the <code>FrameEncoder</code> object. This is * used to create an encoder to sending frames over the provided * channel. Frames send remain unflushed so they can be batched * on a single output buffer. * * @param request contains the opening handshake information * @param charset this is the character encoding to encode with */ public FrameEncoder(Request request, String charset) { this.barrier = new OutputBarrier(request, 5000); this.channel = request.getChannel(); this.trace = channel.getTrace(); this.charset = charset; }
/** * Constructor for the <code>EntityConsumer</code> object. This * is used to build an entity from the constituent parts. Once * all of the parts have been consumed they are available from * the exposed methods of this consumed instance. * * @param allocator this is used to allocate the memory used * @param channel this is the channel used to send a response */ public EntityConsumer(Allocator allocator, Channel channel) { this.header = new RequestConsumer(); this.expect = new Expectation(channel); this.factory = new ConsumerFactory(allocator, header); this.trace = channel.getTrace(); }
/** * Constructor for the <code>EntityConsumer</code> object. This * is used to build an entity from the constituent parts. Once * all of the parts have been consumed they are available from * the exposed methods of this consumed instance. * * @param allocator this is used to allocate the memory used * @param channel this is the channel used to send a response */ public EntityConsumer(Allocator allocator, Channel channel) { this.header = new RequestConsumer(); this.dispatcher = new ContinueDispatcher(channel); this.factory = new ConsumerFactory(allocator, header); this.trace = channel.getTrace(); }
/** * Constructor for the <code>EntityConsumer</code> object. This * is used to build an entity from the constituent parts. Once * all of the parts have been consumed they are available from * the exposed methods of this consumed instance. * * @param allocator this is used to allocate the memory used * @param channel this is the channel used to send a response */ public EntityConsumer(Allocator allocator, Channel channel) { this.header = new RequestConsumer(); this.dispatcher = new ContinueDispatcher(channel); this.factory = new ConsumerFactory(allocator, header); this.trace = channel.getTrace(); }
/** * The <code>Collector</code> object used to collect the data from * the underlying transport. In order to collect a body this must * be given an <code>Allocator</code> which is used to create an * internal buffer to store the consumed body. * * @param allocator this is the allocator used to buffer data * @param tracker this is the tracker used to create sessions * @param channel this is the channel used to read the data */ public Collector(Allocator allocator, Channel channel) { this.entity = new EntityConsumer(allocator, channel); this.timer = new Timer(MILLISECONDS); this.cursor = channel.getCursor(); this.trace = channel.getTrace(); this.channel = channel; }
/** * Constructor for the <code>FrameCollector</code> object. This is * used to create a collector that will process and dispatch web * socket frames as defined by RFC 6455. * * @param encoder this is the encoder used to send messages * @param session this is the web socket session * @param channel this is the underlying TCP communication channel * @param reactor this is the reactor used for read notifications */ public FrameCollector(FrameEncoder encoder, Session session, Request request, Reactor reactor) { this.processor = new FrameProcessor(encoder, session, request); this.channel = request.getChannel(); this.cursor = channel.getCursor(); this.trace = channel.getTrace(); this.reactor = reactor; }
/** * Constructor for the <code>FrameCollector</code> object. This is * used to create a collector that will process and dispatch web * socket frames as defined by RFC 6455. * * @param encoder this is the encoder used to send messages * @param session this is the web socket session * @param channel this is the underlying TCP communication channel * @param reactor this is the reactor used for read notifications */ public FrameCollector(FrameEncoder encoder, Session session, Request request, Reactor reactor) { this.processor = new FrameProcessor(encoder, session, request); this.channel = request.getChannel(); this.cursor = channel.getCursor(); this.trace = channel.getTrace(); this.reactor = reactor; }
/** * Constructor for the <code>RequestDispatcher</code> object. This * creates a request and response object using the provided entity, * these can then be passed to the container to handle it. * * @param container this is the container to handle the request * @param controller the controller used to handle the next request * @param entity this contains the current request entity */ public RequestDispatcher(Container container, Controller controller, Entity entity) { this.observer = new ResponseObserver(controller, entity); this.request = new RequestEntity(observer, entity); this.response = new ResponseEntity(observer, request, entity); this.channel = entity.getChannel(); this.trace = channel.getTrace(); this.container = container; }
/** * Constructor for the <code>ResponseBuilder</code> object. In order * to process the WebSocket handshake this requires the original * request and the response as well as the underlying TCP channel * which forms the basis of the WebSocket connection. * * @param request this is the request that initiated the handshake * @param response this is the response for the handshake */ public ResponseBuilder(Request request, Response response) throws Exception { this.validator = new RequestValidator(request); this.token = new AcceptToken(request); this.channel = request.getChannel(); this.writer = channel.getWriter(); this.trace = channel.getTrace(); this.response = response; }
/** * Constructor for the <code>ResponseBuilder</code> object. In order * to process the WebSocket handshake this requires the original * request and the response as well as the underlying TCP channel * which forms the basis of the WebSocket connection. * * @param request this is the request that initiated the handshake * @param response this is the response for the handshake */ public ResponseBuilder(Request request, Response response) throws Exception { this.validator = new RequestValidator(request); this.token = new AcceptToken(request); this.channel = request.getChannel(); this.writer = channel.getWriter(); this.trace = channel.getTrace(); this.response = response; }
/** * Constructor for the <code>RequestDispatcher</code> object. This * creates a request and response object using the provided entity, * these can then be passed to the container to handle it. * * @param container this is the container to handle the request * @param controller the controller used to handle the next request * @param entity this contains the current request entity */ public RequestDispatcher(Container container, Controller controller, Entity entity) { this.observer = new ResponseObserver(controller, entity); this.request = new RequestEntity(observer, entity); this.response = new ResponseEntity(observer, request, entity); this.channel = entity.getChannel(); this.trace = channel.getTrace(); this.container = container; }