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 Details

    • 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
  • Constructor Details

    • Emitter

      public Emitter()
  • Method Details

    • create

      public static Emitter create() throws java.io.IOException
      Returns an Emitter that uses a default DaemonConfiguration.
      Throws:
      java.io.IOException - if an error occurs while instantiating the Emitter (e.g., socket failure).
    • create

      public static Emitter create​(DaemonConfiguration configuration) throws java.io.IOException
      Returns an Emitter that uses the provided DaemonConfiguration.
      Throws:
      java.io.IOException - if an error occurs while instantiating the Emitter (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