Package org.eclipse.jetty.io

Examples of org.eclipse.jetty.io.LeakTrackingByteBufferPool


    {
        server = new Server();

        ServerFCGIConnectionFactory fcgiConnectionFactory = new ServerFCGIConnectionFactory(new HttpConfiguration());
        connector = new ServerConnector(server, null, null,
                new LeakTrackingByteBufferPool(new ArrayByteBufferPool())
                {
                    @Override
                    protected void leaked(LeakDetector.LeakInfo leakInfo)
                    {
                        leaks.incrementAndGet();
                    }
                }, 1, Math.max(1, Runtime.getRuntime().availableProcessors() / 2), fcgiConnectionFactory);
//        connector.setPort(9000);

        server.addConnector(connector);
        server.setHandler(handler);
        server.start();

        QueuedThreadPool executor = new QueuedThreadPool();
        executor.setName(executor.getName() + "-client");

        client = new HttpClient(new HttpClientTransportOverFCGI(1, false, "")
        {
            @Override
            public HttpDestination newHttpDestination(Origin origin)
            {
                return new HttpDestinationOverFCGI(client, origin)
                {
                    @Override
                    protected ConnectionPool newConnectionPool(HttpClient client)
                    {
                        return new LeakTrackingConnectionPool(this, client.getMaxConnectionsPerDestination(), this)
                        {
                            @Override
                            protected void leaked(LeakDetector.LeakInfo leakInfo)
                            {
                                leaks.incrementAndGet();
                            }
                        };
                    }
                };
            }
        }, null);
        client.setExecutor(executor);
        client.setByteBufferPool(new LeakTrackingByteBufferPool(new MappedByteBufferPool())
        {
            @Override
            protected void leaked(LeakDetector.LeakInfo leakInfo)
            {
                leaks.incrementAndGet();
View Full Code Here


    @Test(timeout = TIMEOUT)
    @Ignore("Test needs to be rewritten")
    public void testSynDataReplyDataLoad() throws Exception
    {
        final AtomicLong leaks = new AtomicLong();
        LeakTrackingByteBufferPool serverBufferPool = new LeakTrackingByteBufferPool(new ArrayByteBufferPool())
        {
            @Override
            protected void leaked(LeakDetector.LeakInfo leakInfo)
            {
                leaks.incrementAndGet();
            }
        };
        LeakTrackingByteBufferPool clientBufferPool = new LeakTrackingByteBufferPool(new MappedByteBufferPool())
        {
            @Override
            protected void leaked(LeakDetector.LeakInfo leakInfo)
            {
                leaks.incrementAndGet();
View Full Code Here

        start(new LoadHandler());
        server.stop();
        server.removeConnector(connector);
        connector = new ServerConnector(server, connector.getExecutor(), connector.getScheduler(),
                new LeakTrackingByteBufferPool(new ArrayByteBufferPool())
                {
                    @Override
                    protected void leaked(LeakDetector.LeakInfo leakInfo)
                    {
                        leaks.incrementAndGet();
                    }
                }, 1, Math.min(1, cores / 2), AbstractConnectionFactory.getFactories(sslContextFactory, new HttpConnectionFactory()));
        server.addConnector(connector);
        server.start();

        client.stop();
        HttpClient newClient = new HttpClient(new HttpClientTransportOverHTTP()
        {
            @Override
            public HttpDestination newHttpDestination(Origin origin)
            {
                return new HttpDestinationOverHTTP(getHttpClient(), origin)
                {
                    @Override
                    protected ConnectionPool newConnectionPool(HttpClient client)
                    {
                        return new LeakTrackingConnectionPool(this, client.getMaxConnectionsPerDestination(), this)
                        {
                            @Override
                            protected void leaked(LeakDetector.LeakInfo resource)
                            {
                                leaks.incrementAndGet();
                            }
                        };
                    }
                };
            }
        }, sslContextFactory);
        newClient.setExecutor(client.getExecutor());
        client = newClient;
        client.setByteBufferPool(new LeakTrackingByteBufferPool(new MappedByteBufferPool())
        {
            @Override
            protected void leaked(LeakDetector.LeakInfo leakInfo)
            {
                super.leaked(leakInfo);
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.io.LeakTrackingByteBufferPool

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.