Class CDORestServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.eclipse.emf.cdo.server.rest.servlet.jakarta.CDORestServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable
public final class CDORestServlet
extends jakarta.servlet.http.HttpServlet
Jakarta Servlet adapter for the transport-neutral CDO REST service. A servlet container owns this servlet's
lifecycle, threads, connectors, authentication filters, and HTTP server. Register it at any customer-selected mapping
such as
/cdo/*; the service receives the path relative to that mapping and the supplied HTTP headers. The
service can use a configured transport-neutral authenticator, and the container's standard principal is available to
authenticators that trust servlet authentication.- Author:
- Eike Stepper
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringServlet context attribute used by the no-argument constructor to find the programmatically configured service.Fields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD -
Constructor Summary
ConstructorsConstructorDescriptionCreates a servlet for registration through a standard servlet container.CDORestServlet(CDORestService service) Creates a servlet bound to a service instance, suitable for programmatic registration in an existing HTTP server. -
Method Summary
Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPatch, doPost, doPut, doTrace, getLastModified, init, isSensitiveHeader, serviceMethods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, log
-
Field Details
-
SERVICE_ATTRIBUTE
Servlet context attribute used by the no-argument constructor to find the programmatically configured service.
-
-
Constructor Details
-
CDORestServlet
public CDORestServlet()Creates a servlet for registration through a standard servlet container. Before servlet initialization, the surrounding application must place aCDORestServicein the servlet context underSERVICE_ATTRIBUTE. -
CDORestServlet
Creates a servlet bound to a service instance, suitable for programmatic registration in an existing HTTP server. The service instance remains owned by the caller and can be shared with other adapters.- Parameters:
service- the transport-neutral service to receive requests
-
-
Method Details
-
getRestService
Returns the service bound at initialization, primarily for containers that inspect servlet instances after registration.- Returns:
- the shared transport-neutral service
-
init
public void init() throws jakarta.servlet.ServletException- Overrides:
initin classjakarta.servlet.GenericServlet- Throws:
jakarta.servlet.ServletException
-
service
protected void service(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException, IOException - Overrides:
servicein classjakarta.servlet.http.HttpServlet- Throws:
jakarta.servlet.ServletExceptionIOException
-