Package org.apache.mina.common

Examples of org.apache.mina.common.SimpleByteBufferAllocator


        sessionManager = server.getSessionManager();
        // Check if we need to configure MINA to use Direct or Heap Buffers
        // Note: It has been reported that heap buffers are 50% faster than direct buffers
        if (JiveGlobals.getBooleanProperty("xmpp.socket.heapBuffer", true)) {
            ByteBuffer.setUseDirectBuffers(false);
            ByteBuffer.setAllocator(new SimpleByteBufferAllocator());
        }
    }
View Full Code Here


        sessionManager = server.getSessionManager();
        // Check if we need to configure MINA to use Direct or Heap Buffers
        // Note: It has been reported that heap buffers are 50% faster than direct buffers
        if (JiveGlobals.getBooleanProperty("xmpp.socket.heapBuffer", true)) {
            ByteBuffer.setUseDirectBuffers(false);
            ByteBuffer.setAllocator(new SimpleByteBufferAllocator());
        }
    }
View Full Code Here

        // the MINA default is currently to use the pooled allocator although this may change in future
        // once more testing of the performance of the simple allocator has been done
        if (!Boolean.getBoolean("amqj.enablePooledAllocator"))
        {
            _logger.info("Using SimpleByteBufferAllocator");
            ByteBuffer.setAllocator(new SimpleByteBufferAllocator());
        }

        final IoConnector ioConnector = _socketConnectorFactory.newSocketConnector();
        SocketConnectorConfig cfg = (SocketConnectorConfig) ioConnector.getDefaultConfig();
View Full Code Here

        return session.createTextMessage(createMessagePayload(size));
    }

    public static JMSTextMessage newJMSTextMessage(int size, String encoding) throws JMSException
    {
        ByteBuffer byteBuffer = (new SimpleByteBufferAllocator()).allocate(size, true);
        JMSTextMessage message = new JMSTextMessage(byteBuffer, encoding);
        message.clearBody();
        message.setText(createMessagePayload(size));
        return message;
    }
View Full Code Here

        // the MINA default is currently to use the pooled allocator although this may change in future
        // once more testing of the performance of the simple allocator has been done
        if (!connectorConfig.enablePooledAllocator)
        {
            ByteBuffer.setAllocator(new SimpleByteBufferAllocator());
        }

        int port = connectorConfig.port;

        String portStr = commandLine.getOptionValue("p");
View Full Code Here

        SocketSessionConfig scfg = (SocketSessionConfig) ioConnector.getDefaultConfig().getSessionConfig();
        scfg.setTcpNoDelay(true);
        scfg.setSendBufferSize(32768);
        scfg.setReceiveBufferSize(32768);

        ByteBuffer.setAllocator(new SimpleByteBufferAllocator());


        final InetSocketAddress address = new InetSocketAddress("localhost", _PORT);
        _logger.info("Attempting connection to " + address);
View Full Code Here

        SocketSessionConfig sc = (SocketSessionConfig) acceptor.getDefaultConfig().getSessionConfig();
        sc.setTcpNoDelay(true);
        sc.setSendBufferSize(32768);
        sc.setReceiveBufferSize(32768);

        ByteBuffer.setAllocator(new SimpleByteBufferAllocator());

        //The old mina style
//        acceptor.setLocalAddress(new InetSocketAddress(_PORT));
//        acceptor.setHandler(new TestHandler());
//        acceptor.bind();
View Full Code Here

        // the MINA default is currently to use the pooled allocator although this may change in future
        // once more testing of the performance of the simple allocator has been done
        if (!Boolean.getBoolean("amqj.enablePooledAllocator"))
        {
            _logger.info("Using SimpleByteBufferAllocator");
            ByteBuffer.setAllocator(new SimpleByteBufferAllocator());
        }

        final IoConnector ioConnector = _socketConnectorFactory.newSocketConnector();
        SocketConnectorConfig cfg = (SocketConnectorConfig) ioConnector.getDefaultConfig();
View Full Code Here

        // the MINA default is currently to use the pooled allocator although this may change in future
        // once more testing of the performance of the simple allocator has been done
        if (!connectorConfig.enablePooledAllocator)
        {
            ByteBuffer.setAllocator(new SimpleByteBufferAllocator());
        }

        int port = connectorConfig.port;

        String portStr = commandLine.getOptionValue("p");
View Full Code Here

        // the MINA default is currently to use the pooled allocator although this may change in future
        // once more testing of the performance of the simple allocator has been done
        if (!Boolean.getBoolean("amqj.enablePooledAllocator"))
        {
            ByteBuffer.setAllocator(new SimpleByteBufferAllocator());
        }

        final IoConnector ioConnector = _socketConnectorFactory.newSocketConnector();
        SocketConnectorConfig cfg = (SocketConnectorConfig) ioConnector.getDefaultConfig();
View Full Code Here

TOP

Related Classes of org.apache.mina.common.SimpleByteBufferAllocator

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.