本文整理了Java中org.eclipse.jetty.util.thread.ThreadPool.execute()
方法的一些代码示例,展示了ThreadPool.execute()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ThreadPool.execute()
方法的具体详情如下:
包路径:org.eclipse.jetty.util.thread.ThreadPool
类名称:ThreadPool
方法名:execute
暂无
代码示例来源:origin: org.apache.qpid/qpid-broker-plugins-websocket
public void tick()
{
_threadPool.execute(_tickJob);
}
}
代码示例来源:origin: stackoverflow.com
ThreadPool pool=new ThreadPool(this);
pool.start();
.. some code
pool.execute(new task());
.. other code
pool.execute(new task());
.. other code
pool.execute(new task());
代码示例来源:origin: org.cometd.java/cometd-java-server
private void invoke(final Method method, final ServerSession fromClient, final ServerMessage msg) {
if (_logger.isDebugEnabled()) {
_logger.debug("Invoking {}#{} from {} with {}", _name, method.getName(), fromClient, msg);
}
ThreadPool threadPool = getThreadPool();
if (threadPool == null) {
doInvoke(method, fromClient, msg);
} else {
threadPool.execute(() -> doInvoke(method, fromClient, msg));
}
}
代码示例来源:origin: stackoverflow.com
public class Test {
public void startExecution() {
Queue<String> runQ = new LinkedList<>();
ThreadPool threadPool = new ThreadPool(threadCount,timeOut);
while (!runQ.isEmpty()) {
String TaskName = runQ.remove();
Task t = new Task(TaskName);
threadPool.execute(t, TaskName);
}
if (threadPool.awaitTermination(timeOut, TimeUnit.MINUTES)) {
System.out.println("[CONTROL: ALL TEST TASKS COMPLETED SUCCESSFULLY.]");
} else {
System.out.println("[CONTROL: ALL THE TEST TASKS DID NOT COMPLETE SUCCESSFULLY IN STIPULATED TIME. FORCEFULLY FINALIZING.]");
threadPool.shutdownNow();
}
}
}
代码示例来源:origin: org.eclipse.jetty/jetty-annotations
context.getServer().getThreadPool().execute(new Runnable()
代码示例来源:origin: org.apache.qpid/qpid-broker-plugins-websocket
@OnWebSocketConnect @SuppressWarnings("unused")
public void onWebSocketConnect(final Session session)
{
SocketAddress localAddress = session.getLocalAddress();
SocketAddress remoteAddress = session.getRemoteAddress();
_protocolEngine = _factory.newProtocolEngine(remoteAddress);
// Let AMQP do timeout handling
session.setIdleTimeout(0);
_connectionWrapper = new ConnectionWrapper(session, localAddress, remoteAddress, _protocolEngine, _server.getThreadPool());
if (session.getUpgradeRequest() instanceof ServletUpgradeRequest)
{
ServletUpgradeRequest upgradeRequest = (ServletUpgradeRequest) session.getUpgradeRequest();
if (upgradeRequest.getCertificates() != null && upgradeRequest.getCertificates().length > 0)
{
_connectionWrapper.setPeerCertificate(upgradeRequest.getCertificates()[0]);
}
}
_protocolEngine.setNetworkConnection(_connectionWrapper);
_protocolEngine.setWorkListener(object -> _server.getThreadPool().execute(() -> _connectionWrapper.doWork()));
_activeConnections.add(_connectionWrapper);
_idleTimeoutChecker.wakeup();
}
内容来源于网络,如有侵权,请联系作者删除!