Examples of IOStrategy


Examples of org.glassfish.grizzly.IOStrategy

    private boolean iterateKeyEvents()
            throws IOException {

        final SelectionKey keyLocal = key;
        final SelectionKeyHandler selectionKeyHandler = transport.getSelectionKeyHandler();
        final IOStrategy ioStrategy = transport.getIOStrategy();
        final IOEvent[] ioEvents = selectionKeyHandler.getIOEvents(keyReadyOps);
        final NIOConnection connection =
                selectionKeyHandler.getConnectionForKey(keyLocal);

        for (IOEvent ioEvent : ioEvents) {
            NIOConnection.notifyIOEventReady(connection, ioEvent);
           
            final int interest = ioEvent.getSelectionKeyInterest();
            keyReadyOps &= (~interest);
            if (selectionKeyHandler.onProcessInterest(keyLocal, interest)) {
                if (!ioStrategy.executeIoEvent(connection, ioEvent)) {
                    return false;
                }
            }
        }
View Full Code Here

Examples of org.glassfish.grizzly.IOStrategy

        metricRegistry.remove(MetricRegistry.name("rexpro", "core", metricGroup, jmxAttributeName));
    }

    private void configureTransport() throws Exception {
        if (this.hasIoStrategyChanged()) {
            final IOStrategy strategy = GrizzlyIoStrategyFactory.createIoStrategy(this.ioStrategy);
            this.tcpTransport.setIOStrategy(strategy);

            logger.info(String.format("Using %s IOStrategy for RexPro.", strategy.getClass().getName()));
        }

        if (this.lastTransportReadBuffer != transportReadBuffer)
            this.tcpTransport.setReadBufferSize(this.transportReadBuffer);
View Full Code Here

Examples of org.glassfish.grizzly.IOStrategy

        listener.setMaxHttpHeaderSize(maxHeaderSize);
        listener.setUploadTimeout(uploadTimeoutMillis);
        listener.setDisableUploadTimeout(false);

        if (this.hasIoStrategyChanged()) {
            final IOStrategy strategy = GrizzlyIoStrategyFactory.createIoStrategy(this.ioStrategy);
            listener.getTransport().setIOStrategy(strategy);

            logger.info(String.format("Using %s IOStrategy for HTTP/REST.", strategy.getClass().getName()));
        }
    }
View Full Code Here

Examples of org.glassfish.grizzly.IOStrategy

    private static final String SAME = "same";
    private static final String DYNAMIC = "dynamic";
    private static final String LEADER_FOLLOWER = "leader-follower";

    public static IOStrategy createIoStrategy(final String strategy) {
        final IOStrategy ioStrategy;
        if (strategy.equals(WORKER)) {
            ioStrategy = WorkerThreadIOStrategy.getInstance();
        } else if (strategy.equals(SAME)) {
            ioStrategy = SameThreadIOStrategy.getInstance();
        } else if (strategy.equals(DYNAMIC))  {
View Full Code Here

Examples of org.glassfish.grizzly.IOStrategy

    private boolean iterateKeyEvents()
            throws IOException {

        final SelectionKey keyLocal = key;
        final SelectionKeyHandler selectionKeyHandler = transport.getSelectionKeyHandler();
        final IOStrategy ioStrategy = transport.getIOStrategy();
        final IOEvent[] ioEvents = selectionKeyHandler.getIOEvents(keyReadyOps);
        final NIOConnection connection =
                selectionKeyHandler.getConnectionForKey(keyLocal);

        for (IOEvent ioEvent : ioEvents) {
            NIOConnection.notifyIOEventReady(connection, ioEvent);
           
            final int interest = ioEvent.getSelectionKeyInterest();
            keyReadyOps &= (~interest);
            if (selectionKeyHandler.onProcessInterest(keyLocal, interest)) {
                if (!ioStrategy.executeIoEvent(connection, ioEvent)) {
                    return false;
                }
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.