Class Application
The implementation-created instance of an Application subclass may be
injected into resource classes and providers using
Context
.
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet a set of root resource and provider classes.Get a set of root resource and provider instances.
-
Field Details
-
emptyObjectSet
-
emptyClassSet
-
-
Constructor Details
-
Application
public Application()
-
-
Method Details
-
getClasses
Get a set of root resource and provider classes. The default lifecycle for resource class instances is per-request. The default lifecycle for providers is singleton.Implementations should warn about and ignore classes that do not conform to the requirements of root resource or provider 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
Get a set of root resource and provider 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.
-