Package java.nio.channels

Examples of java.nio.channels.ClosedByInterruptException


                try {
                    return ch.read(buf, null).get();
                } catch (InterruptedException e) {
                    ch.close();
                    Thread.currentThread().interrupt();
                    throw new ClosedByInterruptException();
                } catch (ExecutionException e) {
                    launderExecutionException(e); // always throws
                    throw new AssertionError("unreachable");
                }
            }
View Full Code Here


                        ch.write(buf, null).get();
                    }
                } catch (InterruptedException e) {
                    ch.close();
                    Thread.currentThread().interrupt();
                    throw new ClosedByInterruptException();
                } catch (ExecutionException e) {
                    launderExecutionException(e); // always throws
                    throw new AssertionError("unreachable");
                }
            }
View Full Code Here

            } catch (Exception e) {
                throw new RuntimeException(e);
            }
            if (interrupted) {
                interrupted = false;
                throw new ClosedByInterruptException();
            }
        }
        if (!success && closed) {
            throw new AsynchronousCloseException();
        }
View Full Code Here

        lock.unlock();
      }
    }
    catch( InterruptedException ex ) {
      close();
      throw new ClosedByInterruptException();
    }
  }
View Full Code Here

            } catch (Exception e) {
                throw new RuntimeException(e);
            }
            if (interrupted) {
                interrupted = false;
                throw new ClosedByInterruptException();
            }
        }
        if (!success && closed) {
            throw new AsynchronousCloseException();
        }
View Full Code Here

            } catch (Exception e) {
                throw new RuntimeException(e);
            }
            if (interrupted) {
                interrupted = false;
                throw new ClosedByInterruptException();
            }
        }
        if (!success && closed) {
            throw new AsynchronousCloseException();
        }
View Full Code Here

   
    /**
     * @tests {@link java.nio.channels.ClosedByInterruptException#ClosedByInterruptException()}
     */
    public void test_Constructor() {
        ClosedByInterruptException e = new ClosedByInterruptException();
        assertNull(e.getMessage());
        assertNull(e.getLocalizedMessage());
        assertNull(e.getCause());
    }
View Full Code Here

    /**
     * @tests serialization/deserialization compatibility.
     */
    public void testSerializationSelf() throws Exception {

        SerializationTest.verifySelf(new ClosedByInterruptException());
    }
View Full Code Here

    /**
     * @tests serialization/deserialization compatibility with RI.
     */
    public void testSerializationCompatibility() throws Exception {

        SerializationTest.verifyGolden(this, new ClosedByInterruptException());
    }
View Full Code Here

            // interrupt without throwing if bytes got transferred. Compensate,
            // so we can clean up.  Bug 6979009,
            // http://bugs.sun.com/view_bug.do?bug_id=6979009
            if (Thread.currentThread().isInterrupted() &&
                    !srcChannel.isOpen()) {
                throw new ClosedByInterruptException();
            }
        }
    }
View Full Code Here

TOP

Related Classes of java.nio.channels.ClosedByInterruptException

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.