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
IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionprotected void send(byte[] buf,
int len)
throws Exception
buf - a buffer containing the messagelen - the num of bytes to send from the bufferExceptionpublic abstract void announce(String name, String value, GMetricType type, String units, GMetricSlope slope, int tmax, int dmax, String groupName) throws Exception
Protocolprotected void finalize()
throws Throwable
finalize in class ObjectThrowableObject.finalize()Copyright © 2014. All rights reserved.