org.apache.myfaces.config.annotation
Class Tomcat7AnnotationLifecycleProvider

java.lang.Object
  extended by org.apache.myfaces.config.annotation.Tomcat7AnnotationLifecycleProvider
All Implemented Interfaces:
DiscoverableLifecycleProvider, LifecycleProvider, LifecycleProvider2

public class Tomcat7AnnotationLifecycleProvider
extends Object
implements DiscoverableLifecycleProvider, LifecycleProvider2

An annotation lifecycle provider for Tomcat 7.


Constructor Summary
Tomcat7AnnotationLifecycleProvider(ExternalContext externalContext)
           
 
Method Summary
 void destroyInstance(Object instance)
          Take whatever steps are needed to shut down the object, including calling a preDestroy method.
 boolean isAvailable()
           
 Object newInstance(String className)
          Create an object of the class with the supplied name, inject dependencies as appropriate, and call a postContruct method as appropriate.
 void postConstruct(Object instance)
          Call a postConstruct method as appropriate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tomcat7AnnotationLifecycleProvider

public Tomcat7AnnotationLifecycleProvider(ExternalContext externalContext)
Method Detail

newInstance

public Object newInstance(String className)
                   throws ClassNotFoundException,
                          IllegalAccessException,
                          InstantiationException,
                          NamingException,
                          InvocationTargetException
Description copied from interface: LifecycleProvider
Create an object of the class with the supplied name, inject dependencies as appropriate, and call a postContruct method as appropriate.

Specified by:
newInstance in interface LifecycleProvider
Specified by:
newInstance in interface LifecycleProvider2
Parameters:
className - name of the class of the desired object
Returns:
a fully constructed, dependency-injected, and initialized object.
Throws:
ClassNotFoundException
IllegalAccessException
InstantiationException
NamingException
InvocationTargetException

destroyInstance

public void destroyInstance(Object instance)
                     throws IllegalAccessException,
                            InvocationTargetException
Description copied from interface: LifecycleProvider
Take whatever steps are needed to shut down the object, including calling a preDestroy method.

Specified by:
destroyInstance in interface LifecycleProvider
Parameters:
instance - object to shut down.
Throws:
IllegalAccessException
InvocationTargetException

postConstruct

public void postConstruct(Object instance)
                   throws IllegalAccessException,
                          InvocationTargetException
Description copied from interface: LifecycleProvider2
Call a postConstruct method as appropriate.

Specified by:
postConstruct in interface LifecycleProvider2
Parameters:
instance - object to initialize
Throws:
IllegalAccessException
InvocationTargetException

isAvailable

public boolean isAvailable()
Specified by:
isAvailable in interface DiscoverableLifecycleProvider


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.