/** * Constructor for the <code>BodyEncoderFactory</code> object. * This is used to create producers that can encode data in a HTTP * compliant format. Each producer created will produce its data * and deliver it to the specified sender, should an I/O events * occur such as an error, or completion of the response then * the monitor is notified and the server kernel takes action. * * @param observer this is used to deliver signals to the kernel * @param support this contains details regarding the semantics * @param writer this is used to send to the underlying transport */ public BodyEncoderFactory(BodyObserver observer, Conversation support, Channel channel) { this.writer = channel.getWriter(); this.observer = observer; this.support = support; }
/** * Constructor for the <code>BodyEncoderFactory</code> object. * This is used to create producers that can encode data in a HTTP * compliant format. Each producer created will produce its data * and deliver it to the specified sender, should an I/O events * occur such as an error, or completion of the response then * the monitor is notified and the server kernel takes action. * * @param observer this is used to deliver signals to the kernel * @param support this contains details regarding the semantics * @param writer this is used to send to the underlying transport */ public BodyEncoderFactory(BodyObserver observer, Conversation support, Channel channel) { this.writer = channel.getWriter(); this.observer = observer; this.support = support; }
/** * 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>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>OutputBarrier</code> object. This * is used to ensure that if there is currently a blocking write * in place that the <code>SessionChecker</code> will not end up * being blocked if it attempts to send a control frame. * * @param request this is the request to get the TCP channel from * @param duration this is the length of time to wait for the lock */ public OutputBarrier(Request request, long duration) { this.lock = new ReentrantLock(); this.channel = request.getChannel(); this.writer = channel.getWriter(); this.duration = duration; }
/** * Constructor for the <code>OutputBarrier</code> object. This * is used to ensure that if there is currently a blocking write * in place that the <code>SessionChecker</code> will not end up * being blocked if it attempts to send a control frame. * * @param request this is the request to get the TCP channel from * @param duration this is the length of time to wait for the lock */ public OutputBarrier(Request request, long duration) { this.lock = new ReentrantLock(); this.channel = request.getChannel(); this.writer = channel.getWriter(); this.duration = duration; }
/** * 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>ResponseEntity</code> object. This is * used to create a response instance using the provided request, * entity, and monitor object. To ensure that the response is * compatible with client the <code>Request</code> is used. Also * to ensure the next request can be processed the provided monitor * is used to signal response events to the server kernel. * * @param observer this is the observer used to signal events * @param request this is the request that was sent by the client * @param entity this is the entity that contains the channel */ public ResponseEntity(BodyObserver observer, Request request, Entity entity) { this.support = new Conversation(request, this); this.buffer = new ResponseBuffer(observer, this, support, entity); this.channel = entity.getChannel(); this.sender = channel.getWriter(); this.trace = channel.getTrace(); this.observer = observer; }
/** * Constructor for the <code>ResponseEntity</code> object. This is * used to create a response instance using the provided request, * entity, and monitor object. To ensure that the response is * compatible with client the <code>Request</code> is used. Also * to ensure the next request can be processed the provided monitor * is used to signal response events to the server kernel. * * @param observer this is the observer used to signal events * @param request this is the request that was sent by the client * @param entity this is the entity that contains the channel */ public ResponseEntity(BodyObserver observer, Request request, Entity entity) { this.support = new Conversation(request, this); this.buffer = new ResponseBuffer(observer, this, support, entity); this.channel = entity.getChannel(); this.sender = channel.getWriter(); this.trace = channel.getTrace(); this.observer = observer; }
/** * Constructor for the <code>FrameConnection</code> object. This is used * to create a channel that can read and write frames over a TCP * channel. For asynchronous read and dispatch operations this will * produce an operation to collect and process RFC 6455 frames. * * @param request this is the initiating request for the WebSocket * @param response this is the initiating response for the WebSocket * @param reactor this is the reactor used to process frames */ public FrameConnection(Request request, Response response, Reactor reactor) { this.encoder = new FrameEncoder(request); this.session = new ServiceSession(this, request, response); this.operation = new FrameCollector(encoder, session, request, reactor); this.reason = new Reason(NORMAL_CLOSURE); this.channel = request.getChannel(); this.writer = channel.getWriter(); this.trace = channel.getTrace(); }
/** * Constructor for the <code>FrameConnection</code> object. This is used * to create a channel that can read and write frames over a TCP * channel. For asynchronous read and dispatch operations this will * produce an operation to collect and process RFC 6455 frames. * * @param request this is the initiating request for the WebSocket * @param response this is the initiating response for the WebSocket * @param reactor this is the reactor used to process frames */ public FrameConnection(Request request, Response response, Reactor reactor) { this.encoder = new FrameEncoder(request); this.session = new ServiceSession(this, request, response); this.operation = new FrameCollector(encoder, session, request, reactor); this.reason = new Reason(NORMAL_CLOSURE); this.channel = request.getChannel(); this.writer = channel.getWriter(); this.trace = channel.getTrace(); }