com.sun.jersey.spi.inject
Class SingletonTypeInjectableProvider<A extends java.lang.annotation.Annotation,T>

java.lang.Object
  extended by com.sun.jersey.spi.inject.SingletonTypeInjectableProvider<A,T>
Type Parameters:
A - the annotation type
T - the type returned by Injectable.getValue()
All Implemented Interfaces:
Injectable<T>, InjectableProvider<A,java.lang.reflect.Type>
Direct Known Subclasses:
ServletContainer.ContextInjectableProvider, WebComponent.ContextInjectableProvider

public abstract class SingletonTypeInjectableProvider<A extends java.lang.annotation.Annotation,T>
extends java.lang.Object
implements InjectableProvider<A,java.lang.reflect.Type>, Injectable<T>

A utility class that may implemented to support a singleton injectable provider for a specific type T, and an instance of type T, that is to be injected.

Author:
Paul.Sandoz@Sun.Com

Constructor Summary
SingletonTypeInjectableProvider(java.lang.reflect.Type t, T instance)
          Construct a new instance with the Type and the instance.
 
Method Summary
 Injectable<T> getInjectable(ComponentContext ic, A a, java.lang.reflect.Type c)
          Get an injectable.
 ComponentScope getScope()
          Get the scope of the injectable provider.
 T getValue()
          Get the injectable value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingletonTypeInjectableProvider

public SingletonTypeInjectableProvider(java.lang.reflect.Type t,
                                       T instance)
Construct a new instance with the Type and the instance.

Parameters:
t - the type of T.
instance - the instance.
Method Detail

getScope

public final ComponentScope getScope()
Description copied from interface: InjectableProvider
Get the scope of the injectable provider.

Specified by:
getScope in interface InjectableProvider<A extends java.lang.annotation.Annotation,java.lang.reflect.Type>
Returns:
the scope.

getInjectable

public final Injectable<T> getInjectable(ComponentContext ic,
                                         A a,
                                         java.lang.reflect.Type c)
Description copied from interface: InjectableProvider
Get an injectable.

Specified by:
getInjectable in interface InjectableProvider<A extends java.lang.annotation.Annotation,java.lang.reflect.Type>
Parameters:
ic - the injectable context
a - the annotation instance
c - the context instance
Returns:
an Injectable instance, otherwise null if an instance cannot be created.

getValue

public final T getValue()
Description copied from interface: Injectable
Get the injectable value.

Specified by:
getValue in interface Injectable<T>
Returns:
the injectable value


Copyright © 2012 Oracle Corporation. All Rights Reserved.