|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xins.common.threads.Doorman
synchronized
sections instead.
The implementation of this class is flawed.
Monitor that acts like a doorman. It implements a variation of the Alternating Reader Writer algorithm.
Nested Class Summary | |
static class |
Doorman.QueueEntryType
Deprecated. Type of an entry in a queue for a doorman. |
Constructor Summary | |
Doorman(String name,
boolean strict,
int queueSize,
long maxQueueWaitTime)
Deprecated. Constructs a new Doorman with the specified initial queue
size. |
Method Summary | |
void |
enterAsReader()
Deprecated. Enters the 'protected area' as a reader. |
void |
enterAsWriter()
Deprecated. Enters the 'protected area' as a writer. |
long |
getMaxQueueWaitTime()
Deprecated. Gets the maximum time to wait in the queue. |
String |
getName()
Deprecated. Gets the name of this doorman. |
void |
leaveAsReader()
Deprecated. Leaves the 'protected area' as a reader. |
void |
leaveAsWriter()
Deprecated. Leaves the 'protected area' as a writer. |
String |
toString()
Deprecated. Returns a textual representation of this object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Doorman(String name, boolean strict, int queueSize, long maxQueueWaitTime) throws IllegalArgumentException
Doorman
with the specified initial queue
size.
name
- the name for the protected area this doorman guards, to be used
during logging and when creating exceptions, cannot be
null
.strict
- flag that indicates if strict thread synchronization checking should
be performed.queueSize
- the initial queue size, must be >= 0.maxQueueWaitTime
- the maximum number of milliseconds an entry should be allowed to wait
in the queue, must be >= 0.
IllegalArgumentException
- if name == null
|| queueSize < 0
|| maxQueueWaitTime < 0L
.Method Detail |
public String getName()
null
public long getMaxQueueWaitTime()
public void enterAsReader() throws QueueTimeOutException
QueueTimeOutException
- if this thread was waiting in the queue for too long.public void enterAsWriter() throws QueueTimeOutException
QueueTimeOutException
- if this thread was waiting in the queue for too long.public void leaveAsReader()
public void leaveAsWriter()
public String toString()
null
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |