Package org.apache.juneau.rest.remote
Class RrpcServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.apache.juneau.rest.servlet.RestServlet
org.apache.juneau.rest.servlet.BasicRestServlet
org.apache.juneau.rest.remote.RrpcServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet
,jakarta.servlet.ServletConfig
,Serializable
,BasicUniversalConfig
,DefaultConfig
,DefaultHtmlConfig
,BasicRestOperations
Abstract class for defining Remote Interface Services.
Remote Interface Services are POJOs whose methods can be invoked remotely through proxy interfaces.
To implement a remote interface service, developers must simply subclass from this class and implement the
getServiceMap()
method that maps java interfaces to POJO instances.
See Also:
- See Also:
-
Field Summary
Fields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the list of interfaces to their implementation objects.invoke
(Reader r, ReaderParser p, ContentType contentType, String javaInterface, String javaMethod) listMethods
(String javaInterface) showEntryForm
(String javaInterface, String javaMethod) Methods inherited from class org.apache.juneau.rest.servlet.BasicRestServlet
error, getFavIcon, getHtdoc, getStats, getSwagger
Methods inherited from class org.apache.juneau.rest.servlet.RestServlet
destroy, doLog, getContext, getPath, getRequest, getResponse, init, log, log, service, setContext
Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
Methods inherited from class jakarta.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Constructor Details
-
RrpcServlet
public RrpcServlet()
-
-
Method Details
-
getServiceMap
Returns the list of interfaces to their implementation objects.This class is called often and not cached, so any caching should occur in the subclass if necessary.
- Returns:
- The service map.
- Throws:
Exception
- Any exception.
-
getInterfaces
- Throws:
Exception
-
listMethods
public Collection<LinkString> listMethods(@Path("javaInterface") @Schema(description="Java interface name") String javaInterface) throws Exception - Throws:
Exception
-
showEntryForm
public Div showEntryForm(@Path("javaInterface") @Schema(description="Java interface name") String javaInterface, @Path("javaMethod") @Schema(description="Java method name") String javaMethod) throws NotFound, Exception -
invoke
public Object invoke(Reader r, ReaderParser p, @Header("Content-Type") ContentType contentType, @Path("javaInterface") @Schema(description="Java interface name") String javaInterface, @Path("javaMethod") @Schema(description="Java method name") String javaMethod) throws UnsupportedMediaType, NotFound, Exception - Throws:
UnsupportedMediaType
NotFound
Exception
-