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:
-
Field Summary
Fields inherited from class ee.jakarta.tck.concurrent.framework.TestServlet
FAILURE, nl, SUCCESS, TEST_METHOD
Fields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
before()
Override to mimic JUnit's@Before
annotation.void
destroy()
void
A ContextServiceDefinition defined in an EJB with all attributes configured propagates/clears/ignores context types as configured.void
A ContextServiceDefinition defined in an EJB with minimal attributes configured clears transaction context and propagates other types.void
A ContextService contextualizes a Supplier, which can be supplied as a dependent stage action to an unmanaged CompletableFuture.Methods inherited from class ee.jakarta.tck.concurrent.framework.TestServlet
after, beforeClass, doGet, doPost, getResponse, invokeTest, sendPostData
Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPatch, doPut, doTrace, getLastModified, init, isSensitiveHeader, service, service
Methods inherited from class jakarta.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Constructor Details
-
ContextServiceDefinitionFromEJBServlet
public ContextServiceDefinitionFromEJBServlet()
-
-
Method Details
-
destroy
public void destroy()- Specified by:
destroy
in interfacejakarta.servlet.Servlet
- Overrides:
destroy
in classjakarta.servlet.GenericServlet
-
before
public void before() throws jakarta.servlet.ServletExceptionDescription copied from class:TestServlet
Override to mimic JUnit's@Before
annotation.- Overrides:
before
in classTestServlet
- Throws:
jakarta.servlet.ServletException
-
testContextServiceDefinitionFromEJBAllAttributes
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
A ContextServiceDefinition defined in an EJB with minimal attributes configured clears transaction context and propagates other types.- Throws:
Throwable
-
testContextualSupplier
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
-