@Deprecated public class JaxRsRestlet extends Restlet
This class choose the JAX-RS resource class and method to use for a request
and handles the result from he resource method. Typically you should
instantiate a JaxRsApplication
to run JAX-RS resource classes.
Constructor and Description |
---|
JaxRsRestlet(Context context,
MetadataService metadataService)
Deprecated.
Creates a new JaxRsRestlet with the given Context.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addClass(java.lang.Class<?> jaxRsClass)
Deprecated.
Will use the given JAX-RS root resource class.
If the given class is not a valid root resource class, a warning is logged and false is returned. |
boolean |
addSingleton(java.lang.Object jaxRsProviderOrRootresourceObject)
Deprecated.
Adds the provider object to this JaxRsRestlet.
|
void |
attachDefault(Restlet notMatchedRestlet)
Deprecated.
Sets the Restlet that is called, if no (root) resource class or method
could be found.
|
Restlet |
getNoResMethodHandler()
Deprecated.
Returns the Restlet that is called, if no resource method class could be
found.
|
Restlet |
getNoResourceClHandler()
Deprecated.
Returns the Restlet that is called, if no resource class could be found.
|
Restlet |
getNoRootResClHandler()
Deprecated.
Returns the Restlet that is called, if no root resource class could be
found.
|
ObjectFactory |
getObjectFactory()
Deprecated.
Returns the ObjectFactory for root resource class and provider
instantiation, if given.
|
java.util.Set<java.lang.Class<?>> |
getRootResourceClasses()
Deprecated.
Returns an unmodifiable set with the attached root resource classes.
|
java.util.Collection<java.lang.String> |
getRootUris()
Deprecated.
Returns a Collection with all root uris attached to this JaxRsRestlet.
|
void |
handle(Request request,
Response response)
Deprecated.
Handles a call by looking for the resource metod to call, call it and
return the result.
|
void |
setNoResMethodHandler(Restlet noResMethodHandler)
Deprecated.
Sets the Restlet that will handle the
Request s, if no resource
method could be found. |
void |
setNoResourceClHandler(Restlet noResourceClHandler)
Deprecated.
Sets the Restlet that will handle the
Request s, if no resource
class could be found. |
void |
setNoRootResClHandler(Restlet noRootResClHandler)
Deprecated.
Sets the Restlet that is called, if no root resource class could be
found.
|
void |
setObjectFactory(ObjectFactory objectFactory)
Deprecated.
Sets the ObjectFactory for root resource class and provider
instantiation.
|
void |
start()
Deprecated.
|
createFinder, finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwner, stop
public JaxRsRestlet(Context context, MetadataService metadataService)
context
- the context from the parent, see
Restlet.Restlet(Context)
.metadataService
- the metadata service of the JaxRsApplication
.JaxRsRestlet(Context, MetadataService)
public boolean addClass(java.lang.Class<?> jaxRsClass) throws java.lang.IllegalArgumentException
jaxRsClass
- A JAX-RS root resource class or provider class to add. If the
root resource class is already available in this JaxRsRestlet,
it is ignored for later calls of this method.java.lang.IllegalArgumentException
- if the root resource class is null.public boolean addSingleton(java.lang.Object jaxRsProviderOrRootresourceObject) throws java.lang.IllegalArgumentException
jaxRsProviderOrRootresourceObject
- the JAX-RS provider or root resource objectjava.lang.IllegalArgumentException
- if null was givenProvider
public void attachDefault(Restlet notMatchedRestlet)
notMatchedRestlet
- the Restlet to call, if no (root) resource class or method
could be found.setNoRootResClHandler(Restlet)
,
setNoResourceClHandler(Restlet)
,
setNoResMethodHandler(Restlet)
,
Router.attachDefault(Restlet)
public Restlet getNoResMethodHandler()
setNoResMethodHandler(Restlet)
public Restlet getNoResourceClHandler()
public Restlet getNoRootResClHandler()
setNoRootResClHandler(Restlet)
public ObjectFactory getObjectFactory()
public java.util.Set<java.lang.Class<?>> getRootResourceClasses()
public java.util.Collection<java.lang.String> getRootUris()
public void handle(Request request, Response response)
public void setNoResMethodHandler(Restlet noResMethodHandler)
Request
s, if no resource
method could be found.noResMethodHandler
- the noResMethodHandler to setgetNoResMethodHandler()
,
setNoResourceClHandler(Restlet)
,
setNoRootResClHandler(Restlet)
,
attachDefault(Restlet)
public void setNoResourceClHandler(Restlet noResourceClHandler)
Request
s, if no resource
class could be found. You could remove a given Restlet by set null here.noResourceClHandler
- the noResourceClHandler to setgetNoResourceClHandler()
,
setNoResMethodHandler(Restlet)
,
setNoRootResClHandler(Restlet)
,
attachDefault(Restlet)
public void setNoRootResClHandler(Restlet noRootResClHandler)
noRootResClHandler
- the Restlet to call, if no root resource class could be found.getNoRootResClHandler()
,
setNoResourceClHandler(Restlet)
,
setNoResMethodHandler(Restlet)
,
attachDefault(Restlet)
public void setObjectFactory(ObjectFactory objectFactory)
objectFactory
- the ObjectFactory for root resource class and provider
instantiation.Copyright © 2005-2020 Restlet.