|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectpt.ua.concurrent.CObject
public abstract class CObject
A replacement for Object to ease and augment the usage of concurrent related methods.
This class is only usable by extension.
This class follows DbC(tm) methodology
(Wikipedia).
Where possible, contracts are implement with native's Java assert.
| Constructor Summary | |
|---|---|
CObject()
Constructor of an object without registering waiting threads in await service. |
|
CObject(boolean registerAwaitingThreads)
Constructor of an object. |
|
| Method Summary | |
|---|---|
void |
await()
Object's wait replacement, in which: - the checked exception InterruptedException, is replaced by the unchecked exception ThreadInterruptedException; - supports the registration of waiting threads for interrupt purposes. |
void |
await(long millis)
Object's wait replacement, in which: - the checked exception InterruptedException, is replaced by the unchecked exception ThreadInterruptedException; - supports the registration of waiting threads for interrupt purposes. |
void |
await(long millis,
int nanos)
Object's wait replacement, in which: - the checked exception InterruptedException, is replaced by the unchecked exception ThreadInterruptedException; - supports the registration of waiting threads for interrupt purposes. |
void |
broadcast()
Object's nofifyAll replacement. |
void |
interruptWaitingThreads()
Requests the interruption all threads blocked on current lock and/or related condition variables. |
boolean |
lockIsMine()
Is lock owned by me? |
boolean |
registerAwaitingThreads()
Are threads registered when waiting (in await)? |
void |
signal()
Object's nofify replacement. |
boolean |
syncronizedLockIsMine()
Is native (synchronized) lock owned by me? |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CObject()
public CObject(boolean registerAwaitingThreads)
registerAwaitingThreads - if true, threads are registered when waiting| Method Detail |
|---|
public boolean registerAwaitingThreads()
registerAwaitingThreads in interface InterruptibleAwaitingThreadspublic boolean lockIsMine()
lockIsMine in interface SyncCVpublic final boolean syncronizedLockIsMine()
public void await()
throws ThreadInterruptedException
syncronizedLockIsMine() - native lock owned by me
await in interface SyncCVThreadInterruptedException
public void await(long millis)
throws ThreadInterruptedException
millis >= 0 - non negative timeoutsyncronizedLockIsMine() - native lock owned by me
millis - timeout (in milliseconds)
ThreadInterruptedException
public void await(long millis,
int nanos)
throws ThreadInterruptedException
millis >= 0 - non negative timeoutnanos >= 0 - non negative timeoutsyncronizedLockIsMine() - native lock owned by me
millis - timeout (in milliseconds)nanos - timeout (in nanoseconds)
ThreadInterruptedExceptionpublic void signal()
syncronizedLockIsMine() - native lock owned by me
signal in interface SyncCVpublic void broadcast()
syncronizedLockIsMine() - native lock owned by me
broadcast in interface SyncCVpublic void interruptWaitingThreads()
registerAwaitingThreads() - registering of waiting threads activated
interruptWaitingThreads in interface InterruptibleAwaitingThreads
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||