Package org.restlet.ext.jaxrs
Class JaxRsApplication
- java.lang.Object
-
- org.restlet.Restlet
-
- org.restlet.Application
-
- org.restlet.ext.jaxrs.JaxRsApplication
-
- All Implemented Interfaces:
Uniform
@Deprecated public class JaxRsApplication extends Application
Deprecated.Will be removed in next minor release.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).- Add your
Application(s) by callingadd(Application). - If you need authentication, set a
AuthenticatorseesetAuthenticator(Authenticator).
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.
-
-
Field Summary
Fields Modifier and Type Field Description private AuthenticatorauthenticatorDeprecated.TheAuthenticator) to use.private JaxRsRestletjaxRsRestletDeprecated.TheJaxRsRestletto use.
-
Constructor Summary
Constructors Constructor Description JaxRsApplication()Deprecated.Creates an new JaxRsApplication.JaxRsApplication(javax.ws.rs.core.Application appConfig)Deprecated.JaxRsApplication(Context context)Deprecated.Creates an new JaxRsApplication.JaxRsApplication(Context context, javax.ws.rs.core.Application appConfig)Deprecated.Creates an new JaxRsApplication.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanadd(javax.ws.rs.core.Application appConfig)Deprecated.Attaches a JAX-RSApplicationto this JaxRsApplication.
The providers are available for all root resource classes provided to this JaxRsApplication.RestletcreateInboundRoot()Deprecated.Creates a inbound root Restlet that will receive all incoming calls.AuthenticatorgetAuthenticator()Deprecated.Returns theAuthenticator.AuthenticatorgetGuard()Deprecated.UsegetAuthenticator()instead.JaxRsRestletgetJaxRsRestlet()Deprecated.Returns the usedJaxRsRestlet.ObjectFactorygetObjectFactory()Deprecated.Returns the ObjectFactory for root resource class and provider instantiation, if given.java.util.Collection<java.lang.Class<?>>getRootResources()Deprecated.Returns an unmodifiable set with the attached root resource classes.java.util.Collection<java.lang.String>getRootUris()Deprecated.Returns an unmodifiable set of supported URIs (relative to this Application).voidsetApplications(java.util.Collection<javax.ws.rs.core.Application> apps)Deprecated.Adds the given applications to the available applications.voidsetAuthenticator(Authenticator authenticator)Deprecated.Sets theAuthenticatorto use.voidsetContext(Context context)Deprecated.Sets the context.voidsetGuard(Authenticator authenticator)Deprecated.UsesetAuthenticator(Authenticator)instead.voidsetObjectFactory(ObjectFactory objectFactory)Deprecated.Sets the ObjectFactory for root resource class and provider instantiation.-
Methods inherited from class org.restlet.Application
createOutboundRoot, getConnectorService, getConnegService, getConverterService, getCurrent, getDecoderService, getEncoderService, getInboundRoot, getMetadataService, getOutboundRoot, getRangeService, getRole, getRoles, getServices, getStatusService, getTaskService, getTunnelService, handle, isDebugging, setConnectorService, setConnegService, setConverterService, setCurrent, setDebugging, setDecoderService, setEncoderService, setInboundRoot, setInboundRoot, setMetadataService, setOutboundRoot, setOutboundRoot, setRangeService, setRoles, setStatusService, setTaskService, setTunnelService, start, stop
-
Methods inherited from class org.restlet.Restlet
createFinder, finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setDescription, setFinderClass, setName, setOwner
-
-
-
-
Field Detail
-
authenticator
private volatile Authenticator authenticator
Deprecated.TheAuthenticator) to use. May be null.
-
jaxRsRestlet
private volatile JaxRsRestlet jaxRsRestlet
Deprecated.TheJaxRsRestletto use.
-
-
Constructor Detail
-
JaxRsApplication
public JaxRsApplication()
Deprecated.Creates an new JaxRsApplication.- See Also:
JaxRsApplication(Context)
-
JaxRsApplication
public JaxRsApplication(Context context)
Deprecated.Creates an new JaxRsApplication. Attach JAX-RS-Applications by usingadd(Application).- Parameters:
context- The application's dedicated context based on the protected parent component's context.
-
JaxRsApplication
public JaxRsApplication(Context context, javax.ws.rs.core.Application appConfig) throws java.lang.IllegalArgumentException
Deprecated.Creates an new JaxRsApplication. Attach JAX-RS-Applications by usingadd(Application).- Parameters:
context- The application's dedicated context based on the protected parent component's context.appConfig-- Throws:
java.lang.IllegalArgumentException
-
JaxRsApplication
public JaxRsApplication(javax.ws.rs.core.Application appConfig) throws java.lang.IllegalArgumentExceptionDeprecated.- Parameters:
appConfig-- Throws:
java.lang.IllegalArgumentException
-
-
Method Detail
-
add
public boolean add(javax.ws.rs.core.Application appConfig) throws java.lang.IllegalArgumentExceptionDeprecated.Attaches a JAX-RS
Applicationto this JaxRsApplication.
The providers are available for all root resource classes provided to this JaxRsApplication. If you won't mix them, instantiate another JaxRsApplication.- Parameters:
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.- Returns:
- true, if all resource classes and providers could be added, or false at least one could not be added. Exceptions were logged.
- Throws:
java.lang.IllegalArgumentException- if the given appConfig is null.
-
createInboundRoot
public Restlet createInboundRoot()
Deprecated.Description copied from class:ApplicationCreates a inbound root Restlet that will receive all incoming calls. In general, instances of Router, Filter or Finder classes will be used as initial application Restlet. The default implementation returns null by default. This method is intended to be overridden by subclasses.- Overrides:
createInboundRootin classApplication- Returns:
- The inbound root Restlet.
-
getAuthenticator
public Authenticator getAuthenticator()
Deprecated.Returns theAuthenticator.- Returns:
- the
Authenticator.
-
getGuard
@Deprecated public Authenticator getGuard()
Deprecated.UsegetAuthenticator()instead.Returns theAuthenticator.- Returns:
- the
Authenticator.
-
getJaxRsRestlet
public JaxRsRestlet getJaxRsRestlet()
Deprecated.Returns the usedJaxRsRestlet.- Returns:
- the used
JaxRsRestlet.
-
getObjectFactory
public ObjectFactory getObjectFactory()
Deprecated.Returns the ObjectFactory for root resource class and provider instantiation, if given.- Returns:
- the ObjectFactory for root resource class and provider instantiation, if given.
-
getRootResources
public java.util.Collection<java.lang.Class<?>> getRootResources()
Deprecated.Returns an unmodifiable set with the attached root resource classes.- Returns:
- an unmodifiable set with the attached root resource classes.
-
getRootUris
public java.util.Collection<java.lang.String> getRootUris()
Deprecated.Returns an unmodifiable set of supported URIs (relative to this Application).- Returns:
- an unmodifiable set of supported URIs (relative).
-
setApplications
public void setApplications(java.util.Collection<javax.ws.rs.core.Application> apps)
Deprecated.Adds the given applications to the available applications.- Parameters:
apps-
-
setAuthenticator
public void setAuthenticator(Authenticator authenticator)
Deprecated.Sets theAuthenticatorto use. This should be called before the root Restlet is created.This replaced the guard set via
setGuard(Authenticator).- Parameters:
authenticator- TheAuthenticatorto use.
-
setContext
public void setContext(Context context)
Deprecated.Description copied from class:RestletSets the context.- Overrides:
setContextin classApplication- Parameters:
context- The context.
-
setGuard
@Deprecated public void setGuard(Authenticator authenticator)
Deprecated.UsesetAuthenticator(Authenticator)instead.Sets theAuthenticatorto use. This should be called before the root Restlet is created.This replaced the guard set via
setGuard(Authenticator).- Parameters:
authenticator- TheAuthenticatorto use.
-
setObjectFactory
public void setObjectFactory(ObjectFactory objectFactory)
Deprecated.Sets the ObjectFactory for root resource class and provider instantiation.- Parameters:
objectFactory- the ObjectFactory for root resource class and provider instantiation.
-
-