|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectBeanContextChildSupport
BeanContextSupport
BeanContextServicesSupport
ControlBeanContext
public class ControlBeanContext
The ControlBeanContext implements the basic BeanContextServices implementation for ControlBeans. It provides several basic functions: - it defines the generic services that are available for all control containers - it acts as the base class for other container service implementations - it acts as the BeanContextServicesRevokedListener when an associated control bean has lost access to services.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class BeanContextServicesSupport |
---|
BeanContextServicesSupport.BCSSChild, BeanContextServicesSupport.BCSSProxyServiceProvider, BeanContextServicesSupport.BCSSServiceProvider |
Nested classes/interfaces inherited from class BeanContextSupport |
---|
BeanContextSupport.BCSChild, BeanContextSupport.BCSIterator |
Nested classes/interfaces inherited from interface ControlBeanContext |
---|
ControlBeanContext.LifeCycle |
Field Summary | |
---|---|
static String |
INTERCEPTOR_CONFIG_FILE
Filename that contains ordering priority for controls interceptor services. |
Fields inherited from class BeanContextServicesSupport |
---|
bcsListeners, proxy, serializable, services |
Fields inherited from class BeanContextSupport |
---|
bcmListeners, children, designTime, locale, okToUseGui |
Fields inherited from class BeanContextChildSupport |
---|
beanContext, beanContextChildPeer, pcSupport, rejectedSetBCOnce, vcSupport |
Fields inherited from interface BeanContext |
---|
globalHierarchyLock |
Fields inherited from interface DesignMode |
---|
PROPERTYNAME |
Constructor Summary | |
---|---|
protected |
ControlBeanContext(ControlBean bean)
Creates a new ControlBeanContext instance associated with a specific control bean. |
Method Summary | ||
---|---|---|
boolean |
add(Object targetChild)
Overrides the BeanContextSupport.add() method to perform additional validation that is unique for ControlBeans containers. |
|
void |
addLifeCycleListener(ControlBeanContext.LifeCycle listener)
Registers a new listener for LifeCycle events on the context. |
|
String |
generateUniqueID(Class clazz)
Generates a new unique control ID for an instance of the target class |
|
PropertyMap |
getAnnotationMap(AnnotatedElement annotElem)
Returns the PropertyMap containing default properties for an AnnotatedElement in the current context. |
|
ControlBean |
getBean(String id)
Returns a ControlBean instance nested the current BeanContext. |
|
protected PropertyMap |
getBeanAnnotationMap(ControlBean bean,
AnnotatedElement annotElem)
The default implementation of getBeanAnnotationMap. |
|
ClassLoader |
getClassLoader()
Returns the ClassLoader used to load the ControlBean class associated with the control implementation instance. |
|
ControlBean |
getControlBean()
Returns the ControlBean associated directly with the ControlBeanContext. |
|
ControlHandle |
getControlHandle()
Returns a ControlHandle instance that enables operations and events to be dispatched to the target control, if it is running inside of a container that supports external event dispatch. |
|
Class |
getControlInterface()
Returns the public or extension interface associated with the context |
|
PropertyMap |
getControlPropertyMap()
Returns the current set of properties (in PropertyMap format) for the control associated with the context. |
|
|
getControlPropertySet(Class<T> propertySet)
Returns the current value of PropertySet for the associated control, or null if the property set has not been bound. |
|
static String |
getDefaultControlBinding(Class controlIntf)
Returns the default binding based entirely upon annotations or naming conventions. |
|
|
getMethodPropertySet(Method m,
Class<T> propertySet)
Returns the current value of PropertySet for the provided method, or null if the property set has not been bound for this method. |
|
String[] |
getParameterNames(Method m)
Returns an array containing the parameter names for the specified method |
|
|
getParameterPropertySet(Method m,
int i,
Class<T> propertySet)
Returns the current value of PropertySet for the selected (by index) method parameter, or null if the property set has not been bound for this method. |
|
Object |
getParameterValue(Method m,
String parameterName,
Object[] parameters)
Returns the value of a named method parameter from the input parameter array. |
|
|
getService(Class<T> serviceClass,
Object selector)
Returns an instance of a contextual service based upon the local context. |
|
boolean |
hasSingleThreadedParent()
|
|
void |
initialize()
Called by BeanContextSupport superclass during construction and deserialization to initialize subclass transient state |
|
void |
initializeControl()
The initializeControl method is invoked when the implementation instance associated with the context has been instantiated and initialized. |
|
boolean |
isSingleThreadedContainer()
Returns true if this container associated with this context service enforces single-threaded invocation, false otherwise. |
|
static String[] |
prioritizeInterceptors(String[] interceptors)
Applies externally defined (via INTERCEPTOR_CONFIG_FILE) ordering priority for controls interceptor services. |
|
void |
propertyChange(PropertyChangeEvent pce)
|
|
boolean |
remove(Object targetChild)
Overrides the BeanContextSupport.remove() method to perform additional post-processing on child removal. |
|
void |
removeLifeCycleListener(ControlBeanContext.LifeCycle listener)
Removes a currently registered LifeCycle event listener on the context. |
|
static String |
resolveDefaultBinding(String implBinding,
String controlClass)
Implements the default control implementation binding algorithm ( |
|
void |
serviceRevoked(BeanContextServiceRevokedEvent bcsre)
Implements the BeanContextServicesRevokedListener.servicesRevoked method. |
|
void |
setBeanContext(BeanContext beanContext)
Overrides the BeanContextChild.setBeanContext() method. |
|
protected static void |
setDelegateMap(PropertyMap map,
ControlBean bean,
AnnotatedElement annotElem)
|
|
void |
vetoableChange(PropertyChangeEvent pce)
|
Methods inherited from class BeanContextServicesSupport |
---|
addBeanContextServicesListener, addService, addService, bcsPreDeserializationHook, bcsPreSerializationHook, childJustRemovedHook, createBCSChild, createBCSSServiceProvider, fireServiceAdded, fireServiceAdded, fireServiceRevoked, fireServiceRevoked, getBeanContextServicesPeer, getChildBeanContextServicesListener, getCurrentServiceClasses, getCurrentServiceSelectors, getService, hasService, initializeBeanContextResources, releaseBeanContextResources, releaseService, removeBeanContextServicesListener, revokeService, serviceAvailable |
Methods inherited from class BeanContextSupport |
---|
addAll, addBeanContextMembershipListener, avoidingGui, bcsChildren, childDeserializedHook, childJustAddedHook, classEquals, clear, contains, containsAll, containsKey, copyChildren, deserialize, dontUseGui, fireChildrenAdded, fireChildrenRemoved, getBeanContextPeer, getChildBeanContextChild, getChildBeanContextMembershipListener, getChildPropertyChangeListener, getChildSerializable, getChildVetoableChangeListener, getChildVisibility, getLocale, getResource, getResourceAsStream, instantiateChild, isDesignTime, isEmpty, isSerializing, iterator, needsGui, okToUseGui, readChildren, remove, removeAll, removeBeanContextMembershipListener, retainAll, serialize, setDesignTime, setLocale, size, toArray, toArray, validatePendingAdd, validatePendingRemove, writeChildren |
Methods inherited from class BeanContextChildSupport |
---|
addPropertyChangeListener, addVetoableChangeListener, firePropertyChange, fireVetoableChange, getBeanContext, getBeanContextChildPeer, isDelegated, removePropertyChangeListener, removeVetoableChangeListener, validatePendingSetBeanContext |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface BeanContextServices |
---|
addBeanContextServicesListener, addService, getCurrentServiceClasses, getCurrentServiceSelectors, getService, hasService, releaseService, removeBeanContextServicesListener, revokeService |
Methods inherited from interface BeanContext |
---|
addBeanContextMembershipListener, getResource, getResourceAsStream, instantiateChild, removeBeanContextMembershipListener |
Methods inherited from interface BeanContextChild |
---|
addPropertyChangeListener, addVetoableChangeListener, getBeanContext, removePropertyChangeListener, removeVetoableChangeListener |
Methods inherited from interface Collection |
---|
addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, removeAll, retainAll, size, toArray, toArray |
Methods inherited from interface DesignMode |
---|
isDesignTime, setDesignTime |
Methods inherited from interface Visibility |
---|
avoidingGui, dontUseGui, needsGui, okToUseGui |
Methods inherited from interface BeanContextServicesListener |
---|
serviceAvailable |
Field Detail |
---|
public static final String INTERCEPTOR_CONFIG_FILE
Constructor Detail |
---|
protected ControlBeanContext(ControlBean bean)
bean
- The control bean that contains/scopes the ControlBeanContext. If null,
it means the ControlBeanContext is for a top-level container.Method Detail |
---|
public void initialize()
initialize
in class BeanContextServicesSupport
public void serviceRevoked(BeanContextServiceRevokedEvent bcsre)
serviceRevoked
in interface BeanContextServiceRevokedListener
serviceRevoked
in class BeanContextServicesSupport
public void setBeanContext(BeanContext beanContext) throws PropertyVetoException
setBeanContext
in interface BeanContextChild
setBeanContext
in class BeanContextChildSupport
PropertyVetoException
public String generateUniqueID(Class clazz)
public boolean add(Object targetChild)
add
in interface Collection
add
in class BeanContextSupport
public boolean remove(Object targetChild)
remove
in interface Collection
remove
in class BeanContextSupport
public ControlBean getBean(String id)
getBean
in interface ControlBeanContext
id
- the identifier for the target control, relative to the current
context.public ControlBean getControlBean()
getControlBean
in interface ControlBeanContext
public boolean hasSingleThreadedParent()
public boolean isSingleThreadedContainer()
isSingleThreadedContainer
in interface ControlBeanContext
public void initializeControl()
public PropertyMap getAnnotationMap(AnnotatedElement annotElem)
getAnnotationMap
in interface ControlBeanContext
protected PropertyMap getBeanAnnotationMap(ControlBean bean, AnnotatedElement annotElem)
protected static void setDelegateMap(PropertyMap map, ControlBean bean, AnnotatedElement annotElem)
public static String getDefaultControlBinding(Class controlIntf)
public static String resolveDefaultBinding(String implBinding, String controlClass)
implBinding
- the value of the defaultBinding attribute returned from a ControlInterface annotationcontrolClass
- the actual name of the interface decorated by the ControlInterface annotation
public Class getControlInterface()
ControlBeanContext
getControlInterface
in interface ControlBeanContext
public <T extends Annotation> T getControlPropertySet(Class<T> propertySet)
ControlBeanContext
getControlPropertySet
in interface ControlBeanContext
propertySet
- the PropertySet to return
PropertySet
public <T extends Annotation> T getMethodPropertySet(Method m, Class<T> propertySet)
ControlBeanContext
getMethodPropertySet
in interface ControlBeanContext
m
- the Method to check for properties.propertySet
- the PropertySet to return
PropertySet
public <T extends Annotation> T getParameterPropertySet(Method m, int i, Class<T> propertySet) throws IllegalArgumentException, IndexOutOfBoundsException
ControlBeanContext
getParameterPropertySet
in interface ControlBeanContext
m
- the Method to check for propertiesi
- the index of the method parameter to check for the request PropertySetpropertySet
- the PropertySet to return
IllegalArgumentException
IndexOutOfBoundsException
public String[] getParameterNames(Method m) throws IllegalArgumentException
ControlBeanContext
getParameterNames
in interface ControlBeanContext
m
- the Method whose parameter names should be returned.
IllegalArgumentException
public Object getParameterValue(Method m, String parameterName, Object[] parameters) throws IllegalArgumentException
ControlBeanContext
getParameterValue
in interface ControlBeanContext
m
- the Method associated with the input parameter listparameterName
- the name of the requested parameterparameters
- the array of method parameters
IllegalArgumentException
public PropertyMap getControlPropertyMap()
ControlBeanContext
getControlPropertyMap
in interface ControlBeanContext
PropertyMap
public <T> T getService(Class<T> serviceClass, Object selector)
ControlBeanContext
getService
in interface ControlBeanContext
serviceClass
- the class of the requested serviceselector
- the service dependent parameter
BeanContextServices.getService(java.beans.beancontext.BeanContextChild, java.lang.Object, java.lang.Class, java.lang.Object, java.beans.beancontext.BeanContextServiceRevokedListener)
public ControlHandle getControlHandle()
ControlBeanContext
getControlHandle
in interface ControlBeanContext
ControlHandle
public ClassLoader getClassLoader()
ControlBeanContext
getClassLoader
in interface ControlBeanContext
public static String[] prioritizeInterceptors(String[] interceptors)
interceptors
-
public void addLifeCycleListener(ControlBeanContext.LifeCycle listener)
ControlBeanContext
addLifeCycleListener
in interface ControlBeanContext
ControlBeanContext.LifeCycle
public void removeLifeCycleListener(ControlBeanContext.LifeCycle listener)
ControlBeanContext
removeLifeCycleListener
in interface ControlBeanContext
ControlBeanContext.LifeCycle
public void propertyChange(PropertyChangeEvent pce)
propertyChange
in interface PropertyChangeListener
propertyChange
in class BeanContextSupport
public void vetoableChange(PropertyChangeEvent pce) throws PropertyVetoException
vetoableChange
in interface VetoableChangeListener
vetoableChange
in class BeanContextSupport
PropertyVetoException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |