Class UnitOfWorkJavalinHandlers

java.lang.Object
com.kingsrook.qqq.middleware.javalin.UnitOfWorkJavalinHandlers

public final class UnitOfWorkJavalinHandlers extends Object
Javalin before/after handlers that make each HTTP request a core UnitOfWork (kind HTTP_REQUEST), so statement listeners can attribute database work to routes. The unit is named "METHOD /route/{template}" once Javalin has matched the route (concrete paths are never used, so ids and other path values do not enter the name). Both handlers do nothing while no statement listener is registered.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    after(io.javalin.http.Context context)
    After every request: name the unit by its matched route template and end it.
    static void
    before(io.javalin.http.Context context)
    Before every request: drop anything a previous request left on this thread, and begin the request's unit.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • before

      public static void before(io.javalin.http.Context context)
      Before every request: drop anything a previous request left on this thread, and begin the request's unit.
    • after

      public static void after(io.javalin.http.Context context)
      After every request: name the unit by its matched route template and end it.