ChannelListener
, Listener
, Receiver
, ReceiverSupport
QueueMessageReceiver
, QueueRequestReceiver
public abstract class AbstractQueueReceiver<T> extends java.lang.Object implements ReceiverSupport
DEF_INPUT_SIZE
Modifier | Constructor | Description |
---|---|---|
protected |
AbstractQueueReceiver(int queueSize,
T fake) |
|
protected |
AbstractQueueReceiver(int queueSize,
T fake,
boolean growQueue) |
|
protected |
AbstractQueueReceiver(java.util.concurrent.LinkedBlockingQueue<T> queue,
T fake) |
Modifier and Type | Method | Description |
---|---|---|
void |
clearInput() |
Clears input of the receiver.
|
long |
getEnqueTimeout() |
|
protected abstract java.lang.Object |
getFake() |
|
int |
getInputSize() |
Returns the amount of messages this Receiver can hold before
start to "forget stale messages".
|
int |
getMaxInputSize() |
|
protected com.genesyslab.platform.commons.protocol.runtime.channel.QueueSupport<T> |
getQueueSupport() |
|
void |
onChannelClosed(ChannelClosedEvent event) |
onChannelClosed is called when the channel closed by any reason.
|
void |
onChannelError(ChannelErrorEvent event) |
onChannelError is called when some not critical channel error occurs.
|
void |
onChannelOpened(java.util.EventObject event) |
onChannelOpened is called when the channel opening will be completed successfully.
|
void |
processMessage(T message) |
|
T |
receive() |
|
T |
receive(long timeout) |
|
void |
releaseReceivers() |
Notifies receivers (threads waiting on receive() methods) they should
stop waiting and return null.
|
void |
setEnqueTimeout(long enqueTimeout) |
Using timeout can slow down the processing of messages from server.
|
void |
setInputSize(int inputSize) |
Sets the amount of messages this Receiver can hold before
start to "forget stale messages".
|
void |
setMaxInputSize(int maxInputSize) |
Maximum capacity the queue can grow to if such growing is enabled.
|
protected AbstractQueueReceiver(int queueSize, T fake, boolean growQueue)
protected AbstractQueueReceiver(int queueSize, T fake)
public long getEnqueTimeout()
public void setEnqueTimeout(long enqueTimeout)
enqueTimeout
- enqueue timeoutpublic int getInputSize()
Receiver
getInputSize
in interface Receiver
public void setInputSize(int inputSize)
Receiver
setInputSize
in interface Receiver
inputSize
- maximum count of messages stored in receiverpublic int getMaxInputSize()
public void setMaxInputSize(int maxInputSize)
maxInputSize
- max capacitypublic void clearInput()
Receiver
clearInput
in interface Receiver
public void onChannelOpened(java.util.EventObject event)
ChannelListener
onChannelOpened
in interface ChannelListener
event
- details.public void onChannelClosed(ChannelClosedEvent event)
ChannelListener
onChannelClosed
in interface ChannelListener
event
- details. See event.getCause() to analize the source reason.public void onChannelError(ChannelErrorEvent event)
ChannelListener
onChannelError
in interface ChannelListener
event
- details. See event.getCause() to analize the problem source.public void releaseReceivers()
Receiver
releaseReceivers
in interface Receiver
protected com.genesyslab.platform.commons.protocol.runtime.channel.QueueSupport<T> getQueueSupport()
public T receive() throws java.lang.InterruptedException, java.lang.IllegalStateException
java.lang.InterruptedException
java.lang.IllegalStateException
public T receive(long timeout) throws java.lang.InterruptedException, java.lang.IllegalStateException
java.lang.InterruptedException
java.lang.IllegalStateException
public void processMessage(T message)
protected abstract java.lang.Object getFake()
Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 9.0.006.00
Copyright © 2006–2019 Genesys Telecommunications Laboratories, Inc. All rights reserved.