Package org.eclipse.jetty.util.thread

Examples of org.eclipse.jetty.util.thread.Scheduler


        _channel.execute(_channel);
    }

    protected void scheduleTimeout()
    {
        Scheduler scheduler = _channel.getScheduler();
        if (scheduler!=null && _timeoutMs>0)
            _event.setTimeoutTask(scheduler.schedule(_event,_timeoutMs,TimeUnit.MILLISECONDS));
    }
View Full Code Here


    }

    public HTTP2Client(Executor executor)
    {
        addBean(executor);
        Scheduler scheduler = new ScheduledExecutorScheduler();
        addBean(scheduler, true);
        this.selector = new ClientSelectorManager(executor, scheduler);
        addBean(selector, true);
        this.byteBufferPool = new MappedByteBufferPool();
        addBean(byteBufferPool, true);
View Full Code Here

    public Connection newConnection(EndPoint endPoint, Map<String, Object> context) throws IOException
    {
        HTTP2Client client = (HTTP2Client)context.get(CLIENT_CONTEXT_KEY);
        ByteBufferPool byteBufferPool = (ByteBufferPool)context.get(BYTE_BUFFER_POOL_CONTEXT_KEY);
        Executor executor = (Executor)context.get(EXECUTOR_CONTEXT_KEY);
        Scheduler scheduler = (Scheduler)context.get(SCHEDULER_CONTEXT_KEY);
        Session.Listener listener = (Session.Listener)context.get(SESSION_LISTENER_CONTEXT_KEY);
        @SuppressWarnings("unchecked")
        Promise<Session> promise = (Promise<Session>)context.get(SESSION_PROMISE_CONTEXT_KEY);

        Generator generator = new Generator(byteBufferPool, 4096);
View Full Code Here

    protected Scheduler startScheduler() throws ServletException
    {
        try
        {
            Scheduler result = new ScheduledExecutorScheduler();
            result.start();
            return result;
        }
        catch (Exception x)
        {
            throw new ServletException(x);
View Full Code Here

    @Before
    public void init() throws Exception
    {
        _server = new Server();
        Scheduler _scheduler = new TimerScheduler();
        HttpConfiguration config = new HttpConfiguration();
        LocalConnector connector = new LocalConnector(_server,null, _scheduler,null,1,new HttpConnectionFactory(config));
        _server.addConnector(connector);
        _server.setHandler(new DumpHandler());
        _server.start();
View Full Code Here

        final long timeout = 1000;
        final TimeUnit unit = TimeUnit.MILLISECONDS;

        ByteBufferPool bufferPool = new MappedByteBufferPool();
        Executor threadPool = Executors.newCachedThreadPool();
        Scheduler scheduler = new TimerScheduler();
        scheduler.start(); // TODO need to use jetty lifecycles better here
        Generator generator = new Generator(bufferPool, new StandardCompressionFactory.StandardCompressor());
        Session session = new StandardSession(SPDY.V2, bufferPool, scheduler, new TestController(),
                endPoint, null, 1, null, generator, new FlowControlStrategy.None())
        {
//            @Override
View Full Code Here

        final long timeout = 1000;
        final TimeUnit unit = TimeUnit.MILLISECONDS;

        ByteBufferPool bufferPool = new MappedByteBufferPool();
        Executor threadPool = Executors.newCachedThreadPool();
        Scheduler scheduler = new TimerScheduler();
        scheduler.start();
        Generator generator = new Generator(bufferPool, new StandardCompressionFactory.StandardCompressor());
        Session session = new StandardSession(SPDY.V2, bufferPool, scheduler, new TestController(),
                endPoint, null, 1, null, generator, new FlowControlStrategy.None())
        {
//            @Override
View Full Code Here

                           ThreadPool threadPool) {
        final HttpConfiguration httpConfig = buildHttpConfiguration();

        final HttpConnectionFactory httpConnectionFactory = buildHttpConnectionFactory(httpConfig);

        final Scheduler scheduler = new ScheduledExecutorScheduler();

        final ByteBufferPool bufferPool = buildBufferPool();

        final String timerName = name(HttpConnectionFactory.class,
                                      bindHost,
View Full Code Here

        server.addBean(sslContextFactory);

        final SslConnectionFactory sslConnectionFactory =
                new SslConnectionFactory(sslContextFactory, HttpVersion.HTTP_1_1.toString());

        final Scheduler scheduler = new ScheduledExecutorScheduler();

        final ByteBufferPool bufferPool = buildBufferPool();

        final String timerName = name(HttpConnectionFactory.class,
                                      getBindHost(),
View Full Code Here

                new HTTPSPDYServerConnectionFactory(SPDY.V2, httpConfig, pushStrategy);

        final SslConnectionFactory sslConnectionFactory =
                new SslConnectionFactory(sslContextFactory, "npn");

        final Scheduler scheduler = new ScheduledExecutorScheduler();

        final ByteBufferPool bufferPool = buildBufferPool();

        final String timerName = name(HttpConnectionFactory.class, getBindHost(), Integer.toString(getPort()), "connections");
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.util.thread.Scheduler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.