Package org.apache.juneau.rest.servlet
Class RestObject
java.lang.Object
org.apache.juneau.rest.servlet.RestObject
- Direct Known Subclasses:
- BasicRestObject
Identical to 
RestServlet but doesn't extend from HttpServlet.
 This is particularly useful in Spring Boot environments that auto-detect servlets to deploy in servlet containers, but you want this resource to be deployed as a child instead.
See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidMain logger method.protected RestContextReturns the read-only context object that contains all the configuration information about this resource.Returns the current thread-local HTTP request.Returns the current thread-local HTTP response.voidLog a message.voidLog a message.protected voidsetContext(RestContext context) Sets the context object for this servlet.
- 
Constructor Details- 
RestObjectpublic RestObject()
 
- 
- 
Method Details- 
setContextSets the context object for this servlet.- Parameters:
- context- Sets the context object on this servlet.
- Throws:
- jakarta.servlet.ServletException- If error occurred during post-initialiation.
 
- 
getContextReturns the read-only context object that contains all the configuration information about this resource.- Returns:
- The context information on this servlet.
 
- 
logLog a message.Subclasses can intercept the handling of these messages by overriding doLog(Level, Throwable, Supplier).- Parameters:
- level- The log level.
- msg- The message to log.
- args- Optional- MessageFormat-style arguments.
 
- 
logLog a message.Subclasses can intercept the handling of these messages by overriding doLog(Level, Throwable, Supplier).- Parameters:
- level- The log level.
- cause- The cause.
- msg- The message to log.
- args- Optional- MessageFormat-style arguments.
 
- 
doLogMain logger method.The default behavior logs a message to the Java logger of the class name. Subclasses can override this method to implement their own logger handling. - Parameters:
- level- The log level.
- cause- Optional throwable.
- msg- The message to log.
 
- 
getRequestReturns the current thread-local HTTP request.- Returns:
- The current thread-local HTTP request, or null if it wasn't created.
 
- 
getResponseReturns the current thread-local HTTP response.- Returns:
- The current thread-local HTTP response, or null if it wasn't created.
 
 
-