|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.Restlet
org.restlet.Application
org.restlet.ext.jaxrs.JaxRsApplication
public class JaxRsApplication
This is the main class to be used for the instantiation of a JAX-RS runtime environment.
To set up a JAX-RS runtime environment you should instantiate a
JaxRsApplication(Context)
.
Application
(s) by calling add(Application)
.Authenticator
and perhaps an
RoleChecker
, see setGuard(Authenticator)
or
setAuthentication(Authenticator, RoleChecker)
.Component
.
Concurrency note: instances of this class or its subclasses can be invoked by
several threads at the same time and therefore must be thread-safe. You
should be especially careful when storing state in member variables.
Constructor Summary | |
---|---|
JaxRsApplication()
Creates an new JaxRsApplication. |
|
JaxRsApplication(javax.ws.rs.core.Application appConfig)
|
|
JaxRsApplication(Context context)
Creates an new JaxRsApplication. |
Method Summary | |
---|---|
boolean |
add(javax.ws.rs.core.Application appConfig)
Attaches a JAX-RS Application to this JaxRsApplication.The providers are available for all root resource classes provided to this JaxRsApplication. |
Restlet |
createInboundRoot()
|
Filter |
getGuard()
Returns the Guard |
JaxRsRestlet |
getJaxRsRestlet()
Returns the used JaxRsRestlet . |
ObjectFactory |
getObjectFactory()
Returns the ObjectFactory for root resource class and provider instantiation, if given. |
RoleChecker |
getRoleChecker()
Deprecated. Use ClientInfo.getRoles() instead |
Collection<Class<?>> |
getRootResources()
Returns an unmodifiable set with the attached root resource classes. |
Collection<String> |
getRootUris()
Returns an unmodifiable set of supported URIs (relative to this Application). |
void |
setApplications(Collection<javax.ws.rs.core.Application> apps)
Adds the given applications to the available applications. |
void |
setAuthentication(Authenticator guard,
RoleChecker roleChecker)
Deprecated. Use ClientInfo.getRoles() instead |
void |
setContext(Context context)
|
void |
setGuard(Authenticator guard)
Set the Guard from the org.restlet.security package. |
void |
setGuard(Guard guard)
Deprecated. Use the setGuard(Authenticator) method instead. |
void |
setObjectFactory(ObjectFactory objectFactory)
Sets the ObjectFactory for root resource class and provider instantiation. |
void |
setRoleChecker(RoleChecker roleChecker)
Deprecated. Use ClientInfo.getRoles() instead |
Methods inherited from class org.restlet.Restlet |
---|
finalize, getApplication, getAuthor, getContext, getDescription, getLogger, getName, getOwner, isStarted, isStopped, setAuthor, setDescription, setName, setOwner |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JaxRsApplication()
JaxRsApplication(Context)
public JaxRsApplication(Context context)
Application
s by
using add(Application)
.
context
- The application's dedicated context based on the protected
parent component's context.public JaxRsApplication(javax.ws.rs.core.Application appConfig) throws IllegalArgumentException
appConfig
-
IllegalArgumentException
Method Detail |
---|
public boolean add(javax.ws.rs.core.Application appConfig) throws IllegalArgumentException
Attaches a JAX-RS Application
to this JaxRsApplication.
The providers are available for all root resource classes provided to
this JaxRsApplication. If you won't mix them, instantiate another
JaxRsApplication.
appConfig
- Contains the classes to load as root resource classes and as
providers. Invalid root resource classes and provider classes
are ignored, according to JAX-RS specification.
IllegalArgumentException
- if the given appConfig is null.public Restlet createInboundRoot()
createInboundRoot
in class Application
public Filter getGuard()
public JaxRsRestlet getJaxRsRestlet()
JaxRsRestlet
.
JaxRsRestlet
.public ObjectFactory getObjectFactory()
@Deprecated public RoleChecker getRoleChecker()
ClientInfo.getRoles()
instead
public Collection<Class<?>> getRootResources()
public Collection<String> getRootUris()
public void setApplications(Collection<javax.ws.rs.core.Application> apps)
apps
- @Deprecated public void setAuthentication(Authenticator guard, RoleChecker roleChecker)
ClientInfo.getRoles()
instead
Authenticator
checks the username and password (e.g.), the RoleChecker
manages
the role management for the JAX-RS extension.
guard
- the Guard to use.roleChecker
- the RoleChecker to usesetGuard(Authenticator)
,
setRoleChecker(RoleChecker)
public void setContext(Context context)
setContext
in class Application
@Deprecated public void setGuard(Guard guard)
setGuard(Authenticator)
method instead.
Authenticator
to use. It should typically use the
Context
of this application.Application.createRoot()
.
This replaced the guard set via
setGuard(org.restlet.security.Authenticator)
.
guard
- the Guard to use.setAuthentication(Authenticator, RoleChecker)
,
setGuard(org.restlet.security.Authenticator)
public void setGuard(Authenticator guard)
This replaced the guard set via
setGuard(org.restlet.security.Guard)
.
guard
- the Guard to use.public void setObjectFactory(ObjectFactory objectFactory)
objectFactory
- the ObjectFactory for root resource class and provider
instantiation.@Deprecated public void setRoleChecker(RoleChecker roleChecker)
ClientInfo.getRoles()
instead
RoleChecker
to use.
roleChecker
- setAuthentication(Authenticator, RoleChecker)
,
setGuard(Authenticator)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |