public abstract class AbstractGelfTransport extends Object implements GelfTransport
GelfTransport implementation serving as parent for the concrete implementations.
This class is thread-safe.
| Modifier and Type | Field and Description |
|---|---|
protected GelfConfiguration |
config |
protected BlockingQueue<GelfMessage> |
queue |
| Constructor and Description |
|---|
AbstractGelfTransport(GelfConfiguration config)
Creates a new GELF transport with the given configuration.
|
AbstractGelfTransport(GelfConfiguration config,
BlockingQueue<GelfMessage> queue)
Creates a new GELF transport with the given configuration and
BlockingQueue. |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
createBootstrap(io.netty.channel.EventLoopGroup workerGroup) |
protected void |
scheduleReconnect(io.netty.channel.EventLoopGroup workerGroup) |
void |
send(GelfMessage message)
Sends the given message to the remote host.
|
void |
stop()
Stops the transport.
|
boolean |
trySend(GelfMessage message)
Tries to send the given message to the remote host.
|
protected final GelfConfiguration config
protected final BlockingQueue<GelfMessage> queue
public AbstractGelfTransport(GelfConfiguration config, BlockingQueue<GelfMessage> queue)
BlockingQueue.config - the client configurationqueue - the BlockingQueue used to buffer GELF messagespublic AbstractGelfTransport(GelfConfiguration config)
config - the client configurationprotected abstract void createBootstrap(io.netty.channel.EventLoopGroup workerGroup)
protected void scheduleReconnect(io.netty.channel.EventLoopGroup workerGroup)
public void send(GelfMessage message) throws InterruptedException
This implementation is backed by a BlockingQueue. When this method returns the
message has been added to the BlockingQueue but has not been sent to the remote
host yet.
send in interface GelfTransportmessage - message to send to the remote hostInterruptedExceptionpublic boolean trySend(GelfMessage message)
This implementation is backed by a BlockingQueue. When this method returns the
message has been added to the BlockingQueue but has not been sent to the remote
host yet.
trySend in interface GelfTransportmessage - message to send to the remote hostpublic void stop()
stop in interface GelfTransportCopyright © 2014–2017 Graylog, Inc.. All rights reserved.