Class TraceMessage

  • All Implemented Interfaces:
    java.io.Serializable

    public final class TraceMessage
    extends AbstractTraceMessage
    Trace message. It is passed to a tracer to write in a trace; after the trace has been processed returns exactly as it was before then is converted by a corresponding adapter into the aspect-dependent messages for use by handlers.

    It is possible for an aspect tracer to create trace messages which are used for a direct passing to the corresponding aspect adapter, without any intermediate forms; this messages can be passed directly to handlers and be converted to a tree of TraceNode only in case it is needed to write in an external form.

    If a message is formed to be directly passed to an adapter then the first query to the properties of the node (name, attrs, children) triggers a conversion to a tree of TraceNode.

    See Also:
    Serialized Form
    • Constructor Detail

      • TraceMessage

        public TraceMessage​(java.lang.String aspect,
                            java.lang.String channel,
                            TraceNode node)
        Constructor for trace sources.
      • TraceMessage

        public TraceMessage​(java.lang.String aspect,
                            TraceNode node)
        Constructor for tracing.
      • TraceMessage

        public TraceMessage​(java.lang.String aspect,
                            java.lang.String channel,
                            LazyNode node)
        Constructor for a direct data pass to handlers.
      • TraceMessage

        public TraceMessage​(java.lang.String aspect,
                            LazyNode node)
        Constructor for a direct data pass to handlers.
    • Method Detail

      • getNode

        public TraceNode getNode()
        Gets a root node of message. The node is created using a delayed conversion if needed.
      • getLazyNode

        public LazyNode getLazyNode()
        Gets raw data from the aspect library if this data is given. This data maybe converted to a normal tree of узлов if necessary.
      • getName

        public java.lang.String getName()
        Gets message type name. Names and the corresponding message structures are determined by aspect data model.

        The name is requested from the root node. == getNode().getName()

      • getAttrs

        public java.util.Map<java.lang.String,​java.lang.String> getAttrs()
        Get root node attributes. == getNode().getAttrs()
      • getAttr

        public java.lang.String getAttr​(java.lang.String attrName)
        Get root node attribute value. == getNode().getAttr(attrName)
      • removeAttr

        public void removeAttr​(java.lang.String attrName)
        Remove root node attribute. == getNode().removeAttr(attrName)
      • getChildren

        public java.util.List<TraceNode> getChildren()
        Get root node children. == getNode().getChildren()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object