public class InMemoryQueue<T extends Queueable> extends Object implements Queue<T>
Queueable
Modifier and Type | Field and Description |
---|---|
protected Queue<T> |
application |
protected Log |
log |
protected Map<byte[],Set<Integer>> |
maskedTags |
protected Queue<T> |
session |
Constructor and Description |
---|
InMemoryQueue()
Deprecated.
|
InMemoryQueue(com.epam.fixengine.configuration.Configuration conf)
Create the memory queue.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(T object)
Add object to the queue.
|
boolean |
addOutOfTurn(T object)
Add object to the queue out of turn.
|
void |
clear()
Clears the queue.
|
void |
clearOutOfTurn(Consumer<T> elementConsumer)
Removes the elements which were added by
addOutOfTurn . |
void |
commit()
Removes polled object from the queue.
|
void |
initialize()
Initializes queue.
|
boolean |
isAllEmpty() |
boolean |
isApplicationCommit()
Return true if last commit was application.
|
boolean |
isEmpty()
Checks if queue is currently empty.
|
boolean |
isOutOfTurnOnlyMode()
Out of turn messages only mode.
|
protected boolean |
isShutdown()
Returns true if queue is shutdown.
|
void |
notifyAllApplication()
Notify a new application message exists.
|
void |
notifyAllSession()
Notify a new session message exists.
|
T |
poll()
Poll object from the queue (doesn't remove it from queue yet!).
|
void |
setOutOfTurnOnlyMode(boolean newMode)
Out of turn messages only mode.
|
void |
shutdown()
Gracefully shutdowns queue.
|
int |
size()
Returns current queue size.
|
Queueable[] |
toArray()
Return all objects in the queue as array.
|
int |
totalSize()
Returns current total queue size.
|
protected final Log log
@Deprecated public InMemoryQueue()
public InMemoryQueue(com.epam.fixengine.configuration.Configuration conf)
public void initialize()
Queue
initialize
in interface Queue<T extends Queueable>
Queue.initialize()
public int size()
Queue
size
in interface Queue<T extends Queueable>
Queue.size()
public int totalSize()
Queue
totalSize
in interface Queue<T extends Queueable>
Queue.totalSize()
public boolean isEmpty()
Queue
isEmpty
in interface Queue<T extends Queueable>
Queue.isEmpty()
public boolean isAllEmpty()
isAllEmpty
in interface Queue<T extends Queueable>
public boolean add(T object)
Queue
add
in interface Queue<T extends Queueable>
object
- the elementQueue.add(Queueable)
public boolean addOutOfTurn(T object)
Queue
addOutOfTurn
in interface Queue<T extends Queueable>
object
- the elementQueue.addOutOfTurn(Queueable)
public T poll()
Queue
poll
in interface Queue<T extends Queueable>
Queue.poll()
public void setOutOfTurnOnlyMode(boolean newMode)
Queue
setOutOfTurnOnlyMode
in interface Queue<T extends Queueable>
newMode
- the modeQueue.setOutOfTurnOnlyMode(boolean)
public boolean isOutOfTurnOnlyMode()
Queue
isOutOfTurnOnlyMode
in interface Queue<T extends Queueable>
public void clearOutOfTurn(Consumer<T> elementConsumer)
Queue
addOutOfTurn
.clearOutOfTurn
in interface Queue<T extends Queueable>
elementConsumer
- callback for each removed message. It is called after removing next message.Queue.clearOutOfTurn(Consumer)
public void commit()
Queue
commit
in interface Queue<T extends Queueable>
Queue.commit()
public void clear()
Queue
clear
in interface Queue<T extends Queueable>
Queue.clear()
public void shutdown()
Queue
shutdown
in interface Queue<T extends Queueable>
Queue.shutdown()
protected boolean isShutdown()
public boolean isApplicationCommit()
public void notifyAllApplication()
Queue
The methods works only if turn "mode on" is off.
notifyAllApplication
in interface Queue<T extends Queueable>
Queue.setOutOfTurnOnlyMode(boolean)
public void notifyAllSession()
Queue
notifyAllSession
in interface Queue<T extends Queueable>
Copyright © 2000–2022 EPAM Systems. All rights reserved.