Code example for FileLock

Methods: channelisValidrelease

0
        } 
        return lock != null;
    } 
 
    public void release() throws Exception {
        if (lock != null && lock.isValid()) {
            LOG.info("Releasing lock " + lockPath.getPath());
            lock.release();
            lock.channel().close();
        } 
        lock = null;
    } 
  
    public boolean isAlive() throws Exception {
        return lock != null && lock.isValid() && lockPath.exists();
    } 
 
    private static File getKarafLock(File lock,Properties props) {
        File rc = null;
 
Connect your IDE to all the code out there  Get Codota for Java