Top Description Fields Constructors Methods
org.mortbay.jetty.annotations

public Class AnnotationProcessor

extends Object
Class Inheritance
Imports
java.lang.reflect.Field, .Method, .Modifier, java.util.ArrayList, .HashMap, .List, .Map, javax.annotation.PostConstruct, .PreDestroy, .Resource, .Resources, javax.annotation.security.RunAs, javax.naming.InitialContext, .NameNotFoundException, .NamingException, javax.servlet.DispatcherType, javax.servlet.http.annotation.InitParam, javax.servlet.http.annotation.jaxrs.DELETE, .GET, .HEAD, .POST, .PUT, org.mortbay.jetty.Handler, .Dispatcher, org.mortbay.jetty.plus.annotation.Injection, .InjectionCollection, .LifeCycleCallbackCollection, .PojoContextListener, .PojoFilter, .PojoServlet, .PostConstructCallback, .PreDestroyCallback, .RunAsCollection, org.mortbay.jetty.servlet.FilterHolder, .FilterMapping, .ServletHolder, .ServletMapping, org.mortbay.jetty.webapp.WebAppContext, org.mortbay.log.Log, org.mortbay.util.IntrospectionUtil, .LazyList

AnnotationProcessor Act on the annotations discovered in the webapp.

Field Summary

Modifier and TypeField and Description
private static Class<T>[]
pack-priv LifeCycleCallbackCollection
pack-priv List<E>
pack-priv List<E>
pack-priv AnnotationFinder
pack-priv InjectionCollection
pack-priv List<E>
pack-priv ClassLoader
pack-priv Map<K, V>
pack-priv RunAsCollection
pack-priv List<E>
pack-priv List<E>
pack-priv WebAppContext

Constructor Summary

AccessConstructor and Description
public
AnnotationProcessor(WebAppContext webApp, AnnotationFinder finder, RunAsCollection runAs, InjectionCollection injections, LifeCycleCallbackCollection callbacks, List<E> servlets, List<E> filters, List<E> listeners, List<E> servletMappings, List<E> filterMappings)

Method Summary

Modifier and TypeMethod and Description
public List<E>
public List<E>
public List<E>
private Object
getPojoInstanceFor(Class<T> clazz)

Get an already-created instance of a pojo, or create one otherwise.

public List<E>
public List<E>
private static boolean
private boolean
isServletType(Class<T> c)

Check if the presented method belongs to a class that is one of the classes with which a servlet container should be concerned.

protected static String
public void
public void
processClassResourceAnnotations()

Class level Resource annotations declare a name in the environment that will be looked up at runtime.

public void
processFieldResourceAnnotations()

Process @Resource annotation for a Field.

public void
public void
public void
public void
processMethodResourceAnnotations()

Process a Resource annotation on the Methods.

private void
public void
public void
public void
processResourcesAnnotations()

Process @Resources annotation on classes

public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

__envEntryTypesback to summary
private static Class<T>[] __envEntryTypes
_callbacksback to summary
pack-priv LifeCycleCallbackCollection _callbacks
_filterMappingsback to summary
pack-priv List<E> _filterMappings
_filtersback to summary
pack-priv List<E> _filters
_finderback to summary
pack-priv AnnotationFinder _finder
_injectionsback to summary
pack-priv InjectionCollection _injections
_listenersback to summary
pack-priv List<E> _listeners
_loaderback to summary
pack-priv ClassLoader _loader
_pojoInstancesback to summary
pack-priv Map<K, V> _pojoInstances
_runAsback to summary
pack-priv RunAsCollection _runAs
_servletMappingsback to summary
pack-priv List<E> _servletMappings
_servletsback to summary
pack-priv List<E> _servlets
_webAppback to summary
pack-priv WebAppContext _webApp

Constructor Detail

AnnotationProcessorback to summary
public AnnotationProcessor(WebAppContext webApp, AnnotationFinder finder, RunAsCollection runAs, InjectionCollection injections, LifeCycleCallbackCollection callbacks, List<E> servlets, List<E> filters, List<E> listeners, List<E> servletMappings, List<E> filterMappings)

Method Detail

getFilterMappingsback to summary
public List<E> getFilterMappings()
getFiltersback to summary
public List<E> getFilters()
getListenersback to summary
public List<E> getListeners()
getPojoInstanceForback to summary
private Object getPojoInstanceFor(Class<T> clazz) throws InstantiationException, IllegalAccessException

Get an already-created instance of a pojo, or create one otherwise.

getServletMappingsback to summary
public List<E> getServletMappings()
getServletsback to summary
public List<E> getServlets()
isEnvEntryTypeback to summary
private static boolean isEnvEntryType(Class<T> type)
isServletTypeback to summary
private boolean isServletType(Class<T> c)

Check if the presented method belongs to a class that is one of the classes with which a servlet container should be concerned.

normalizePatternback to summary
protected static String normalizePattern(String p)
processback to summary
public void process() throws Exception
processClassResourceAnnotationsback to summary
public void processClassResourceAnnotations() throws Exception

Class level Resource annotations declare a name in the environment that will be looked up at runtime. They do not specify an injection.

processFieldResourceAnnotationsback to summary
public void processFieldResourceAnnotations() throws Exception

Process @Resource annotation for a Field. These will both set up a JNDI entry and generate an Injection. Or they can be the equivalent of env-entries with default values

processFiltersback to summary
public void processFilters() throws Exception
processLifeCycleCallbackAnnotationsback to summary
public void processLifeCycleCallbackAnnotations() throws Exception
processListenersback to summary
public void processListeners() throws Exception
processMethodResourceAnnotationsback to summary
public void processMethodResourceAnnotations() throws Exception

Process a Resource annotation on the Methods. This will generate a JNDI entry, and an Injection to be processed when an instance of the class is created.

processPostConstructAnnotationsback to summary
private void processPostConstructAnnotations() throws Exception
processPreDestroyAnnotationsback to summary
public void processPreDestroyAnnotations() throws Exception
processResourceAnnotationsback to summary
public void processResourceAnnotations() throws Exception
processResourcesAnnotationsback to summary
public void processResourcesAnnotations() throws Exception

Process @Resources annotation on classes

processRunAsAnnotationsback to summary
public void processRunAsAnnotations() throws Exception
processServletsback to summary
public void processServlets() throws Exception