Class TraceStack

java.lang.Object
com.smeup.kokos.sdk.rpgle.util.TraceStack
All Implemented Interfaces:
AutoCloseable

public class TraceStack extends Object implements AutoCloseable
Author:
Domenico Mancini (APU002)
  • Constructor Details

    • TraceStack

      public TraceStack()
    • TraceStack

      public TraceStack(int maxAllowed)
    • TraceStack

      public TraceStack(String name, int maxAllowed)
  • Method Details

    • getIdentifierName

      public String getIdentifierName()
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception
    • size

      public int size()
      Get the number of currently opened spans.
    • isEmpty

      public boolean isEmpty()
      Returns true when the stack is empty.
    • isNotEmpty

      public boolean isNotEmpty()
      Returns true when the stack is not empty.
    • canRecord

      public boolean canRecord()
      Whether this stack can report more traces or not.
    • openTrace

      public void openTrace(String name)
      Open a new named trace.
      Parameters:
      name - The name of the trace.
    • closeTrace

      public boolean closeTrace()
      Close the latest opened trace.
    • inspectAndClose

      public boolean inspectAndClose(Consumer<com.smeup.kokos.sdk.trace.SmeupSpan> inspector)
      Inspect the last span of latest opened trace and consumes it. Close the latest opened trace.
      Parameters:
      inspector - The consumer of SmeupSpans.
    • cleanup

      public void cleanup()
      Close all opened spans and reset the stack state.