Java 8 FileLockInterruptionException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 FileLockInterruptionException class.

This code example shows how to use the following methods:getCause, getLocalizedMessage, getMessage
 
    /** 
     * @tests {@link java.nio.channels.FileLockInterruptionException#FileLockInterruptionException()} 
     */ 
    public void test_Constructor() { 
        FileLockInterruptionException e = new FileLockInterruptionException();
        assertNull(e.getMessage());
        assertNull(e.getLocalizedMessage());
        assertNull(e.getCause());
    } 
 
    /** 
     * @tests serialization/deserialization compatibility. 
     */ 
    @TestTargets({ 
        @TestTargetNew( 
            level = TestLevel.COMPLETE, 
            notes = "Verifies serialization/deserialization compatibility.", 
            method = "!SerializationSelf", 
            args = {} 
7
CodeRank
This code example shows how to use the following methods:getCause, getLocalizedMessage, getMessage
     
    /** 
     * @tests {@link java.nio.channels.FileLockInterruptionException#FileLockInterruptionException()} 
     */ 
    public void test_Constructor() { 
        FileLockInterruptionException e = new FileLockInterruptionException();
        assertNull(e.getMessage());
        assertNull(e.getLocalizedMessage());
        assertNull(e.getCause());
    } 
 
    /** 
     * @tests serialization/deserialization compatibility. 
     */ 
    public void testSerializationSelf() throws Exception {
 
        SerializationTest.verifySelf(new FileLockInterruptionException());
    } 
 
    /** 
6
CodeRank
This code example shows how to use the following methods:
                   (new InterruptedException()));
        assertTrue(ExceptUtils.isInterruptException 
                   (new InterruptedIOException()));
        assertTrue(ExceptUtils.isInterruptException 
                   (new ClosedByInterruptException()));
        assertTrue(ExceptUtils.isInterruptException 
                   (new FileLockInterruptionException()));
        assertTrue(ExceptUtils.isInterruptException 
                   (new InterruptedNamingException())); 
        assertTrue(ExceptUtils.isInterruptException 
                   (new I18NInterruptedException())); 
        assertTrue(ExceptUtils.isInterruptException 
                   (new I18NInterruptedRuntimeException())); 
    } 
 
    @Test 
    public void interrupt() 
    { 
        interruptHelper(new CloneNotSupportedException(),false);
        interruptHelper(new InterruptedException(),true);
4
CodeRank
This code example shows how to use the following methods:
    return lock;
  } 
 
  MemoryFileLock lock(MemoryFileLock lock) throws IOException {
    if (Thread.currentThread().isInterrupted()) {
      throw new FileLockInterruptionException();
    } 
    MemoryFileLock returnValue = this.tryLock(lock);
    if (returnValue == null) {
      throw new OverlappingFileLockException();
    } 
    return returnValue;
  } 
 
  void remove(MemoryFileLock lock) {
    // no need to check for return value because FileLock#release 
    // can be invoked several times from multiple threads 
    this.locks.remove(lock.position());
    lock.invalidate();
  } 
3
CodeRank
See Code Examples for Java 8 FileLockInterruptionException Methods: