ca.sqlpower.wabit.dao
Interface MessageSender<T>

Type Parameters:
T - The Object type that will represent the content of the message
All Known Implementing Classes:
HttpMessageSender, JSONHttpMessageSender, QueueMessageSender

public interface MessageSender<T>

A simple interface for anything that sends a message. The implementation can support buffering, but it is not mandatory.


Method Summary
 void clear()
          Empties the current queue of messages to be sent.
 void flush()
          Should the implementation support buffering, calling this will clear the buffered messages and send them.
 void send(T content)
          Adds a message for sending.
 

Method Detail

send

void send(T content)
          throws WabitPersistenceException
Adds a message for sending. It may not necessarily send the message immediately, for example if the implementation supports buffering, in which case you may have to call flush() to actually send the messages.

Parameters:
content -
Throws:
WabitPersistenceException

flush

void flush()
           throws WabitPersistenceException
Should the implementation support buffering, calling this will clear the buffered messages and send them. If the implementation chooses not to support buffering, this can be a simply no-op.

Throws:
WabitPersistenceException

clear

void clear()
Empties the current queue of messages to be sent.



Copyright © 2009. All Rights Reserved.