org.glassfish.examples.http
Class AlternateInjectResolver

java.lang.Object
  extended by org.glassfish.examples.http.AlternateInjectResolver
All Implemented Interfaces:
InjectionResolver<AlternateInject>

@Singleton
public class AlternateInjectResolver
extends Object
implements InjectionResolver<AlternateInject>

Author:
jwells

Field Summary
 
Fields inherited from interface org.glassfish.hk2.api.InjectionResolver
SYSTEM_RESOLVER_NAME
 
Constructor Summary
AlternateInjectResolver()
           
 
Method Summary
 boolean isConstructorParameterIndicator()
          This method should return true if the annotation that indicates that this is an injection point can appear in the parameter list of a constructor.
 boolean isMethodParameterIndicator()
          This method should return true if the annotation that indicates that this is an injection point can appear in the parameter list of a method.
 Object resolve(Injectee injectee, ServiceHandle<?> root)
          This method will return the object that should be injected into the given injection point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlternateInjectResolver

public AlternateInjectResolver()
Method Detail

resolve

public Object resolve(Injectee injectee,
                      ServiceHandle<?> root)
Description copied from interface: InjectionResolver
This method will return the object that should be injected into the given injection point. It is the responsiblity of the implementation to ensure that the object returned can be safely injected into the injection point.

This method should not do the injection themselves

Specified by:
resolve in interface InjectionResolver<AlternateInject>
Parameters:
injectee - The injection point this value is being injected into
root - The service handle of the root class being created, which should be used in order to ensure proper destruction of associated &64;PerLookup scoped objects. This can be null in the case that this is being used for an object not managed by HK2. This will only happen if this object is being created with the create method of ServiceLocator.
Returns:
A possibly null value to be injected into the given injection point

isConstructorParameterIndicator

public boolean isConstructorParameterIndicator()
Description copied from interface: InjectionResolver
This method should return true if the annotation that indicates that this is an injection point can appear in the parameter list of a constructor.

Specified by:
isConstructorParameterIndicator in interface InjectionResolver<AlternateInject>
Returns:
true if the injection annotation can appear in the parameter list of a constructor

isMethodParameterIndicator

public boolean isMethodParameterIndicator()
Description copied from interface: InjectionResolver
This method should return true if the annotation that indicates that this is an injection point can appear in the parameter list of a method.

Specified by:
isMethodParameterIndicator in interface InjectionResolver<AlternateInject>
Returns:
true if the injection annotation can appear in the parameter list of a method


Copyright © 2013 Oracle Corporation. All Rights Reserved.