private MultiException addMultiException(MultiException exception, Exception e) { if(exception == null){ exception = new MultiException(); } exception.add(e); return exception; }
public static void checkAndClose(ClassLoader classLoader) { if (!isWindows() || !(classLoader instanceof URLClassLoader)) { return; } HashSet<String> leakedJarNames = preClose((URLClassLoader)classLoader); cleanupJarFileFactory(leakedJarNames); }
@Override public void clear() { _entries.clear(); } }
private static QueuedThreadPool createQueuedThreadPool( JettyThreadCalculator jtc ) { BlockingQueue<Runnable> queue = new BlockingArrayQueue<>( jtc.getMinThreads(), jtc.getMinThreads(), jtc.getMaxCapacity() ); QueuedThreadPool threadPool = new QueuedThreadPool( jtc.getMaxThreads(), jtc.getMinThreads(), JETTY_THREAD_POOL_IDLE_TIMEOUT, queue ); threadPool.setThreadPoolBudget( null ); // mute warnings about Jetty thread pool size return threadPool; }
private DataBuffer toDataBuffer(ContentChunk chunk) { // We must copy until this is resolved: // https://github.com/eclipse/jetty.project/issues/2429 // Use copy instead of buffer wrapping because Callback#succeeded() is // used not only to release the buffer but also to request more data // which is a problem for codecs that buffer data. DataBuffer buffer = this.bufferFactory.allocateBuffer(chunk.buffer.capacity()); buffer.write(chunk.buffer); chunk.callback.succeeded(); return buffer; }
/** {@inheritDoc} */ @Override protected void beforeTest() throws Exception { afterPutEvts = new BlockingArrayQueue<>(); afterRmvEvts = new BlockingArrayQueue<>(); }
private void checkCharAppend() throws IOException { if (_state != UTF8_ACCEPT) { _appendable.append(REPLACEMENT); int state = _state; _state = UTF8_ACCEPT; throw new org.eclipse.jetty.util.Utf8Appendable.NotUtf8Exception("char appended in state " + state); } }
public SubtransExecutor( String subTransName, Trans parentTrans, TransMeta subtransMeta, boolean shareVariables, TransExecutorParameters parameters, String subStep ) { this.subTransName = subTransName; this.parentTrans = parentTrans; this.subtransMeta = subtransMeta; this.shareVariables = shareVariables; this.parameters = parameters; this.subStep = subStep; this.statuses = new LinkedHashMap<>(); this.running = new ConcurrentHashSet<>(); }
@Override public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { final Handler handler = handlers.getBest(baseRequest.getRequestURI()); if (handler != null) { handler.handle(target, baseRequest, request, response); } }
/** * Match the class name against the pattern * * @param name name of the class to match * @return true if class matches the pattern */ public boolean match(String name) { return _patterns.test(name); }
@Override public Handler[] getHandlers() { return handlers.entrySet().stream().map(e -> e.getValue()).toArray(Handler[]::new); } }
@Override public int size() { return _entries.size(); }
@Override public boolean isEmpty() { return _entries.isEmpty(); }
@Override public boolean test(String name) { return _entries.getBest(name)!=null; }
private MultiException addMultiException(MultiException exception, Exception e) { if(exception == null){ exception = new MultiException(); } exception.add(e); return exception; }
protected ThreadPool createThreadPool(MetricRegistry metricRegistry) { final BlockingQueue<Runnable> queue = new BlockingArrayQueue<>(minThreads, maxThreads, maxQueuedRequests); final InstrumentedQueuedThreadPool threadPool = new InstrumentedQueuedThreadPool(metricRegistry, maxThreads, minThreads, (int) idleThreadTimeout.toMilliseconds(), queue); threadPool.setName("dw"); return threadPool; }
protected void checkState() { if (!isUtf8SequenceComplete()) { _codep = 0; _state = UTF8_ACCEPT; try { _appendable.append(REPLACEMENT); } catch (IOException e) { throw new RuntimeException(e); } throw new org.eclipse.jetty.util.Utf8Appendable.NotUtf8Exception("incomplete UTF8 sequence"); } }
@Override public int size() { return _entries.size(); }