Class Caller

java.lang.Object
clazzfish.jdbc.internal.Caller

public final class Caller extends Object
The class Caller looks for the caller by analyzing the stacktrace. Before 3.1 it was part of the StasiStatement class.
Since:
3.1 (15.06.26)
Author:
oboehm
  • Method Details

    • of

      public static Caller of(Class<?>... ignoredClasses)
      Creates a caller element with the corresponding stack trace entry. To avoid to many objects of the same caller the created instances are cached.
      Parameters:
      ignoredClasses - caller which should be ignored
      Returns:
      caller of the of method
    • of

      public static Caller of(StackTraceElement stackTraceElement)
      Creates a caller element with the given stack trace entry. To avoid too many objects of the same caller the created instances are cached.
      Parameters:
      stackTraceElement - the stacktrace element of the caller
      Returns:
      caller of the of method
    • getCallerStacktrace

      public static StackTraceElement[] getCallerStacktrace(Class<?>... ignoredClasses)
      Gets the caller stacktrace. To find the real caller we ignore the first element from the stacktrace because this is e.g. the method Thread.getStackTrace() which is not relevant here.

      In case of a connection pool we have many caller with the same# stacktrace. For this rease we cache the stacktrace to reduche the number of doublettes.

      Parameters:
      ignoredClasses - the ignored classes
      Returns:
      the caller stacktrace
    • getStackTraceElement

      public StackTraceElement getStackTraceElement()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object