@Override public void setAttribute(String key, Object value) { Grizzly.DEFAULT_ATTRIBUTE_BUILDER.createAttribute(key).set(connection, value); }
@Override public void setAttribute(String key, Object value) { Grizzly.DEFAULT_ATTRIBUTE_BUILDER.createAttribute(key).set(connection, value); }
static GrizzlyChannel getOrAddChannel(Connection<?> connection, URL url, ChannelHandler handler) { if (connection == null) { return null; } GrizzlyChannel ret = ATTRIBUTE.get(connection); if (ret == null) { ret = new GrizzlyChannel(connection, url, handler); if (connection.isOpen()) { ATTRIBUTE.set(connection, ret); } } return ret; }
static GrizzlyChannel getOrAddChannel(Connection<?> connection, URL url, ChannelHandler handler) { if (connection == null) { return null; } GrizzlyChannel ret = ATTRIBUTE.get(connection); if (ret == null) { ret = new GrizzlyChannel(connection, url, handler); if (connection.isOpen()) { ATTRIBUTE.set(connection, ret); } } return ret; }
public static void setNtlmEstablished(final Connection c) { NTLM_HOLDER.IS_NTLM_DONE.set(c, Boolean.TRUE); }
@Override protected void onConnect(final Connection connection, final SingleEndpointPool<SocketAddress> pool) { if (pool.getKeepAliveTimeout(TimeUnit.MILLISECONDS) == 0) { IS_NOT_KEEP_ALIVE.set(connection, Boolean.TRUE); } } }
public static boolean getAndSetNtlmAttempted(final Connection c) { final Boolean v = NTLM_HOLDER.IS_NTLM_DONE.get(c); if (v == null) { NTLM_HOLDER.IS_NTLM_DONE.set(c, Boolean.TRUE); return false; } return true; }
static void bind(final HttpContext httpCtx, final HttpTransactionContext httpTxContext) { httpCtx.getCloseable().addCloseListener(httpTxContext.listener); REQUEST_STATE_ATTR.set(httpCtx, httpTxContext); }
@Override public void setTimeoutMillis(Connection connection, long timeoutMillis) { silentConnectionAttr.set(connection, timeoutMillis); } }
/** * Set attribute value, stored on the {@link AttributeStorage}. * * @param storage {@link AttributeStorage}. * @param value attribute value to set. */ public void set(final AttributeStorage storage, final T value) { set(storage.getAttributes(), value); }
static Http2State create(final Connection connection) { final Http2State state = new Http2State(); http2State.set(connection, state); return state; }
@Override public NextAction handleEvent(final FilterChainContext ctx, final FilterChainEvent event) throws IOException { if (event.type() == SSLSwitchingEvent.class) { final SSLSwitchingEvent se = (SSLSwitchingEvent) event; final boolean isSecure = se.isSecure(); CONNECTION_IS_SECURE.set(se.getConnection(), isSecure); // if enabling security - create SSLEngine here, because default // Grizzly SSLFilter will use host/port info from the Connection, rather // than request URL. Specifically this doesn't work with CONNECT tunnels. if (isSecure && SSLUtils.getSSLEngine(ctx.getConnection()) == null) { // if SSLEngine is not yet set for the connection - initialize it final SSLEngine sslEngine = getClientSSLEngineConfigurator() .createSSLEngine(se.getHost(), se.getPort() == -1 ? 443 : se.getPort() ); sslEngine.beginHandshake(); SSLUtils.setSSLEngine(ctx.getConnection(), sslEngine); } return ctx.getStopAction(); } return ctx.getInvokeAction(); }
protected final LastResultAwareState<K, L> obtainStateObject( final AttributeStorage storage) { LastResultAwareState<K, L> value = stateAttr.get(storage); if (value == null) { value = createStateObject(); stateAttr.set(storage, value); } return value; }
protected final LastResultAwareState<K, L> obtainStateObject( final AttributeStorage storage) { LastResultAwareState<K, L> value = stateAttr.get(storage); if (value == null) { value = createStateObject(); stateAttr.set(storage, value); } return value; }
USED_CONNECTION.set(connection, Boolean.TRUE);
@Override public void onCopy(final FilterChainContext srcContext, final FilterChainContext copiedContext) { final FilterChainContext suspendedContextCopy = suspendedContextAttribute.get(srcContext).copy(); suspendedContextAttribute.set(copiedContext, suspendedContextCopy); copiedContext.addCopyListener(this); }
public static void setSSLEngine(final Connection connection, final SSLEngine sslEngine) { SSLConnectionContext ctx = getSslConnectionContext(connection); if (ctx == null) { // set first time outside of standard SSLFilter ctx = new SSLConnectionContext(connection); SSL_CTX_ATTR.set(connection, ctx); } ctx.configure(sslEngine); }
public static void setSSLEngine(final Connection connection, final SSLEngine sslEngine) { SSLConnectionContext ctx = getSslConnectionContext(connection); if (ctx == null) { // set first time outside of standard SSLFilter ctx = new SSLConnectionContext(connection); SSL_CTX_ATTR.set(connection, ctx); } ctx.configure(sslEngine); }
@Override public NextAction handleRead(final FilterChainContext ctx) throws IOException { // blocking mode means this read is initiated from HttpHandler if (!ctx.getTransportContext().isBlocking()) { // create a plug for this FilterChainContext final Plug plug = Plug.create(ctx, this); ctx.getInternalContext().addLifeCycleListener(plug); plugAttr.set(ctx, plug); } return ctx.getInvokeAction(); }
@Override public NextAction handleRead(final FilterChainContext ctx) throws IOException { // blocking mode means this read is initiated from HttpHandler if (!ctx.getTransportContext().isBlocking()) { // create a plug for this FilterChainContext final Plug plug = Plug.create(ctx, this); ctx.getInternalContext().addLifeCycleListener(plug); plugAttr.set(ctx, plug); } return ctx.getInvokeAction(); }