Platform SDK Java 8.5 API Reference

com.genesyslab.platform.commons.protocol
Class IgnoringMessageReceiverSupport

java.lang.Object
  extended by com.genesyslab.platform.commons.protocol.IgnoringMessageReceiverSupport
All Implemented Interfaces:
ChannelListener, Listener, MessageReceiver<Message>, MessageReceiverSupport, Receiver, ReceiverSupport

public class IgnoringMessageReceiverSupport
extends java.lang.Object
implements MessageReceiverSupport


Field Summary
 
Fields inherited from interface com.genesyslab.platform.commons.protocol.Receiver
DEF_INPUT_SIZE
 
Constructor Summary
IgnoringMessageReceiverSupport()
           
 
Method Summary
 void clearInput()
          Clears input of the receiver.
 int getInputSize()
          Returns the amount of messages this Receiver can hold before start to "forget stale messages".
 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(Message message)
           
 Message receive()
          Receives message from the channel.
 Message receive(long timeout)
          Receives message from the channel.
 void releaseReceivers()
          Notifies receivers (threads waiting on receive() methods) they should stop waiting and return null.
 void setInputSize(int inputSize)
          Sets the amount of messages this Receiver can hold before start to "forget stale messages".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IgnoringMessageReceiverSupport

public IgnoringMessageReceiverSupport()
Method Detail

clearInput

public void clearInput()
Description copied from interface: Receiver
Clears input of the receiver. Please note, that there is no strict guaranties that input will be empty after this method has returned, the messages could be delivered by another thread.

Specified by:
clearInput in interface Receiver

getInputSize

public int getInputSize()
Description copied from interface: Receiver
Returns the amount of messages this Receiver can hold before start to "forget stale messages".

Specified by:
getInputSize in interface Receiver
Returns:
maximum count of messages stored in receiver

setInputSize

public void setInputSize(int inputSize)
Description copied from interface: Receiver
Sets the amount of messages this Receiver can hold before start to "forget stale messages".

Specified by:
setInputSize in interface Receiver
Parameters:
inputSize - maximum count of messages stored in receiver

releaseReceivers

public void releaseReceivers()
Description copied from interface: Receiver
Notifies receivers (threads waiting on receive() methods) they should stop waiting and return null.

Specified by:
releaseReceivers in interface Receiver

onChannelOpened

public void onChannelOpened(java.util.EventObject event)
Description copied from interface: ChannelListener
onChannelOpened is called when the channel opening will be completed successfully.

Specified by:
onChannelOpened in interface ChannelListener
Parameters:
event - details.

onChannelClosed

public void onChannelClosed(ChannelClosedEvent event)
Description copied from interface: ChannelListener
onChannelClosed is called when the channel closed by any reason.

Specified by:
onChannelClosed in interface ChannelListener
Parameters:
event - details. See event.getCause() to analize the source reason.

onChannelError

public void onChannelError(ChannelErrorEvent event)
Description copied from interface: ChannelListener
onChannelError is called when some not critical channel error occurs. (like unknown attribute in message occurs)

Specified by:
onChannelError in interface ChannelListener
Parameters:
event - details. See event.getCause() to analize the problem source.

receive

public Message receive()
Description copied from interface: MessageReceiver
Receives message from the channel. Depending on implementation this method will or won't block for some or infinite time.

Specified by:
receive in interface MessageReceiver<Message>
Returns:
Message from the channel or null if the channel is "empty"
See Also:
MessageHandler, DuplexChannel.setMessageHandler(MessageHandler)

receive

public Message receive(long timeout)
Description copied from interface: MessageReceiver
Receives message from the channel. Depending on timeout value this method will or won't block for some time. See Channel description for timeout values meaning.

Specified by:
receive in interface MessageReceiver<Message>
Parameters:
timeout - timeout to waitResponse for message
Returns:
Message from the channel or null if the channel is "empty"
See Also:
MessageHandler, DuplexChannel.setMessageHandler(MessageHandler)

processMessage

public void processMessage(Message message)
Specified by:
processMessage in interface MessageReceiverSupport

Platform SDK Java 8.5 API Reference

Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 8.5.302.00
Copyright © 2006–2017 Genesys Telecommunications Laboratories, Inc. All rights reserved.