Class FileLockManager

    • Field Detail

      • synchDirectoryProperty

        public static final java.lang.String synchDirectoryProperty
        Synchronization directory property - local to this implementation of ILockManager
        See Also:
        Constant Field Values
      • lockPoolInitialization

        protected static final java.lang.Integer lockPoolInitialization
      • myFileLocks

        protected static LockPool myFileLocks
      • synchDirectory

        protected java.io.File synchDirectory
    • Method Detail

      • getFlagResourceName

        protected static java.lang.String getFlagResourceName​(java.lang.String flagName)
        Calculate the name of a flag resource.
        Parameters:
        flagName - is the name of the flag.
        Returns:
        the name for the flag resource.
      • readData

        public byte[] readData​(java.lang.String resourceName)
                        throws ManifoldCFException
        Read data from a shared data resource. Use this method to read any existing data, or get a null back if there is no such resource. Note well that this is not necessarily an atomic operation, and it must thus be protected by a lock.
        Specified by:
        readData in interface ILockManager
        Overrides:
        readData in class BaseLockManager
        Parameters:
        resourceName - is the global name of the resource.
        Returns:
        a byte array containing the data, or null.
        Throws:
        ManifoldCFException
      • writeData

        public void writeData​(java.lang.String resourceName,
                              byte[] data)
                       throws ManifoldCFException
        Write data to a shared data resource. Use this method to write a body of data into a shared resource. Note well that this is not necessarily an atomic operation, and it must thus be protected by a lock.
        Specified by:
        writeData in interface ILockManager
        Overrides:
        writeData in class BaseLockManager
        Parameters:
        resourceName - is the global name of the resource.
        data - is the byte array containing the data. Pass null if you want to delete the resource completely.
        Throws:
        ManifoldCFException
      • makeFilePath

        protected java.lang.String makeFilePath​(java.lang.String key)
        Create a file path given a key name.
        Parameters:
        key - is the key name.
        Returns:
        the file path.