public class SessionLock extends Object
| Constructor and Description |
|---|
SessionLock()
Creates a new instance of SessionLock
|
| Modifier and Type | Method and Description |
|---|---|
void |
decrementForegroundRefCount()
decrement the foregroundRefCount
|
int |
getForegroundRefCount()
get the foregroundRefCount
|
String |
getLockType()
get the lock type
|
boolean |
hasNonHttpLockOccurred() |
void |
incrementForegroundRefCount()
increment the foregroundRefCount
|
boolean |
isBackgroundLocked()
return whether lock is background locked
|
boolean |
isForegroundLocked()
return whether lock is foreground locked
|
boolean |
isLocked()
return whether lock is locked (either foreground or background)
|
boolean |
lockBackground()
if possible, the lock will be background locked
if the lock is already foreground locked the method
will return false and the lock remains foreground locked
(i.e.
|
boolean |
lockForeground()
if possible, the lock will be foreground locked
if it was already foreground locked; it will
remain so and the foregroundRefCount will be incremented
if the lock is already background locked the method
will return false and the lock remains background locked
(i.e.
|
boolean |
lockForeground(boolean isHttp) |
void |
setForegroundRefCount(int foregroundRefCount)
set the foregroundRefCount
|
void |
setLockType(String lockType)
set the lock type - lockType must be BACKGROUND_LOCK or FOREGROUND_LOCK
|
String |
toString()
returns String representation of the state of the lock
|
void |
unlock()
unlock the lock
if background locked the lock will become fully unlocked
if foreground locked the lock will become fully unlocked
if foregroundRefCount was 1; otherwise it will
decrement the foregroundRefCount and the lock will remain foreground locked
|
void |
unlockBackground()
unlock the lock for the background locked case
the lock will be unlocked
|
void |
unlockForeground()
unlock the lock for the foreground locked case
the lock will be unlocked
if foregroundRefCount was 1; otherwise it will
decrement the foregroundRefCount and the lock will remain foreground locked
|
void |
unlockForegroundCompletely()
unlock the lock
this is a force unlock; foregroundRefCount is ignored
|
public String getLockType()
public void setLockType(String lockType)
lockType - the type of the lockpublic int getForegroundRefCount()
public void setForegroundRefCount(int foregroundRefCount)
foregroundRefCount - public void incrementForegroundRefCount()
public void decrementForegroundRefCount()
public boolean isBackgroundLocked()
public boolean isForegroundLocked()
public boolean isLocked()
public boolean hasNonHttpLockOccurred()
public void unlock()
public void unlockForeground()
public void unlockForegroundCompletely()
public void unlockBackground()
public boolean lockForeground()
public boolean lockForeground(boolean isHttp)
public boolean lockBackground()
Copyright © 2017. All rights reserved.