|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.WrapperReentrantGate
public class WrapperReentrantGate
A Gate implementation that allows for 2^31 reentrant enter calls by a single thread.
Constructor Summary | |
---|---|
WrapperReentrantGate() Default constructor. |
|
WrapperReentrantGate(Gate gate) Construct a WrapperReentrantGate around the specified underlying gate. |
Method Summary | |
---|---|
boolean |
barEntry(long cMillis) Bar entry to the thread gate by other threads, but do not wait for the gate to close. |
boolean |
close(long cMillis) Close the gate. |
boolean |
enter(long cMillis) Enter the gate. |
void |
exit() Exit the gate. |
boolean |
isClosed() Determine if any thread has closed the gate and continues to hold exclusive access. |
boolean |
isClosedByCurrentThread() Determine if the calling thread has closed the gate and continues to hold exclusive access. |
boolean |
isEnteredByCurrentThread() Determines if the current thread has entered the gate and not yet exited. |
void |
open() Re-open the closed gate. |
Constructor Detail |
---|
public WrapperReentrantGate()
public WrapperReentrantGate(Gate gate)
gate
- a Gate
to be wrappedMethod Detail |
---|
public boolean close(long cMillis)
Gate.open()
method.close
in interface Gate
cMillis
- maximum number of milliseconds to wait; pass -1 to wait indefinitely or 0 to return immediatelypublic void open()
open
in interface Gate
public boolean enter(long cMillis)
Gate.exit()
method.enter
in interface Gate
cMillis
- maximum number of milliseconds to wait; pass -1 to wait indefinitely or 0 to return immediatelypublic void exit()
Gate.enter(long)
method.exit
in interface Gate
public boolean barEntry(long cMillis)
Each successful invocation of this method must ultimately have a corresponding invocation of the open method (assuming the thread gate is not destroyed) even if the calling thread does not subsequently close the gate.
gate.barEntry(-1);
try
{
// processing that does not require the gate to be closed
// ...
}
finally
{
gate.close(-1);
try
{
// processing that does require the gate to be closed
// ...
}
finally
{
gate.open(); // matches gate.close()
}
gate.open(); // matches gate.barEntry()
}
barEntry
in interface Gate
cMillis
- maximum number of milliseconds to wait; pass -1 for forever or 0 for no waitpublic boolean isClosedByCurrentThread()
isClosedByCurrentThread
in interface Gate
public boolean isEnteredByCurrentThread()
isEnteredByCurrentThread
in interface Gate
public boolean isClosed()
isClosed
in interface Gate
|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |