- java.lang.Object
-
- javax.ws.rs.core.Application
-
public class Application extends Object
Defines the components of a JAX-RS application and supplies additional meta-data. A JAX-RS application or implementation supplies a concrete subclass of this abstract class.The implementation-created instance of an Application subclass may be injected into resource classes and providers using
Context
.In case any of the
Application
subclass methods or it's constructor throws aRuntimeException
, the deployment of the application SHOULD be aborted with a failure.- Since:
- 1.0
- Author:
- Paul Sandoz, Marc Hadley, Marek Potociar
-
-
Constructor Summary
Constructors Constructor and Description Application()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Set<Class<?>>
getClasses()
Get a set of root resource, provider andfeature
classes.Map<String,Object>
getProperties()
Get a map of custom application-wide properties.Set<Object>
getSingletons()
Get a set of root resource, provider andfeature
instances.
-
-
-
Method Detail
-
getClasses
public Set<Class<?>> getClasses()
Get a set of root resource, provider andfeature
classes. The default life-cycle for resource class instances is per-request. The default life-cycle for providers (registered directly or via a feature) is singleton.Implementations should warn about and ignore classes that do not conform to the requirements of root resource or provider/feature classes. Implementations should warn about and ignore classes for which
getSingletons()
returns an instance. Implementations MUST NOT modify the returned set.The default implementation returns an empty set.
- Returns:
- a set of root resource and provider classes. Returning
null
is equivalent to returning an empty set.
-
getSingletons
public Set<Object> getSingletons()
Get a set of root resource, provider andfeature
instances. Fields and properties of returned instances are injected with their declared dependencies (seeContext
) by the runtime prior to use.Implementations should warn about and ignore classes that do not conform to the requirements of root resource or provider classes. Implementations should flag an error if the returned set includes more than one instance of the same class. Implementations MUST NOT modify the returned set.
The default implementation returns an empty set.
- Returns:
- a set of root resource and provider instances. Returning
null
is equivalent to returning an empty set.
-
getProperties
public Map<String,Object> getProperties()
Get a map of custom application-wide properties.The returned properties are reflected in the application
configuration
passed to the server-side features or injected into server-side JAX-RS components.The set of returned properties may be further extended or customized at deployment time using container-specific features and deployment descriptors. For example, in a Servlet-based deployment scenario, web application's
<context-param>
and Servlet<init-param>
values may be used to extend or override values of the properties programmatically returned by this method.The default implementation returns an empty set.
- Returns:
- a map of custom application-wide properties. Returning
null
is equivalent to returning an empty set. - Since:
- 2.0
-
-
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 11/06/2005 gemaakt, de laatste keer de 18/08/2025 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-javaee-rf-javax/ws/rs/core/application.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur van deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.