public abstract class AbstractProtocol extends Object implements Protocol
Modifier and Type | Field and Description |
---|---|
protected String |
group |
protected int |
port |
protected InetAddress |
udpAddr |
Constructor and Description |
---|
AbstractProtocol(String group,
int port,
GMetric.UDPAddressingMode mode,
int ttl) |
Modifier and Type | Method and Description |
---|---|
abstract void |
announce(String name,
String value,
GMetricType type,
String units,
GMetricSlope slope,
int tmax,
int dmax,
String groupName)
Announces a metric
|
void |
close()
Closes the underlying socket to prevent socket leaks.
|
protected void |
finalize() |
protected void |
send(byte[] buf,
int len)
Sends the provided byte buffer
|
protected InetAddress udpAddr
protected int port
protected String group
public AbstractProtocol(String group, int port, GMetric.UDPAddressingMode mode, int ttl) throws IOException
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
protected void send(byte[] buf, int len) throws Exception
buf
- a buffer containing the messagelen
- the num of bytes to send from the bufferException
public abstract void announce(String name, String value, GMetricType type, String units, GMetricSlope slope, int tmax, int dmax, String groupName) throws Exception
Protocol
protected void finalize() throws Throwable
finalize
in class Object
Throwable
Object.finalize()
Copyright © 2016. All rights reserved.