public class LaunchIdLockFile extends AbstractLaunchIdLock implements LaunchIdLock
ListenerProperty.FILE_LOCK_NAME and ListenerProperty.FILE_SYNC_NAME properties.| Modifier and Type | Field and Description |
|---|---|
static java.nio.charset.Charset |
LOCK_FILE_CHARSET |
static java.lang.String |
TIME_SEPARATOR |
parametersMAX_WAIT_TIME_DISCREPANCY| Constructor and Description |
|---|
LaunchIdLockFile(ListenerParameters listenerParameters) |
| Modifier and Type | Method and Description |
|---|---|
void |
finishInstanceUuid(java.lang.String instanceUuid)
Remove self UUID from sync file, means that a client finished its Launch.
|
java.util.Collection<java.lang.String> |
getLiveInstanceUuids()
Return all instance UUIDs which are still running.
|
java.lang.String |
obtainLaunchUuid(java.lang.String instanceUuid)
Returns a Launch UUID for many Clients launched on one machine.
|
void |
updateInstanceUuid(java.lang.String instanceUuid)
Update timestamp for instance record in sync file.
|
public static final java.nio.charset.Charset LOCK_FILE_CHARSET
public static final java.lang.String TIME_SEPARATOR
public LaunchIdLockFile(@Nonnull
ListenerParameters listenerParameters)
@Nullable
public java.lang.String obtainLaunchUuid(@Nonnull
java.lang.String instanceUuid)
obtainLaunchUuid in interface LaunchIdLockinstanceUuid - a Client instance UUID, which will be written to lock and sync files and, if it is the first thread which managed
to obtain lock on '.lock' file, returned to every client instance.public void updateInstanceUuid(@Nonnull
java.lang.String instanceUuid)
updateInstanceUuid in interface LaunchIdLockinstanceUuid - instanceUuid a Client instance UUIDpublic void finishInstanceUuid(@Nonnull
java.lang.String instanceUuid)
finishInstanceUuid in interface LaunchIdLockinstanceUuid - a Client instance UUID.@Nonnull public java.util.Collection<java.lang.String> getLiveInstanceUuids()
LaunchIdLockgetLiveInstanceUuids in interface LaunchIdLock