public abstract class AbstractQueueFactory<T extends IQueue> extends Object implements IQueueFactory
| Modifier and Type | Field and Description |
|---|---|
protected ConcurrentMap<QueueSpec,T> |
queueInstances |
| Constructor and Description |
|---|
AbstractQueueFactory() |
| Modifier and Type | Method and Description |
|---|---|
protected T |
createAndInitQueue(QueueSpec spec)
Creates & Initializes a new queue instance.
|
protected abstract T |
createQueueInstance(QueueSpec spec)
Creates a new queue instance.
|
void |
destroy() |
protected boolean |
disposeQueue(QueueSpec id,
T queue) |
protected abstract boolean |
disposeQueue(T queue) |
T |
getQueue(QueueSpec spec)
Gets an
IQueue instance. |
AbstractQueueFactory<T> |
init() |
protected void |
initQueue(T queue,
QueueSpec spec)
Initializes a newly created queue instance.
|
protected ConcurrentMap<QueueSpec,T extends IQueue> queueInstances
public AbstractQueueFactory<T> init()
public void destroy()
protected abstract T createQueueInstance(QueueSpec spec)
Called by createAndInitQueue(QueueSpec). Sub-class is to
implement this method.
spec - protected void initQueue(T queue, QueueSpec spec)
Called by createAndInitQueue(QueueSpec). Sub-class may override
this method to implement its own business logic.
queue - spec - protected T createAndInitQueue(QueueSpec spec)
spec - protected abstract boolean disposeQueue(T queue)
public T getQueue(QueueSpec spec)
IQueue instance.getQueue in interface IQueueFactoryspec - concrete class defines format of spec.Copyright © 2016 DDTH. All rights reserved.