Package org.jitterbit.util

Examples of org.jitterbit.util.LockingFile


     *         another instance of the application is already running.
     */
    @Override
    public boolean lock(String[] args) {
        File file = new File(folder, FILE_NAME);
        LockingFile lock = new LockingFile(file);
        lock.setLogger(logger);
        return lock.acquire();
    }
View Full Code Here


    public ProjectFileLock() {
        lockFiles = Maps.newIdentityHashMap();
    }

    public synchronized boolean acquire(File location) {
        LockingFile file = new LockingFile(new File(location, FILE_NAME));
        if (file.acquire()) {
            lockFiles.put(location, file);
            return true;
        }
        return false;
    }
View Full Code Here

        }
        return false;
    }
   
    public synchronized boolean isLocked(File location) {
        LockingFile file = new LockingFile(new File(location, FILE_NAME));
        try {
            if (file.acquire()) {
                return false;
            }
            return true;
        } finally {
            file.release();
        }
    }
View Full Code Here

    public synchronized void release(ManagedProject project) {
        release(project.getLocation());
    }
   
    public synchronized void release(File location) {
        LockingFile file = lockFiles.remove(location);
        if (file != null) {
            file.release();
        }
    }
View Full Code Here

TOP

Related Classes of org.jitterbit.util.LockingFile

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.