当前位置: 首页>>代码示例>>Java>>正文


Java KeyAttachment.setTimeout方法代码示例

本文整理汇总了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);
        }
    }

}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:21,代码来源:AjpNioProcessor.java

示例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);
		}
	}

}
 
开发者ID:how2j,项目名称:lazycat,代码行数:19,代码来源:AjpNioProcessor.java

示例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);
        }
    }
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:30,代码来源:AjpNioProcessor.java

示例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);
        }
    }

}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:21,代码来源:AjpNioProcessor.java

示例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);
        }
    }

}
 
开发者ID:sdw2330976,项目名称:apache-tomcat-7.0.57,代码行数:21,代码来源:AjpNioProcessor.java

示例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);
        }
    }
}
 
开发者ID:WhiteBearSolutions,项目名称:WBSAirback,代码行数:29,代码来源:AjpNioProcessor.java

示例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;
    }
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:36,代码来源:AjpNioProcessor.java

示例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;
	}
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:37,代码来源:AjpNioProcessor.java

示例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;
    }
    }
}
 
开发者ID:sdw2330976,项目名称:apache-tomcat-7.0.57,代码行数:36,代码来源:AjpNioProcessor.java


注:本文中的org.apache.tomcat.util.net.NioEndpoint.KeyAttachment.setTimeout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。