Class ContextServiceDefinitionFromEJBServlet

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
ee.jakarta.tck.concurrent.framework.TestServlet
ee.jakarta.tck.concurrent.spec.ContextService.contextPropagate.ContextServiceDefinitionFromEJBServlet
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable

@WebServlet("/ContextServiceDefinitionFromEJBServlet") public class ContextServiceDefinitionFromEJBServlet extends TestServlet
See Also:
  • Constructor Details

    • ContextServiceDefinitionFromEJBServlet

      public ContextServiceDefinitionFromEJBServlet()
  • Method Details

    • destroy

      public void destroy()
      Specified by:
      destroy in interface jakarta.servlet.Servlet
      Overrides:
      destroy in class jakarta.servlet.GenericServlet
    • before

      public void before() throws jakarta.servlet.ServletException
      Description copied from class: TestServlet
      Override to mimic JUnit's @Before annotation.
      Overrides:
      before in class TestServlet
      Throws:
      jakarta.servlet.ServletException
    • testContextServiceDefinitionFromEJBAllAttributes

      public void testContextServiceDefinitionFromEJBAllAttributes() throws Throwable
      A ContextServiceDefinition defined in an EJB with all attributes configured propagates/clears/ignores context types as configured. ContextA, which is tested here, propagates Application context and IntContext, clears StringContext, and leaves Transaction context unchanged.
      Throws:
      Throwable
    • testContextServiceDefinitionFromEJBDefaults

      public void testContextServiceDefinitionFromEJBDefaults() throws Throwable
      A ContextServiceDefinition defined in an EJB with minimal attributes configured clears transaction context and propagates other types.
      Throws:
      Throwable
    • testContextualSupplier

      public void testContextualSupplier() throws Throwable
      A ContextService contextualizes a Supplier, which can be supplied as a dependent stage action to an unmanaged CompletableFuture. The dependent stage action runs with the thread context of the thread that contextualizes the Supplier, per the configuration of the ContextServiceDefinition.
      Throws:
      Throwable