Package java.io

Examples of java.io.Flushable


        private Data(Pool<Instance> pool, Duration accessTimeout, Duration closeTimeout) {
            this.pool = pool;
            this.accessTimeout = accessTimeout;
            this.closeTimeout = closeTimeout;
            this.sessionContext = new StatelessContext(securityService, new Flushable() {
                public void flush() throws IOException {
                    getPool().flush();
                }
            });
        }
View Full Code Here


        custom(connection.httpRequest(), "EVENT-SOURCE-OUT", data);
    }

    protected void flush() throws IOException {
        if (out instanceof Flushable) {
            Flushable flushable = (Flushable) out;
            flushable.flush();
        }
    }
View Full Code Here

        private Data(Pool<Instance> pool, Duration accessTimeout, Duration closeTimeout) {
            this.pool = pool;
            this.accessTimeout = accessTimeout;
            this.closeTimeout = closeTimeout;
            this.sessionContext = new StatelessContext(securityService, new Flushable() {
                public void flush() throws IOException {
                    getPool().flush();
                }
            });
        }
View Full Code Here

      assertSame(thrown, caught);
    }
  }

  public void testFlush() {
    Exception flushed = Utils.flush(new Flushable() {
      public void flush() throws IOException {
      }
    });
    assertNull(flushed);
    final IOException ioe = new IOException();
    flushed = Utils.flush(new Flushable() {
      public void flush() throws IOException {
        throw ioe;
      }
    });
    assertSame(ioe, flushed);
    final RuntimeException re = new RuntimeException();
    flushed = Utils.flush(new Flushable() {
      public void flush() throws IOException {
        throw re;
      }
    });
    assertSame(re, flushed);
    final Error thrown = new Error();
    try {
      Utils.flush(new Flushable() {
        public void flush() throws IOException {
          throw thrown;
        }
      });
    }
View Full Code Here

TOP

Related Classes of java.io.Flushable

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.