class PersistenceUnitHandler extends JndiHandler implements RuntimeAnnotationHandler
RuntimeAnnotationHandler
responsible for processing
PersistenceUnit
annotations.Modifier and Type | Field and Description |
---|---|
private javax.persistence.PersistenceUnit[] |
fieldAnnotations |
private java.lang.reflect.Field[] |
fields |
private javax.persistence.PersistenceUnit[] |
methodAnnotations |
private java.lang.reflect.Method[] |
methods |
JAVA_COMP_ENV
Constructor and Description |
---|
PersistenceUnitHandler(java.lang.reflect.Method[] methods,
javax.persistence.PersistenceUnit[] methodAnnotations,
java.lang.reflect.Field[] fields,
javax.persistence.PersistenceUnit[] fieldAnnotations) |
Modifier and Type | Method and Description |
---|---|
void |
apply(javax.faces.context.FacesContext ctx,
java.lang.Object... params)
Apply the
Annotation (s). |
private void |
applyToField(javax.faces.context.FacesContext facesContext,
java.lang.reflect.Field field,
javax.persistence.PersistenceUnit unit,
java.lang.Object instance) |
private void |
applyToMethod(javax.faces.context.FacesContext facesContext,
java.lang.reflect.Method method,
javax.persistence.PersistenceUnit unit,
java.lang.Object instance) |
invokeMethod, lookup, setField
private java.lang.reflect.Method[] methods
private javax.persistence.PersistenceUnit[] methodAnnotations
private java.lang.reflect.Field[] fields
private javax.persistence.PersistenceUnit[] fieldAnnotations
public PersistenceUnitHandler(java.lang.reflect.Method[] methods, javax.persistence.PersistenceUnit[] methodAnnotations, java.lang.reflect.Field[] fields, javax.persistence.PersistenceUnit[] fieldAnnotations)
public void apply(javax.faces.context.FacesContext ctx, java.lang.Object... params)
RuntimeAnnotationHandler
Apply the Annotation
(s). The act
of doing so should affect the JSF runtime in some fashion (see the spec
for the specific annotation types).
NOTE: when adding new types of components that can be annotated,
the fact that we expose varargs here should be hidden. Type-safe methods
should be added to AnnotationManager
to clarify the contract.
apply
in interface RuntimeAnnotationHandler
ctx
- the FacesContext
for the current
requestparams
- one or more arguments to the handler instance. The type
and number may vary.private void applyToMethod(javax.faces.context.FacesContext facesContext, java.lang.reflect.Method method, javax.persistence.PersistenceUnit unit, java.lang.Object instance)
private void applyToField(javax.faces.context.FacesContext facesContext, java.lang.reflect.Field field, javax.persistence.PersistenceUnit unit, java.lang.Object instance)
Copyright © 2002-2013 Oracle America, Inc. All Rights Reserved.