org.jboss.weld.injection.spi
Interface ResourceInjectionServices

All Superinterfaces:
Service
All Known Implementing Classes:
AbstractResourceServices, ForwardingResourceInjectionServices

public interface ResourceInjectionServices
extends Service

A container should implement this interface to allow the Weld to resolve Resources ResourceInjectionServices is per-module service.

Author:
Pete Muir, Jozef Hartinger

Method Summary
 ResourceReferenceFactory<Object> registerResourceInjectionPoint(javax.enterprise.inject.spi.InjectionPoint injectionPoint)
          Register a resource injection point.
 ResourceReferenceFactory<Object> registerResourceInjectionPoint(String jndiName, String mappedName)
          Register a resource injection point with the given JNDI name and mapped name.
 Object resolveResource(javax.enterprise.inject.spi.InjectionPoint injectionPoint)
          Deprecated. Instead of calling this method at runtime, Weld should register every resource injection point at bootstrap using registerResourceInjectionPoint(InjectionPoint) and use the returned factory for producing injectable instances at runtime.
 Object resolveResource(String jndiName, String mappedName)
          Deprecated. Instead of calling this method at runtime, Weld should register every resource injection point at bootstrap using registerResourceInjectionPoint(String, String) and use the returned factory for producing injectable instances at runtime.
 
Methods inherited from interface org.jboss.weld.bootstrap.api.Service
cleanup
 

Method Detail

registerResourceInjectionPoint

ResourceReferenceFactory<Object> registerResourceInjectionPoint(javax.enterprise.inject.spi.InjectionPoint injectionPoint)
Register a resource injection point. The implementation validates the injection point. If the validation passes, an instance of ResourceReferenceFactory is returned which may be used at runtime for creating instances of the resource.

Parameters:
injectionPoint - the injection point metadata
Returns:
an instance of the resource
Throws:
IllegalArgumentException - if the injection point is not annotated with @Resource, or, if the injection point is a method that doesn't follow JavaBean conventions
IllegalStateException - if no resource can be resolved

registerResourceInjectionPoint

ResourceReferenceFactory<Object> registerResourceInjectionPoint(String jndiName,
                                                                String mappedName)
Register a resource injection point with the given JNDI name and mapped name. The implementation validates the injection point. If the validation passes, an instance of ResourceReferenceFactory is returned which may be used at runtime for creating instances of the resource.

Parameters:
injectionPoint - the injection point metadata
Returns:
an instance of the resource
Throws:
IllegalStateException - if no resource can be resolved
IllegalArgumentException - if both jndiName and mappedName are null

resolveResource

@Deprecated
Object resolveResource(javax.enterprise.inject.spi.InjectionPoint injectionPoint)
Deprecated. Instead of calling this method at runtime, Weld should register every resource injection point at bootstrap using registerResourceInjectionPoint(InjectionPoint) and use the returned factory for producing injectable instances at runtime.

Resolve the value for the given @Resource injection point

Parameters:
injectionPoint - the injection point metadata
Returns:
an instance of the resource
Throws:
IllegalArgumentException - if the injection point is not annotated with @Resource, or, if the injection point is a method that doesn't follow JavaBean conventions
IllegalStateException - if no resource can be resolved for injection

resolveResource

@Deprecated
Object resolveResource(String jndiName,
                                  String mappedName)
Deprecated. Instead of calling this method at runtime, Weld should register every resource injection point at bootstrap using registerResourceInjectionPoint(String, String) and use the returned factory for producing injectable instances at runtime.

Resolve the value for the given JNDI name and mapped name

Parameters:
injectionPoint - the injection point metadata
Returns:
an instance of the resource
Throws:
IllegalStateException - if no resource can be resolved for injection
IllegalArgumentException - if both jndiName and mappedName are null


Copyright © 2008-2012 Seam Framework. All Rights Reserved.