org.jboss.resteasy.test.application
Class MyApplication

java.lang.Object
  extended by javax.ws.rs.core.Application
      extended by org.jboss.resteasy.test.application.MyApplication

public class MyApplication
extends Application

This is for RESTEASY-381

Version:
$Revision: 1 $
Author:
Bill Burke

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

Field Detail

num_instantiations

public static int num_instantiations

singletons

protected java.util.Set<java.lang.Object> singletons
Constructor Detail

MyApplication

public MyApplication()
Method Detail

getClasses

public java.util.Set<java.lang.Class<?>> getClasses()
Description copied from class: Application
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 Application.getSingletons() returns an instance. Implementations MUST NOT modify the returned set.

The default implementation returns an empty set.

Overrides:
getClasses in class Application
Returns:
a set of root resource and provider classes. Returning null is equivalent to returning an empty set.

getSingletons

public java.util.Set<java.lang.Object> getSingletons()
Description copied from class: Application
Get a set of root resource and provider 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.

Overrides:
getSingletons in class Application
Returns:
a set of root resource and provider instances. Returning null is equivalent to returning an empty set.


Copyright © 2010. All Rights Reserved.