|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.restlet.Uniform
org.restlet.Restlet
org.restlet.ext.jaxrs.JaxRsRestlet
public class JaxRsRestlet
This class choose the JAX-RS resource class and method to use for a request
and handles the result from he resource method. Typcally you should
instantiate a JaxRsApplication to run JAX-RS resource classes.
The JAX-RS extension as well as the JAX-RS specification are currently
under development. You should use this extension only for experimental
purpose.
For further information see Java
Service Request 311.
| Constructor Summary | |
|---|---|
JaxRsRestlet(Context context,
MetadataService metadataService)
Creates a new JaxRsRestlet with the given Context. |
|
JaxRsRestlet(Context context,
RoleChecker roleChecker,
MetadataService metadataService)
Creates a new JaxRsRestlet with the given Context. |
|
| Method Summary | |
|---|---|
boolean |
addClass(Class<?> jaxRsClass)
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(Object jaxRsProviderOrRootresourceObject)
Adds the provider object to this JaxRsRestlet. |
ObjectFactory |
getObjectFactory()
Returns the ObjectFactory for root resource class and provider instantiation, if given. |
RoleChecker |
getRoleChecker()
Gets the currently used RoleChecker. |
Set<Class<?>> |
getRootResourceClasses()
Returns an unmodifiable set with the attached root resource classes. |
Collection<String> |
getRootUris()
Returns a Collection with all root uris attached to this JaxRsRestlet. |
void |
handle(Request request,
Response response)
Handles a call by looking for the resource metod to call, call it and return the result. |
void |
setObjectFactory(ObjectFactory objectFactory)
Sets the ObjectFactory for root resource class and provider instantiation. |
void |
setRoleChecker(RoleChecker roleChecker)
Sets the RoleChecker to use. |
void |
start()
|
| Methods inherited from class org.restlet.Restlet |
|---|
getApplication, getContext, getLogger, init, isStarted, isStopped, setContext, stop |
| Methods inherited from class org.restlet.Uniform |
|---|
delete, delete, get, get, handle, head, head, options, options, post, post, put, put |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JaxRsRestlet(Context context,
MetadataService metadataService)
SecurityContext.isUserInRole(String). You may set a
RoleChecker by using the constructor
JaxRsRestlet(Context, RoleChecker, MetadataService) or method
setRoleChecker(RoleChecker).
context - the context from the parent, see
Restlet.Restlet(Context).metadataService - the metadata service of the JaxRsApplication.JaxRsRestlet(Context, RoleChecker, MetadataService)
public JaxRsRestlet(Context context,
RoleChecker roleChecker,
MetadataService metadataService)
context - the context from the parent, see
Restlet.Restlet(Context).roleChecker - The RoleChecker to use. If you don't need the access
control, you can use the RoleChecker.FORBID_ALL,
the RoleChecker.ALLOW_ALL or the
RoleChecker.REJECT_WITH_ERROR.metadataService - the metadata service of the JaxRsApplication.JaxRsRestlet(Context, MetadataService)| Method Detail |
|---|
public boolean addClass(Class<?> jaxRsClass)
throws 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.
IllegalArgumentException - if the root resource class is null.
public boolean addSingleton(Object jaxRsProviderOrRootresourceObject)
throws IllegalArgumentException
jaxRsProviderOrRootresourceObject - the JAX-RS provider or root resource object
IllegalArgumentException - if null was givenProvider
public void start()
throws Exception
start in class RestletException
public void handle(Request request,
Response response)
handle in class Restletrequest - The Request to handle.response - The Response to update.public RoleChecker getRoleChecker()
RoleChecker.
setRoleChecker(RoleChecker)
public void setRoleChecker(RoleChecker roleChecker)
throws IllegalArgumentException
RoleChecker to use.
roleChecker - the roleChecker to set. Must not be null. Take a look at
RoleChecker.ALLOW_ALL,
RoleChecker.FORBID_ALL and
RoleChecker.REJECT_WITH_ERROR.
IllegalArgumentException - If the given roleChecker is null.RoleChecker,
getRoleChecker()public Set<Class<?>> getRootResourceClasses()
public Collection<String> getRootUris()
public ObjectFactory getObjectFactory()
public void setObjectFactory(ObjectFactory objectFactory)
objectFactory - the ObjectFactory for root resource class and provider
instantiation.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||