本文整理汇总了Java中org.apache.tomcat.util.net.NioEndpoint.KeyAttachment.setTimeout方法的典型用法代码示例。如果您正苦于以下问题:Java KeyAttachment.setTimeout方法的具体用法?Java KeyAttachment.setTimeout怎么用?Java KeyAttachment.setTimeout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tomcat.util.net.NioEndpoint.KeyAttachment
的用法示例。
在下文中一共展示了KeyAttachment.setTimeout方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resetTimeouts
import org.apache.tomcat.util.net.NioEndpoint.KeyAttachment; //导入方法依赖的package包/类
@Override
protected void resetTimeouts() {
// The NIO connector uses the timeout configured on the wrapper in the
// poller. Therefore, it needs to be reset once asycn processing has
// finished.
final KeyAttachment attach =
(KeyAttachment)socketWrapper.getSocket().getAttachment();
if (!getErrorState().isError() && attach != null &&
asyncStateMachine.isAsyncDispatching()) {
long soTimeout = endpoint.getSoTimeout();
//reset the timeout
if (keepAliveTimeout > 0) {
attach.setTimeout(keepAliveTimeout);
} else {
attach.setTimeout(soTimeout);
}
}
}
示例2: resetTimeouts
import org.apache.tomcat.util.net.NioEndpoint.KeyAttachment; //导入方法依赖的package包/类
@Override
protected void resetTimeouts() {
// The NIO connector uses the timeout configured on the wrapper in the
// poller. Therefore, it needs to be reset once asycn processing has
// finished.
final KeyAttachment attach = (KeyAttachment) socketWrapper.getSocket().getAttachment();
if (!getErrorState().isError() && attach != null && asyncStateMachine.isAsyncDispatching()) {
long soTimeout = endpoint.getSoTimeout();
// reset the timeout
if (keepAliveTimeout > 0) {
attach.setTimeout(keepAliveTimeout);
} else {
attach.setTimeout(soTimeout);
}
}
}
示例3: actionInternal
import org.apache.tomcat.util.net.NioEndpoint.KeyAttachment; //导入方法依赖的package包/类
/**
* Send an action to the connector.
*
* @param actionCode Type of the action
* @param param Action parameter
*/
@Override
protected void actionInternal(ActionCode actionCode, Object param) {
if (actionCode == ActionCode.ASYNC_COMPLETE) {
if (asyncStateMachine.asyncComplete()) {
((NioEndpoint)endpoint).processSocket(this.socketWrapper.getSocket(),
SocketStatus.OPEN_READ, false);
}
} else if (actionCode == ActionCode.ASYNC_SETTIMEOUT) {
if (param == null) return;
long timeout = ((Long)param).longValue();
final KeyAttachment ka =
(KeyAttachment)socketWrapper.getSocket().getAttachment(false);
ka.setTimeout(timeout);
} else if (actionCode == ActionCode.ASYNC_DISPATCH) {
if (asyncStateMachine.asyncDispatch()) {
((NioEndpoint)endpoint).processSocket(this.socketWrapper.getSocket(),
SocketStatus.OPEN_READ, true);
}
}
}
示例4: resetTimeouts
import org.apache.tomcat.util.net.NioEndpoint.KeyAttachment; //导入方法依赖的package包/类
@Override
protected void resetTimeouts() {
// The NIO connector uses the timeout configured on the wrapper in the
// poller. Therefore, it needs to be reset once asycn processing has
// finished.
final KeyAttachment attach =
(KeyAttachment)socketWrapper.getSocket().getAttachment(false);
if (!error && attach != null &&
asyncStateMachine.isAsyncDispatching()) {
long soTimeout = endpoint.getSoTimeout();
//reset the timeout
if (keepAliveTimeout > 0) {
attach.setTimeout(keepAliveTimeout);
} else {
attach.setTimeout(soTimeout);
}
}
}
示例5: resetTimeouts
import org.apache.tomcat.util.net.NioEndpoint.KeyAttachment; //导入方法依赖的package包/类
@Override
protected void resetTimeouts() {
// The NIO connector uses the timeout configured on the wrapper in the
// poller. Therefore, it needs to be reset once asycn processing has
// finished.
final KeyAttachment attach =
(KeyAttachment)socketWrapper.getSocket().getAttachment(false);
if (!getErrorState().isError() && attach != null &&
asyncStateMachine.isAsyncDispatching()) {
long soTimeout = endpoint.getSoTimeout();
//reset the timeout
if (keepAliveTimeout > 0) {
attach.setTimeout(keepAliveTimeout);
} else {
attach.setTimeout(soTimeout);
}
}
}
示例6: actionInternal
import org.apache.tomcat.util.net.NioEndpoint.KeyAttachment; //导入方法依赖的package包/类
/**
* Send an action to the connector.
*
* @param actionCode Type of the action
* @param param Action parameter
*/
@Override
protected void actionInternal(ActionCode actionCode, Object param) {
if (actionCode == ActionCode.ASYNC_COMPLETE) {
if (asyncStateMachine.asyncComplete()) {
((NioEndpoint)endpoint).processSocket(this.socket,
SocketStatus.OPEN, false);
}
} else if (actionCode == ActionCode.ASYNC_SETTIMEOUT) {
if (param == null) return;
long timeout = ((Long)param).longValue();
final KeyAttachment ka = (KeyAttachment)socket.getAttachment(false);
if (keepAliveTimeout > 0) {
ka.setTimeout(timeout);
}
} else if (actionCode == ActionCode.ASYNC_DISPATCH) {
if (asyncStateMachine.asyncDispatch()) {
((NioEndpoint)endpoint).processSocket(this.socket,
SocketStatus.OPEN, true);
}
}
}
示例7: action
import org.apache.tomcat.util.net.NioEndpoint.KeyAttachment; //导入方法依赖的package包/类
/**
* Send an action to the connector.
*
* @param actionCode Type of the action
* @param param Action parameter
*/
@Override
@SuppressWarnings("incomplete-switch") // Other cases are handled by action()
protected void actionInternal(ActionCode actionCode, Object param) {
switch (actionCode) {
case ASYNC_COMPLETE: {
if (asyncStateMachine.asyncComplete()) {
((NioEndpoint)endpoint).processSocket(this.socketWrapper.getSocket(),
SocketStatus.OPEN_READ, false);
}
break;
}
case ASYNC_SETTIMEOUT: {
if (param == null) return;
long timeout = ((Long)param).longValue();
final KeyAttachment ka =
(KeyAttachment)socketWrapper.getSocket().getAttachment();
ka.setTimeout(timeout);
break;
}
case ASYNC_DISPATCH: {
if (asyncStateMachine.asyncDispatch()) {
((NioEndpoint)endpoint).processSocket(this.socketWrapper.getSocket(),
SocketStatus.OPEN_READ, true);
}
break;
}
}
}
示例8: actionInternal
import org.apache.tomcat.util.net.NioEndpoint.KeyAttachment; //导入方法依赖的package包/类
/**
* Send an action to the connector.
*
* @param actionCode
* Type of the action
* @param param
* Action parameter
*/
@Override
@SuppressWarnings("incomplete-switch") // Other cases are handled by
// action()
protected void actionInternal(ActionCode actionCode, Object param) {
switch (actionCode) {
case ASYNC_COMPLETE: {
if (asyncStateMachine.asyncComplete()) {
((NioEndpoint) endpoint).processSocket(this.socketWrapper.getSocket(), SocketStatus.OPEN_READ, false);
}
break;
}
case ASYNC_SETTIMEOUT: {
if (param == null)
return;
long timeout = ((Long) param).longValue();
final KeyAttachment ka = (KeyAttachment) socketWrapper.getSocket().getAttachment();
ka.setTimeout(timeout);
break;
}
case ASYNC_DISPATCH: {
if (asyncStateMachine.asyncDispatch()) {
((NioEndpoint) endpoint).processSocket(this.socketWrapper.getSocket(), SocketStatus.OPEN_READ, true);
}
break;
}
}
}
示例9: action
import org.apache.tomcat.util.net.NioEndpoint.KeyAttachment; //导入方法依赖的package包/类
/**
* Send an action to the connector.
*
* @param actionCode Type of the action
* @param param Action parameter
*/
@Override
@SuppressWarnings("incomplete-switch") // Other cases are handled by action()
protected void actionInternal(ActionCode actionCode, Object param) {
switch (actionCode) {
case ASYNC_COMPLETE: {
if (asyncStateMachine.asyncComplete()) {
((NioEndpoint)endpoint).processSocket(this.socketWrapper.getSocket(),
SocketStatus.OPEN_READ, false);
}
break;
}
case ASYNC_SETTIMEOUT: {
if (param == null) return;
long timeout = ((Long)param).longValue();
final KeyAttachment ka =
(KeyAttachment)socketWrapper.getSocket().getAttachment(false);
ka.setTimeout(timeout);
break;
}
case ASYNC_DISPATCH: {
if (asyncStateMachine.asyncDispatch()) {
((NioEndpoint)endpoint).processSocket(this.socketWrapper.getSocket(),
SocketStatus.OPEN_READ, true);
}
break;
}
}
}