Java Code Examples for org.eclipse.jetty.util.ProcessorUtils

Following code examples demonstrate how to use org.eclipse.jetty.util.ProcessorUtils from jetty. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use org.eclipse.jetty.util.ProcessorUtils and various code implementation of this class.
Example 1
Project : jetty Source File : JettyResourceFactory.java View Source Code on GitHub

	public void afterPropertiesSet() throws Exception {
		String name = this.threadPrefix + "@" + Integer.toHexString(hashCode());
		if (this.executor == null) {
			QueuedThreadPool threadPool = new QueuedThreadPool();
			threadPool.setName(name);
			this.executor = threadPool;
		}
		if (this.byteBufferPool == null) {
			this.byteBufferPool = new MappedByteBufferPool(2048,
					this.executor instanceof ThreadPool.SizedThreadPool
							? ((ThreadPool.SizedThreadPool) executor).getMaxThreads() / 2
							: ProcessorUtils.availableProcessors() * 2);
		}
		if (this.scheduler == null) {
			this.scheduler = new ScheduledExecutorScheduler(name + "-scheduler", false);
		}

		if (this.executor instanceof LifeCycle) {
			((LifeCycle)this.executor).start();
		}
		this.scheduler.start();
	}
			
Example 2
Project : jetty Source File : PreFlight.java View Source Code on GitHub

    public void start() {
        try {
            LOG.info("At startup: JVM {} processors, and Jetty {} processors", Runtime.getRuntime().availableProcessors(), ProcessorUtils.availableProcessors());
            readManifests();
        } catch (IOException e) {
            LOG.debug("Error while reading manifest", e);
        }
    }