Package java.nio.channels

Examples of java.nio.channels.FileLock.channel()


          firstLock.release();
          firstLock.channel().close();
        }
        if(secondLock != null) {
          secondLock.release();
          secondLock.channel().close();
        }
      }
      return false;
    }
  }
View Full Code Here


          firstLock.release();
          firstLock.channel().close();
        }
        if(secondLock != null) {
          secondLock.release();
          secondLock.channel().close();
        }
      }
      return false;
    }
  }
View Full Code Here

          firstLock.release();
          firstLock.channel().close();
        }
        if(secondLock != null) {
          secondLock.release();
          secondLock.channel().close();
        }
      }
      return false;
    }
  }
View Full Code Here

    public void releaseExclusiveReadLock(GenericFileOperations<File> fileGenericFileOperations,
                                         GenericFile<File> fileGenericFile, Exchange exchange) throws Exception {
        FileLock lock = ExchangeHelper.getMandatoryProperty(exchange, "CamelFileLock", FileLock.class);
        String lockFileName = ExchangeHelper.getMandatoryProperty(exchange, "CamelFileLockName", String.class);
        Channel channel = lock.channel();

        if (LOG.isTraceEnabled()) {
            LOG.trace("Unlocking file: " + lockFileName);
        }
        try {
View Full Code Here

    public void releaseExclusiveReadLock(GenericFileOperations<File> fileGenericFileOperations,
                                         GenericFile<File> fileGenericFile, Exchange exchange) throws Exception {
        FileLock lock = ExchangeHelper.getMandatoryProperty(exchange, "CamelFileLock", FileLock.class);
        String lockFileName = ExchangeHelper.getMandatoryProperty(exchange, "CamelFileLockName", String.class);
        Channel channel = lock.channel();
        try {
            lock.release();
        } finally {
            // must close channel first
            ObjectHelper.close(channel, "while acquiring exclusive read lock for file: " + lockFileName, LOG);
View Full Code Here

        firstLock.release();
        firstLock.channel().close();
      }
      if(secondLock != null) {
        secondLock.release();
        secondLock.channel().close();
      }
    }
    return false;
  }
View Full Code Here

          firstLock.release();
          firstLock.channel().close();
        }
        if(secondLock != null) {
          secondLock.release();
          secondLock.channel().close();
        }
      }
      return false;
    }
  }
View Full Code Here

        firstLock.release();
        firstLock.channel().close();
      }
      if(secondLock != null) {
        secondLock.release();
        secondLock.channel().close();
      }
    }
    return false;
  }
View Full Code Here

                throw e;
            } finally {
                if(lock != null) {
                    try {
                        lock.release();
                        lock.channel().close();
                        new File(directory, LOCK_FILE).delete();
                    } catch(IOException e) {
                        // does not matter, was just cleanup
                    }
                }
View Full Code Here

          return false;
        }

        try
        {
          lock.channel().close();
        }
        catch (Exception e)
        {
          if (debugEnabled())
          {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.