Class Emitter

  • Direct Known Subclasses:
    DelegatingEmitter, UDPEmitter

    public abstract class Emitter
    extends java.lang.Object
    An emitter of segments and subsegments to X-Ray.
    • 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
      • DAEMON_BUF_RECEIVE_SIZE

        protected static final int DAEMON_BUF_RECEIVE_SIZE
        See Also:
        Constant Field Values
    • Constructor Detail

      • Emitter

        public Emitter()
    • Method Detail

      • 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).
      • 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