Package java.nio.channels

Examples of java.nio.channels.ClosedByInterruptException


          raw.composeObject(source, dest, timeout);
          return null;
        }
      }, options.getRetryParams(), exceptionHandler);
    } catch (RetryInterruptedException ex) {
      throw new ClosedByInterruptException();
    } catch (NonRetriableException e) {
      Throwables.propagateIfInstanceOf(e.getCause(), IOException.class);
      throw e;
    }
  }
View Full Code Here


          raw.copyObject(source, dest, timeout);
          return null;
        }
      }, options.getRetryParams(), exceptionHandler);
    } catch (RetryInterruptedException ex) {
      throw new ClosedByInterruptException();
    } catch (NonRetriableException e) {
      Throwables.propagateIfInstanceOf(e.getCause(), IOException.class);
      throw e;
    }
  }
View Full Code Here

              String marker = Strings.emptyToNull(nextMarker);
              return raw.list(bucket, prefix, delimiter, marker, MAX_RESULTS_PER_BATCH, timeout);
            }
          }, options.getRetryParams(), exceptionHandler);
        } catch (RetryInterruptedException ex) {
          throw new ClosedByInterruptException();
        } catch (NonRetriableException e) {
          Throwables.propagateIfInstanceOf(e.getCause(), IOException.class);
          throw e;
        }
        nextMarker = batch.getNextMarker();
View Full Code Here

  @Test
  public void testShouldTry() {
    ExceptionHandler handler = new ExceptionHandler.Builder().retryOn(IOException.class).build();
    assertTrue(handler.shouldRetry(new IOException()));
    assertTrue(handler.shouldRetry(new ClosedByInterruptException()));
    assertFalse(handler.shouldRetry(new RuntimeException()));

    handler = new ExceptionHandler.Builder()
        .retryOn(IOException.class, NullPointerException.class)
        .abortOn(RuntimeException.class, ClosedByInterruptException.class,
            InterruptedException.class)
        .build();
    assertTrue(handler.shouldRetry(new IOException()));
    assertFalse(handler.shouldRetry(new ClosedByInterruptException()));
    assertFalse(handler.shouldRetry(new InterruptedException()));
    assertFalse(handler.shouldRetry(new RuntimeException()));
    assertTrue(handler.shouldRetry(new NullPointerException()));
  }
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

            // 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() &&
                    !dstChannel.isOpen()) {
                throw new ClosedByInterruptException();
            }
        }
    }
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

            // 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() &&
                    !dstChannel.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.