javax.ws.rs.core
Class Application

java.lang.Object
  extended by javax.ws.rs.core.Application
Direct Known Subclasses:
ChatApplication, CustomerApplication, DataApplication, EJBApplication, JaxRsActivator, JaxRsActivator, JaxRsActivator, JaxRsActivator, JaxRsActivator, JaxRsActivator, JaxRsActivator, JaxRsActivator, JaxRsActivator, MyApp, MyApplication, OrdersApplication, SkeletonKeyApplication, TestApplication

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.

Since:
1.0
Author:
Paul Sandoz, Marc Hadley

Constructor Summary
Application()
           
 
Method Summary
 Set<Class<?>> getClasses()
          Get a set of root resource, provider and feature classes.
 Set<Object> getSingletons()
          Get a set of root resource, provider and feature instances.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Application

public Application()
Method Detail

getClasses

public Set<Class<?>> getClasses()
Get a set of root resource, provider and feature 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 and feature instances. Fields and properties of returned instances are injected with their declared dependencies (see Context) 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.


Copyright © 2013. All Rights Reserved.