com.sun.ws.rest.spi.resource
Class ResourceProviderFactory

java.lang.Object
  extended by com.sun.ws.rest.spi.resource.ResourceProviderFactory

public class ResourceProviderFactory
extends java.lang.Object

A singleton that manages access to resource provider instances.


Constructor Summary
ResourceProviderFactory()
           
 
Method Summary
 ResourceProvider createProvider(ComponentProvider provider, AbstractResource resource, java.util.Map<java.lang.String,java.lang.Boolean> resourceFeatures, java.util.Map<java.lang.String,java.lang.Object> resourceProperties)
          Obtain a ResourceProvider instance for the supplied resourceClass.
static ResourceProviderFactory getInstance()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceProviderFactory

public ResourceProviderFactory()
Method Detail

getInstance

public static ResourceProviderFactory getInstance()

createProvider

public ResourceProvider createProvider(ComponentProvider provider,
                                       AbstractResource resource,
                                       java.util.Map<java.lang.String,java.lang.Boolean> resourceFeatures,
                                       java.util.Map<java.lang.String,java.lang.Object> resourceProperties)
Obtain a ResourceProvider instance for the supplied resourceClass.

This method will first search for a class that implements ResourceProvider that is declared as an annotation on resourceClass. If not found the the ResourceProvider class will be looked up in the resourceProperties using the property name "com.sun.ws.rest.config.property.DefaultResourceProviderClass". If there is no such property then the per-request resource provider will be chosen.

Parameters:
provider - the component provider
resource - the abstract resource for the provider.
resourceFeatures - the resource features
resourceProperties - the resource properties
Returns:
the resource provider.
Throws:
java.lang.IllegalArgumentException - if the Java type of resource provider property is not Class.