org.apache.webbeans.spi
Interface ResourceInjectionService


public interface ResourceInjectionService

This service is responsible for injecting the Java EE injectable resources. Please see the Section 5 of the Java EE specification.


Method Summary
 void clear()
          Any clear functionality.
<X,T extends Annotation>
X
getResourceReference(ResourceReference<X,T> resourceReference)
          Gets resource for the given resource reference.
 void injectJavaEEResources(Object managedBeanInstance)
          Container where OWB is deployed must responsible for injecting Java EE resources defined by this managed bean.
<T> T
readExternal(javax.enterprise.inject.spi.Bean<T> bean, ObjectInput out)
          delegation of serialization behavior
<T> void
writeExternal(javax.enterprise.inject.spi.Bean<T> bean, T actualResource, ObjectOutput out)
          delegation of serialization behavior
 

Method Detail

injectJavaEEResources

void injectJavaEEResources(Object managedBeanInstance)
Container where OWB is deployed must responsible for injecting Java EE resources defined by this managed bean. This includes, field and method injections. How to inject those resources are defined by Java EE specification.

This is only used for ManagedBean classes. It is not for injection Session Beans or any other Java EE components. Because those are already injected by the related container, for example EJB Container, Web Container etc.

Parameters:
managedBeanInstance - managed bean instance

getResourceReference

<X,T extends Annotation> X getResourceReference(ResourceReference<X,T> resourceReference)
Gets resource for the given resource reference.

This method is used for getting individual resource references that are defined by the ManagedBean producer fields. For example;

@Produces @MyPersistenceContext PersistenceContext EntityManager manager;

See section 3.5 of the JSR-299 specification.

Type Parameters:
T - resource type, @EJB, @Resource, @WebServiceRef, @PersistenceContext or @PersistenceUnit
Parameters:
resourceReference -
Returns:
resource for the given resource reference

clear

void clear()
Any clear functionality.

This is called by the container at shutdown. Services may clear its caches or any other useful functionality.


writeExternal

<T> void writeExternal(javax.enterprise.inject.spi.Bean<T> bean,
                       T actualResource,
                       ObjectOutput out)
                   throws IOException
delegation of serialization behavior

Throws:
IOException

readExternal

<T> T readExternal(javax.enterprise.inject.spi.Bean<T> bean,
                   ObjectInput out)
               throws IOException,
                      ClassNotFoundException
delegation of serialization behavior

Throws:
IOException
ClassNotFoundException


Copyright © 2008-2012 The Apache Software Foundation. All Rights Reserved.