public abstract class AbstractSender extends java.lang.Object implements Sender
senders.
Implementations based on this class should just implement the doSend(com.rollbar.api.payload.Payload)
method and not have to deal with listener and notifications to them.| Constructor and Description |
|---|
AbstractSender() |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(SenderListener listener)
Registers a listener to get notifications of sending payloads through the
sender listener. |
void |
close() |
void |
close(boolean wait)
Closes the sender.
|
protected abstract Response |
doSend(com.rollbar.api.payload.Payload payload)
This method just do the send logic.
|
java.util.List<SenderListener> |
getListeners()
Get the list of listeners registered.
|
void |
send(com.rollbar.api.payload.Payload payload)
Sends the payload getting notifications on the
send callback passed. |
protected abstract Response doSend(com.rollbar.api.payload.Payload payload) throws java.lang.Exception
payload - the payload to send.java.lang.Exception - an exception indicating that an error happen.public final void send(com.rollbar.api.payload.Payload payload)
Sendersend callback passed.public final void addListener(SenderListener listener)
Sendersender listener.addListener in interface Senderlistener - the listener.public final java.util.List<SenderListener> getListeners()
SendergetListeners in interface Senderpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOException