org.jboss.wsf.common.injection
Class InjectionHelper

java.lang.Object
  extended by org.jboss.wsf.common.injection.InjectionHelper

public final class InjectionHelper
extends java.lang.Object

An injection helper class for javax.* annotations.

Author:
Richard Opalka

Method Summary
static void callPostConstructMethod(java.lang.Object instance)
          Calls @PostConstruct annotated method if exists.
static void callPreDestroyMethod(java.lang.Object instance)
          Calls @PreDestroy annotated method if exists.
static void injectResources(java.lang.Object instance, org.jboss.wsf.spi.metadata.injection.InjectionsMetaData injections)
          The resource annotations mark resources that are needed by the application.
static void injectWebServiceContext(java.lang.Object instance, javax.xml.ws.WebServiceContext ctx)
          Injects @Resource annotated accessible objects referencing WebServiceContext.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

injectResources

public static void injectResources(java.lang.Object instance,
                                   org.jboss.wsf.spi.metadata.injection.InjectionsMetaData injections)
The resource annotations mark resources that are needed by the application. These annotations may be applied to an application component class, or to fields or methods of the component class. When the annotation is applied to a field or method, the container will inject an instance of the requested resource into the application component when the component is initialized. If the annotation is applied to the component class, the annotation declares a resource that the application will look up at runtime. This method handles the following injection types:

Parameters:
instance - to inject resources on
injections - injection metadata
See Also:
InjectionsMetaData, Resource, EJB

injectWebServiceContext

public static void injectWebServiceContext(java.lang.Object instance,
                                           javax.xml.ws.WebServiceContext ctx)
Injects @Resource annotated accessible objects referencing WebServiceContext.

Parameters:
instance - to operate on
ctx - current web service context

callPostConstructMethod

public static void callPostConstructMethod(java.lang.Object instance)
Calls @PostConstruct annotated method if exists.

Parameters:
instance - to invoke @PostConstruct annotated method on
See Also:
PostConstructMethodFinder, PostConstruct

callPreDestroyMethod

public static void callPreDestroyMethod(java.lang.Object instance)
Calls @PreDestroy annotated method if exists.

Parameters:
instance - to invoke @PreDestroy annotated method on
See Also:
PreDestroyMethodFinder, PreDestroy


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.