Package org.glassfish.grizzly.Writer

Examples of org.glassfish.grizzly.Writer.Reentrant


        }
       
        this.handler = handler;
       
        if (isNonBlockingWriteGuaranteed || canWrite()) {
            final Reentrant reentrant = Reentrant.getWriteReentrant();
            if (!reentrant.isMaxReentrantsReached()) {
                notifyWritePossible();
            } else {
                notifyWritePossibleAsync();
            }
           
View Full Code Here


     */
    private void notifyWritePossible() {
        final WriteHandler localHandler = handler;

        if (localHandler != null) {
            final Reentrant reentrant = Reentrant.getWriteReentrant();
           
            try {
                handler = null;
                reentrant.inc();

                isNonBlockingWriteGuaranteed = true;

                localHandler.onWritePossible();
            } catch (Throwable t) {
                localHandler.onError(t);
            } finally {
                reentrant.dec();
            }
        }
    }
View Full Code Here


        private static void onWritePossible0(final OutputBuffer ob)
                throws Exception {
            try {
                final Reentrant reentrant = Reentrant.getWriteReentrant();
                if (!reentrant.isMaxReentrantsReached()) {
                    ob.notifyWritePossible();
                } else {
                    ob.notifyWritePossibleAsync();
                }
            } catch (Exception ignored) {
View Full Code Here

        }
       
        this.handler = handler;
       
        if (isNonBlockingWriteGuaranteed || canWrite()) {
            final Reentrant reentrant = Reentrant.getWriteReentrant();
            if (!reentrant.isMaxReentrantsReached()) {
                notifyWritePossible();
            } else {
                notifyWritePossibleAsync();
            }
           
View Full Code Here

     */
    private void notifyWritePossible() {
        final WriteHandler localHandler = handler;

        if (localHandler != null) {
            final Reentrant reentrant = Reentrant.getWriteReentrant();
           
            try {
                handler = null;
                reentrant.inc();

                isNonBlockingWriteGuaranteed = true;

                localHandler.onWritePossible();
            } catch (Throwable t) {
                localHandler.onError(t);
            } finally {
                reentrant.dec();
            }
        }
    }
View Full Code Here


        private static void onWritePossible0(final OutputBuffer ob)
                throws Exception {
            try {
                final Reentrant reentrant = Reentrant.getWriteReentrant();
                if (!reentrant.isMaxReentrantsReached()) {
                    ob.notifyWritePossible();
                } else {
                    ob.notifyWritePossibleAsync();
                }
            } catch (Exception ignored) {
View Full Code Here

TOP

Related Classes of org.glassfish.grizzly.Writer.Reentrant

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.