public class ThreadActive extends Object
ThreadQueue is used to hold all unused threads.
| Constructor and Description |
|---|
ThreadActive(String aName)
Constructor - Create a new queue reference by name
|
| Modifier and Type | Method and Description |
|---|---|
void |
addReader(PoolMgr aReader)
Synchronized - Will add a new Reader (PoolMgr) to the Queue
|
void |
addThread(WorkerThread aThread)
Synchronized - Add a Thread to the queue, which is ready for work
|
void |
addWriter(ServicesIntf aService)
Synchronized - Will add a new Worker to the Queue
|
void |
close()
Will remove all messages from the queue and remove the queue
|
int |
getDefError() |
String |
getQueueName()
Returns the Queue Reference Name
|
WorkerThread |
getWorkerThread()
Synchronized - Will retrieve the next Thread from the queue
note: This call will block until a message is received
|
WorkerThread |
getWorkerThreadNoWait()
Will retrieve the next message from the queue
note: This call will NOT BLOCK if not message returns null
|
void |
removeReader(PoolMgr aReader)
Synchronized - Will remove a Reader (PoolMgr) from the Queue
|
void |
removeWriter(ServicesIntf aService)
Synchronized - Will remove a Worker from the Queue
|
int |
size()
Synchronized - Will return the number of messages left in the Queue
|
public ThreadActive(String aName)
aName - String Queue Reference Namepublic String getQueueName()
public void addThread(WorkerThread aThread)
aThread - WorkerThread Thread ready for workpublic WorkerThread getWorkerThread()
public WorkerThread getWorkerThreadNoWait()
public int size()
public void close()
public void addReader(PoolMgr aReader)
aReader - QueueReader New queue reader (PoolMgr) objectpublic void removeReader(PoolMgr aReader)
aReader - PoolMgr Is a reader objectpublic void addWriter(ServicesIntf aService)
aService - Worker New queue worker objectpublic void removeWriter(ServicesIntf aService)
aService - Worker Class which performs workpublic int getDefError()
Copyright © 2020. All rights reserved.