- 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
-
-
Deutsche Übersetzung
Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.
Vielen Dank im Voraus.
Dokument erstellt 11/06/2005, zuletzt geändert 18/08/2025
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-javaee-rf-javax/ws/rs/core/application.html
Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.
Referenzen
Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor dieser Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.