|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.genesyslab.platform.commons.protocol.AbstractQueueReceiver<T>
public abstract class AbstractQueueReceiver<T>
Field Summary |
---|
Fields inherited from interface com.genesyslab.platform.commons.protocol.Receiver |
---|
DEF_INPUT_SIZE |
Constructor Summary | |
---|---|
protected |
AbstractQueueReceiver(int queueSize,
T fake)
|
protected |
AbstractQueueReceiver(int queueSize,
T fake,
boolean growQueue)
|
protected |
AbstractQueueReceiver(java.util.concurrent.LinkedBlockingQueue<T> queue,
T fake)
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractQueueReceiver(int queueSize, T fake, boolean growQueue)
protected AbstractQueueReceiver(int queueSize, T fake)
protected AbstractQueueReceiver(java.util.concurrent.LinkedBlockingQueue<T> queue, T fake)
Method Detail |
---|
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()
|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |