/*
@Override
public void onCloseRead()
{
super.onCloseRead();

_conn.closeRead();
}

@Override
public void onCloseConnection()
{
super.onCloseConnection();

}

@Override
public void onTimeout()
{
System.out.println("TIMEOUT: " + context);
}
2747
@Override
  public InRequest newInRequest()
  {
    RequestHttp2 request = _freeRequest.allocate();
    
    if (request == null) {
      request = new RequestHttp2(_httpProtocol);
      /*
                                 connTcp(),
                                 _httpContainer,
                                 this);
                                 */
    }
    
    RequestBaratineImpl requestWeb = new RequestBaratineImpl(this,
                                                             request);
    //OutChannelHttp2 stream = request.getStreamOut();
    //stream.init(streamId, _outHttp);
    
    //request.init(this); // , _outHttp);
    
    return request;
  }
317798
public Integer getTimeout()
   {
      if (childNode.getTextValueForPatternName("timeout") != null && !childNode.getTextValueForPatternName("timeout").equals("null")) {
         return Integer.valueOf(childNode.getTextValueForPatternName("timeout"));
      }
      return null;
   }
1241643
void closedHandler(Object context, String input, Object frame, String stateName) {
        if (getReadyState() == ReadyState.CLOSED) {
            return;
        }
        
        // TODO: Determine whether channels need to be cleaned up.
        if (this.channels.size() != 0) {
            for (int i = 1; i <= this.channels.size(); i++) { // 1-based
                AmqpChannel channel = this.channels.get(i);
                AmqpFrame   f = new AmqpFrame();
                
                // Close each channel which should result in CLOSE event
                // to be fired for each of the registered ChannelListener(s).
                f.setMethodName("closeChannel");
                f.setChannelId((short) i);
                channel.channelClosedHandler(this, "", f, "closeChannel");
            }
        }
        
        try {
            // Mark the readyState to be CLOSED.
            readyState = ReadyState.CLOSED;
            
            // Fire CLOSE event for the ConnectionListener(s) registered
            // on AmqpClient object.
            fireOnClosed(new ConnectionEvent(this, Kind.CLOSE));

            // If the WebSocket(or ByteSocket) is still not closed, then 
            // invoke the close() method. The callback in this case will be a
            // a no-op as we have completed the book-keeping here.
            if (websocket != null) {
                websocket.close();
            }
        }
        catch (Exception e1) {
            throw new IllegalStateException(e1);
        }
        finally {
            websocket = null;
        }

    }
1341800
@Override
    public void close()
    {
        if (settings != null)
        {
            settings.clear();
            settings = null;
        }

        if (connection != null)
        {
            connection.disconnect();
            connection = null;
        }

        reader = null;
    }
77045
@Override
    public void userEventTriggered(final ChannelHandlerContext ctx, final Object evt) {
        if (evt instanceof IdleStateEvent) {
            IdleStateEvent e = (IdleStateEvent) evt;
            if (e.state() == IdleState.READER_IDLE) {
                ctx.close();
                LOG.warn(jnrpeContext, "Read Timeout");
                //jnrpeContext.getEventBus().post(new LogEvent(this, LogEventType.INFO, "Read Timeout"));
                //EventsUtil.sendEvent(this.jnrpeContext, this, LogEvent.INFO, "Read Timeout");
            } else if (e.state() == IdleState.WRITER_IDLE) {
                LOG.warn(jnrpeContext, "Write Timeout");
                //jnrpeContext.getEventBus().post(new LogEvent(this, LogEventType.INFO, "Write Timeout"));
                //EventsUtil.sendEvent(jnrpeContext, this, LogEvent.INFO, "Write Timeout");
                ctx.close();
            }
        }
    }
1225330
protected void setTimeoutTime(int time) {
        int timeout = time;
        if (timeout == TCPRequestContext.NO_TIMEOUT) {
            this.timeoutTime = TCPRequestContext.NO_TIMEOUT;
            this.timeoutInterval = 0;
        } else {
            if (timeout == TCPRequestContext.USE_CHANNEL_TIMEOUT) {
                timeout = getConfig().getInactivityTimeout();
            }
            if (timeout != ValidateUtils.INACTIVITY_TIMEOUT_NO_TIMEOUT) {
                this.timeoutTime = System.currentTimeMillis() + timeout;
                this.timeoutInterval = timeout;
            } else {
                this.timeoutTime = TCPRequestContext.NO_TIMEOUT;
                this.timeoutInterval = 0;
            }
        }
    }
422656
@Override
  public void close(WebSocketClose reason, String text)
  {
    Objects.requireNonNull(reason);

    if (_state.isClosed()) {
      return;
    }

    _state = _state.closeSelf();

    _frameOut.close(reason, text);

    if (_state.isClosed()) {
      disconnect();
    }
  }
946971
@Override
	public void endContentLine(ChainWriter out, WebSiteRequest req, HttpServletResponse resp, int rowspan, boolean endsInternal) {
		out.print("    </td>\n"
				+ "  </tr>\n");
	}
425311
@Override
    public void onDialogTimeout(MAPDialog mapDialog) {
        logger.error(String.format("onDialogTimeout for DialogId=%d", mapDialog.getLocalDialogId()));
        this.csvWriter.incrementCounter(ERROR_DIALOGS);
    }
349269
public void setReadTimeout(int timeout) {
		Assert.isTrue(timeout >= 0, "Timeout must be a non-negative value");
		this.socketTimeout = timeout;
		setLegacySocketTimeout(getHttpClient(), timeout);
	}
23795
@Override
    public void contextDestroyed(ServletContextEvent arg0) {
        if (endpointManager != null) {
            if (!FrameworkState.isStopping()) {
                endpointManager.closeAllOpenSessions();
                endpointManager.clear();
            }
            else {
                if (tc.isDebugEnabled()) {
                    Tr.debug(tc, "Server is being shutdown, no need to stop stop clients");
                }
            }
        }

    }
927368
public void setConnectTimeout(int timeout) {
		Assert.isTrue(timeout >= 0, "Timeout must be a non-negative value");
		getHttpClient().getParams().setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, timeout);
	}
1361603
private void setTimeout(HttpURLConnection httpUrlConnection) {
		String connTimeout = Config.getProperty(Config.TIMEOUT_CONNECTION);
		if (StringUtils.hasText(connTimeout)) {
			httpUrlConnection.setReadTimeout(new Integer(connTimeout.trim()));			
		}
		String reqTimeout = Config.getProperty(Config.TIMEOUT_REQUEST);
		if (StringUtils.hasText(reqTimeout)) {
			httpUrlConnection.setConnectTimeout(new Integer(reqTimeout.trim()));			
		}
	}
486042
@Override
  public void onContextClose(final String contextId) {
    this.serviceStub.activeContextOp(
        ActiveContextRequest.newBuilder()
            .setContextId(contextId)
            .setCloseContext(true)
            .build());
  }
451969
@Override
	protected void onQueueBrowserClose()
	{
		super.onQueueBrowserClose();
		
		try
		{
    		CloseBrowserQuery query = new CloseBrowserQuery();
    		query.setSessionId(session.getId());
    		query.setBrowserId(id);
    		transportEndpoint.blockingRequest(query);
		}
        catch (JMSException e)
        {
            ErrorTools.log(e, log);
        }
	}
285519
private void timeoutExpired(final Timeout timeout, final TimeoutContext context) {
        try {
            removeExpiredTimeout(timeout);

            for (TimeoutExpired callback : callbacks) {
                if (callback instanceof TimeoutExpirationCallback) {
                    ((TimeoutExpirationCallback) callback).expired(timeout, context);
                } else {
                    callback.expired(timeout);
                }
            }
        } catch (Exception ex) {
            // catch all exceptions. otherwise calling timeout thread of timers thread pool will be terminated.
            LOG.error("Error handling timeout.", ex);
        }
    }
1285637
private void closeOutboundInternal() {

        if ((debug != null) && Debug.isOn("ssl")) {
            System.out.println(threadName() + ", closeOutboundInternal()");
        }

        /*
         * Already closed, ignore
         */
        if (writer.isOutboundDone()) {
            return;
        }

        switch (connectionState) {

        /*
         * If we haven't even started yet, don't bother reading inbound.
         */
        case cs_START:
            writer.closeOutbound();
            inboundDone = true;
            break;

        case cs_ERROR:
        case cs_CLOSED:
            break;

        /*
         * Otherwise we indicate clean termination.
         */
        // case cs_HANDSHAKE:
        // case cs_DATA:
        // case cs_RENEGOTIATE:
        default:
            warning(Alerts.alert_close_notify);
            writer.closeOutbound();
            break;
        }

        // See comment in changeReadCiphers()
        writeCipher.dispose();

        connectionState = cs_CLOSED;
    }