Index

A B C E H I L M O S T U 
All Classes and Interfaces|All Packages|Serialized Form

A

AppLocker - Class in io.github.sanyarnd.applocker
The Locker class provides methods for a locking mechanism and encapsulates socket-based message server for IPC.
AppLocker.Builder - Class in io.github.sanyarnd.applocker
AppLocker builder.

B

build() - Method in class io.github.sanyarnd.applocker.AppLocker.Builder
Build AppLocker.
Builder(String) - Constructor for class io.github.sanyarnd.applocker.AppLocker.Builder
Create Application Locker builder.

C

close() - Method in class io.github.sanyarnd.applocker.AppLocker
 
close() - Method in class io.github.sanyarnd.applocker.Lock
 
create(String) - Static method in class io.github.sanyarnd.applocker.AppLocker
Create the AppLocker builder.

E

encode(String) - Method in interface io.github.sanyarnd.applocker.LockIdEncoder
Encode string.

H

handleMessage(I) - Method in interface io.github.sanyarnd.applocker.MessageHandler
Handle the received message and return the result.

I

io.github.sanyarnd.applocker - package io.github.sanyarnd.applocker
AppLocker library.
isLocked() - Method in class io.github.sanyarnd.applocker.AppLocker
Check if locker is busy.
isLocked() - Method in class io.github.sanyarnd.applocker.Lock
Check whether lock is currently in use.

L

lock() - Method in class io.github.sanyarnd.applocker.AppLocker
Acquire the lock.
lock(long) - Method in class io.github.sanyarnd.applocker.Lock
Tries to acquire the lock and ignores any LockingBusyException during the process.
Lock - Class in io.github.sanyarnd.applocker
File-channel based lock.
Lock(Path) - Constructor for class io.github.sanyarnd.applocker.Lock
Create a lock.
LockIdEncoder - Interface in io.github.sanyarnd.applocker
Provides a safe way to encode application id such that it can be stored on filesystem without exceptions: invalid characters, too long etc.
LockingBusyException - Exception in io.github.sanyarnd.applocker
Exception indicates that the lock has already been acquired.
LockingBusyException(String, Throwable) - Constructor for exception io.github.sanyarnd.applocker.LockingBusyException
Create lock busy exception
LockingException - Exception in io.github.sanyarnd.applocker
The Exception indicates that there was a failure (most probably I/O) during acquiring the lock.

M

MessageHandler<I extends Serializable,O extends Serializable> - Interface in io.github.sanyarnd.applocker
Interface for the function that runs on the server side and handles all incoming messages.

O

onBusy(Serializable, Runnable) - Method in class io.github.sanyarnd.applocker.AppLocker.Builder
Defines the action for when the lock is already taken.
Default value is null.
onBusy(Serializable, Consumer<T>) - Method in class io.github.sanyarnd.applocker.AppLocker.Builder
Defines the action for when the lock is already taken.
Default value is null.
onFail(Runnable) - Method in class io.github.sanyarnd.applocker.AppLocker.Builder
Defines the action for when locking is impossible.
Default value is identity function (re-throws exception).
onFail(Consumer<LockingException>) - Method in class io.github.sanyarnd.applocker.AppLocker.Builder
Defines the action for when locking is impossible.
Default value is identity function (re-throws exception).
onSuccess(Runnable) - Method in class io.github.sanyarnd.applocker.AppLocker.Builder
Defines a callback if locking was successful.
Default value is empty function.

S

sendMessage(I) - Method in class io.github.sanyarnd.applocker.AppLocker
Send a message to AppLocker instance that's holding the lock (including self).
setIdEncoder(LockIdEncoder) - Method in class io.github.sanyarnd.applocker.AppLocker.Builder
Sets the name encoder.
Encodes lock lockId to filesystem-friendly entry.
Default value is "SHA-1" encoder.
setMessageHandler(MessageHandler<?, ?>) - Method in class io.github.sanyarnd.applocker.AppLocker.Builder
Sets the message handler.
If not set, AppLocker won't support communication features.
Default value is null.
setPath(Path) - Method in class io.github.sanyarnd.applocker.AppLocker.Builder
Sets the path where the lock file will be stored.
Default value is ""

T

toString() - Method in class io.github.sanyarnd.applocker.AppLocker
 
toString() - Method in class io.github.sanyarnd.applocker.Lock
 
tryLock() - Method in class io.github.sanyarnd.applocker.Lock
Attempt to lock file.

U

unlock() - Method in class io.github.sanyarnd.applocker.AppLocker
Unlock the lock.
unlock() - Method in class io.github.sanyarnd.applocker.Lock
Unlock the lock.
A B C E H I L M O S T U 
All Classes and Interfaces|All Packages|Serialized Form