Package com.amazonaws.xray.emitters
Class Emitter
- java.lang.Object
-
- com.amazonaws.xray.emitters.Emitter
-
- Direct Known Subclasses:
DelegatingEmitter
,UDPEmitter
public abstract class Emitter extends java.lang.Object
An emitter of segments and subsegments to X-Ray.
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
DAEMON_BUF_RECEIVE_SIZE
protected static java.lang.String
PRIORITY_PROTOCOL_HEADER
protected static char
PROTOCOL_DELIMITER
protected static java.lang.String
PROTOCOL_HEADER
-
Constructor Summary
Constructors Constructor Description Emitter()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static Emitter
create()
Returns anEmitter
that uses a defaultDaemonConfiguration
.static Emitter
create(DaemonConfiguration configuration)
Returns anEmitter
that uses the providedDaemonConfiguration
.abstract boolean
sendSegment(Segment segment)
Sends a segment to the X-Ray daemon.abstract boolean
sendSubsegment(Subsegment subsegment)
Sends a subsegment to the X-Ray daemon.
-
-
-
Field Detail
-
PROTOCOL_HEADER
protected static final java.lang.String PROTOCOL_HEADER
- See Also:
- Constant Field Values
-
PRIORITY_PROTOCOL_HEADER
protected static final java.lang.String PRIORITY_PROTOCOL_HEADER
- See Also:
- Constant Field Values
-
PROTOCOL_DELIMITER
protected static final char PROTOCOL_DELIMITER
- See Also:
- Constant Field Values
-
DAEMON_BUF_RECEIVE_SIZE
protected static final int DAEMON_BUF_RECEIVE_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
create
public static Emitter create() throws java.io.IOException
Returns anEmitter
that uses a defaultDaemonConfiguration
.- Throws:
java.io.IOException
- if an error occurs while instantiating theEmitter
(e.g., socket failure).
-
create
public static Emitter create(DaemonConfiguration configuration) throws java.io.IOException
Returns anEmitter
that uses the providedDaemonConfiguration
.- Throws:
java.io.IOException
- if an error occurs while instantiating theEmitter
(e.g., socket failure).
-
sendSegment
public abstract boolean sendSegment(Segment segment)
Sends a segment to the X-Ray daemon.- Parameters:
segment
- the segment to send- Returns:
- true if the send operation was successful
-
sendSubsegment
public abstract boolean sendSubsegment(Subsegment subsegment)
Sends a subsegment to the X-Ray daemon.- Parameters:
subsegment
- the subsegment to send- Returns:
- true if the send operation was successful
-
-