@Override public NextAction handleRead(FilterChainContext ctx) throws IOException { try { ctx.getAttributes().setAttribute(HTTPS.getScheme(), true); NextAction nextAction = super.handleRead(ctx); ctx.getAttributes().setAttribute(SSL_SESSION_ATTRIBUTE_KEY, getSslSession(ctx)); return nextAction; } catch (SSLHandshakeException e) { logger.error("SSL handshake error: " + e.getMessage()); throw e; } }
public void notifyUpstream(final FilterChainEvent event, final CompletionHandler<FilterChainContext> completionHandler) { final FilterChainContext newContext = getFilterChain().obtainFilterChainContext(getConnection()); newContext.setOperation(Operation.EVENT); newContext.event = event; newContext.closeable = closeable; newContext.addressHolder = addressHolder; newContext.startIdx = filterIdx + 1; newContext.filterIdx = filterIdx + 1; newContext.endIdx = endIdx; getAttributes().copyTo(newContext.getAttributes()); newContext.operationCompletionHandler = completionHandler; ProcessorExecutor.execute(newContext.internalContext); }
public void flush(final CompletionHandler completionHandler) { final FilterChainContext newContext = getFilterChain().obtainFilterChainContext(getConnection()); newContext.operation = Operation.EVENT; newContext.closeable = closeable; newContext.event = TransportFilter.createFlushEvent(completionHandler); newContext.transportFilterContext.configureBlocking(transportFilterContext.isBlocking()); newContext.addressHolder = addressHolder; newContext.startIdx = filterIdx - 1; newContext.filterIdx = filterIdx - 1; newContext.endIdx = -1; getAttributes().copyTo(newContext.getAttributes()); ProcessorExecutor.execute(newContext.internalContext); }
public void flush(final CompletionHandler completionHandler) { final FilterChainContext newContext = getFilterChain().obtainFilterChainContext(getConnection()); newContext.operation = Operation.EVENT; newContext.closeable = closeable; newContext.event = TransportFilter.createFlushEvent(completionHandler); newContext.transportFilterContext.configureBlocking(transportFilterContext.isBlocking()); newContext.addressHolder = addressHolder; newContext.startIdx = filterIdx - 1; newContext.filterIdx = filterIdx - 1; newContext.endIdx = -1; getAttributes().copyTo(newContext.getAttributes()); ProcessorExecutor.execute(newContext.internalContext); }
public void flush(final CompletionHandler completionHandler) { final FilterChainContext newContext = getFilterChain().obtainFilterChainContext(getConnection()); newContext.operation = Operation.EVENT; newContext.closeable = closeable; newContext.event = TransportFilter.createFlushEvent(completionHandler); newContext.transportFilterContext.configureBlocking(transportFilterContext.isBlocking()); newContext.addressHolder = addressHolder; newContext.startIdx = filterIdx - 1; newContext.filterIdx = filterIdx - 1; newContext.endIdx = -1; getAttributes().copyTo(newContext.getAttributes()); ProcessorExecutor.execute(newContext.internalContext); }
public void flush(final CompletionHandler completionHandler) { final FilterChainContext newContext = getFilterChain().obtainFilterChainContext(getConnection()); newContext.operation = Operation.EVENT; newContext.closeable = closeable; newContext.event = TransportFilter.createFlushEvent(completionHandler); newContext.transportFilterContext.configureBlocking(transportFilterContext.isBlocking()); newContext.addressHolder = addressHolder; newContext.startIdx = filterIdx - 1; newContext.filterIdx = filterIdx - 1; newContext.endIdx = -1; getAttributes().copyTo(newContext.getAttributes()); ProcessorExecutor.execute(newContext.internalContext); }
public void flush(final CompletionHandler completionHandler) { final FilterChainContext newContext = getFilterChain().obtainFilterChainContext(getConnection()); newContext.operation = Operation.EVENT; newContext.closeable = closeable; newContext.event = TransportFilter.createFlushEvent(completionHandler); newContext.transportFilterContext.configureBlocking(transportFilterContext.isBlocking()); newContext.addressHolder = addressHolder; newContext.startIdx = filterIdx - 1; newContext.filterIdx = filterIdx - 1; newContext.endIdx = -1; getAttributes().copyTo(newContext.getAttributes()); ProcessorExecutor.execute(newContext.internalContext); }
public void flush(final CompletionHandler completionHandler) { final FilterChainContext newContext = getFilterChain().obtainFilterChainContext(getConnection()); newContext.operation = Operation.EVENT; newContext.closeable = closeable; newContext.event = TransportFilter.createFlushEvent(completionHandler); newContext.transportFilterContext.configureBlocking(transportFilterContext.isBlocking()); newContext.addressHolder = addressHolder; newContext.startIdx = filterIdx - 1; newContext.filterIdx = filterIdx - 1; newContext.endIdx = -1; getAttributes().copyTo(newContext.getAttributes()); ProcessorExecutor.execute(newContext.internalContext); }
public void flush(final CompletionHandler completionHandler) { final FilterChainContext newContext = getFilterChain().obtainFilterChainContext(getConnection()); newContext.operation = Operation.EVENT; newContext.closeable = closeable; newContext.event = TransportFilter.createFlushEvent(completionHandler); newContext.transportFilterContext.configureBlocking(transportFilterContext.isBlocking()); newContext.addressHolder = addressHolder; newContext.startIdx = filterIdx - 1; newContext.filterIdx = filterIdx - 1; newContext.endIdx = -1; getAttributes().copyTo(newContext.getAttributes()); ProcessorExecutor.execute(newContext.internalContext); }
public void flush(final CompletionHandler completionHandler) { final FilterChainContext newContext = getFilterChain().obtainFilterChainContext(getConnection()); newContext.operation = Operation.EVENT; newContext.closeable = closeable; newContext.event = TransportFilter.createFlushEvent(completionHandler); newContext.transportFilterContext.configureBlocking(transportFilterContext.isBlocking()); newContext.addressHolder = addressHolder; newContext.startIdx = filterIdx - 1; newContext.filterIdx = filterIdx - 1; newContext.endIdx = -1; getAttributes().copyTo(newContext.getAttributes()); ProcessorExecutor.execute(newContext.internalContext); }
public void flush(final CompletionHandler completionHandler) { final FilterChainContext newContext = getFilterChain().obtainFilterChainContext(getConnection()); newContext.operation = Operation.EVENT; newContext.closeable = closeable; newContext.event = TransportFilter.createFlushEvent(completionHandler); newContext.transportFilterContext.configureBlocking(transportFilterContext.isBlocking()); newContext.addressHolder = addressHolder; newContext.startIdx = filterIdx - 1; newContext.filterIdx = filterIdx - 1; newContext.endIdx = -1; getAttributes().copyTo(newContext.getAttributes()); ProcessorExecutor.execute(newContext.internalContext); }
public void flush(final CompletionHandler completionHandler) { final FilterChainContext newContext = getFilterChain().obtainFilterChainContext(getConnection()); newContext.operation = Operation.EVENT; newContext.closeable = closeable; newContext.event = TransportFilter.createFlushEvent(completionHandler); newContext.transportFilterContext.configureBlocking(transportFilterContext.isBlocking()); newContext.addressHolder = addressHolder; newContext.startIdx = filterIdx - 1; newContext.filterIdx = filterIdx - 1; newContext.endIdx = -1; getAttributes().copyTo(newContext.getAttributes()); ProcessorExecutor.execute(newContext.internalContext); }
public void flush(final CompletionHandler completionHandler) { final FilterChainContext newContext = getFilterChain().obtainFilterChainContext(getConnection()); newContext.operation = Operation.EVENT; newContext.closeable = closeable; newContext.event = TransportFilter.createFlushEvent(completionHandler); newContext.transportFilterContext.configureBlocking(transportFilterContext.isBlocking()); newContext.addressHolder = addressHolder; newContext.startIdx = filterIdx - 1; newContext.filterIdx = filterIdx - 1; newContext.endIdx = -1; getAttributes().copyTo(newContext.getAttributes()); ProcessorExecutor.execute(newContext.internalContext); }
public FilterChainContext copy() { final FilterChain p = getFilterChain(); final FilterChainContext newContext = p.obtainFilterChainContext(getConnection()); newContext.setOperation(getOperation()); newContext.setCloseable(getCloseable()); internalContext.softCopyTo(newContext.internalContext); newContext.setStartIdx(getStartIdx()); newContext.setEndIdx(getEndIdx()); newContext.setFilterIdx(getFilterIdx()); getAttributes().copyTo(newContext.getAttributes()); notifyCopy(this, newContext, copyListeners); return newContext; }
public FilterChainContext copy() { final FilterChain p = getFilterChain(); final FilterChainContext newContext = p.obtainFilterChainContext(getConnection()); newContext.setOperation(getOperation()); newContext.setCloseable(getCloseable()); internalContext.softCopyTo(newContext.internalContext); newContext.setStartIdx(getStartIdx()); newContext.setEndIdx(getEndIdx()); newContext.setFilterIdx(getFilterIdx()); getAttributes().copyTo(newContext.getAttributes()); notifyCopy(this, newContext, copyListeners); return newContext; }
public FilterChainContext copy() { final FilterChain p = getFilterChain(); final FilterChainContext newContext = p.obtainFilterChainContext(getConnection()); newContext.setOperation(getOperation()); newContext.setCloseable(getCloseable()); internalContext.softCopyTo(newContext.internalContext); newContext.setStartIdx(getStartIdx()); newContext.setEndIdx(getEndIdx()); newContext.setFilterIdx(getFilterIdx()); getAttributes().copyTo(newContext.getAttributes()); notifyCopy(this, newContext, copyListeners); return newContext; }
public FilterChainContext copy() { final FilterChain p = getFilterChain(); final FilterChainContext newContext = p.obtainFilterChainContext(getConnection()); newContext.setOperation(getOperation()); newContext.setCloseable(getCloseable()); internalContext.softCopyTo(newContext.internalContext); newContext.setStartIdx(getStartIdx()); newContext.setEndIdx(getEndIdx()); newContext.setFilterIdx(getFilterIdx()); getAttributes().copyTo(newContext.getAttributes()); notifyCopy(this, newContext, copyListeners); return newContext; }
public FilterChainContext copy() { final FilterChain p = getFilterChain(); final FilterChainContext newContext = p.obtainFilterChainContext(getConnection()); newContext.setOperation(getOperation()); newContext.setCloseable(getCloseable()); internalContext.softCopyTo(newContext.internalContext); newContext.setStartIdx(getStartIdx()); newContext.setEndIdx(getEndIdx()); newContext.setFilterIdx(getFilterIdx()); getAttributes().copyTo(newContext.getAttributes()); notifyCopy(this, newContext, copyListeners); return newContext; }
private HttpRequestContext createRequestContext(FilterChainContext ctx, String scheme, GrizzlyHttpRequestAdapter httpRequest) { ClientConnection clientConnection; SSLSession sslSession = (SSLSession) ctx.getAttributes().getAttribute(SSL_SESSION_ATTRIBUTE_KEY); if (sslSession != null) { clientConnection = new ClientConnection(sslSession, (InetSocketAddress) ctx.getConnection().getPeerAddress()); } else { clientConnection = new ClientConnection((InetSocketAddress) ctx.getConnection().getPeerAddress()); } return new HttpRequestContext(httpRequest, clientConnection, scheme); }
private DefaultHttpRequestContext createRequestContext(FilterChainContext ctx, String scheme, GrizzlyHttpRequestAdapter httpRequest) { DefaultClientConnection clientConnection; SSLSession sslSession = (SSLSession) ctx.getAttributes().getAttribute(SSL_SESSION_ATTRIBUTE_KEY); if (sslSession != null) { clientConnection = new DefaultClientConnection(sslSession, (InetSocketAddress) ctx.getConnection().getPeerAddress()); } else { clientConnection = new DefaultClientConnection((InetSocketAddress) ctx.getConnection().getPeerAddress()); } ServerConnection serverConnection = new DefaultServerConnection((InetSocketAddress) ctx.getConnection().getLocalAddress()); return new DefaultHttpRequestContext(scheme, httpRequest, clientConnection, serverConnection); }