|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectControlBeanContext
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 interface ControlBeanContext |
|---|
ControlBeanContext.LifeCycle |
| Field Summary |
|---|
| 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. |
protected |
ControlBeanContext(ControlBean bean,
ControlBeanContext.BeanContextServicesFactory beanContextServicesFactory)
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. |
|
boolean |
addAll(Collection c)
|
|
void |
addBeanContextMembershipListener(BeanContextMembershipListener bcml)
|
|
void |
addBeanContextServicesListener(BeanContextServicesListener bcsl)
|
|
void |
addLifeCycleListener(ControlBeanContext.LifeCycle listener)
Registers a new listener for LifeCycle events on the context. |
|
void |
addPropertyChangeListener(String name,
PropertyChangeListener pcl)
|
|
boolean |
addService(Class serviceClass,
BeanContextServiceProvider serviceProvider)
|
|
void |
addVetoableChangeListener(String name,
VetoableChangeListener vcl)
|
|
boolean |
avoidingGui()
|
|
void |
clear()
|
|
boolean |
contains(Object o)
|
|
boolean |
containsAll(Collection c)
|
|
void |
dontUseGui()
|
|
boolean |
equals(Object o)
|
|
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. |
|
BeanContext |
getBeanContext()
|
|
protected ControlBeanContext.BeanContextServicesFactory |
getBeanContextServicesFactory()
|
|
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. |
|
Iterator |
getCurrentServiceClasses()
|
|
Iterator |
getCurrentServiceSelectors(Class serviceClass)
|
|
static String |
getDefaultControlBinding(Class controlIntf)
Deprecated. Use ControlUtils.getDefaultControlBinding(Class) insated. This method will be
removed in the next point release. |
|
|
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. |
|
URL |
getResource(String name,
BeanContextChild bcc)
|
|
InputStream |
getResourceAsStream(String name,
BeanContextChild bcc)
|
|
Object |
getService(BeanContextChild child,
Object requestor,
Class serviceClass,
Object serviceSelector,
BeanContextServiceRevokedListener bcsrl)
|
|
|
getService(Class<T> serviceClass,
Object selector)
Returns an instance of a contextual service based upon the local context. |
|
int |
hashCode()
|
|
boolean |
hasService(Class serviceClass)
|
|
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. |
|
Object |
instantiateChild(String beanName)
|
|
boolean |
isDesignTime()
|
|
boolean |
isEmpty()
|
|
boolean |
isSingleThreadedContainer()
Returns true if this container associated with this context service enforces single-threaded invocation, false otherwise. |
|
Iterator |
iterator()
|
|
boolean |
needsGui()
|
|
void |
okToUseGui()
|
|
static String[] |
prioritizeInterceptors(String[] interceptors)
Deprecated. Use InterceptorUtils.prioritizeInterceptors(String[]) instead. This method will
be removed in the next point release. |
|
void |
propertyChange(PropertyChangeEvent pce)
|
|
void |
releaseService(BeanContextChild child,
Object requestor,
Object service)
|
|
boolean |
remove(Object targetChild)
Overrides the BeanContextSupport.remove() method to perform additional post-processing on child removal. |
|
boolean |
removeAll(Collection c)
|
|
void |
removeBeanContextMembershipListener(BeanContextMembershipListener bcml)
|
|
void |
removeBeanContextServicesListener(BeanContextServicesListener bcsl)
|
|
void |
removeLifeCycleListener(ControlBeanContext.LifeCycle listener)
Removes a currently registered LifeCycle event listener on the context. |
|
void |
removePropertyChangeListener(String name,
PropertyChangeListener pcl)
|
|
void |
removeVetoableChangeListener(String name,
VetoableChangeListener vcl)
|
|
static String |
resolveDefaultBinding(String implBinding,
String controlClass)
Deprecated. Use ControlUtils.resolveDefaultBinding(String, String) insated. This method
will be removed in the next point release. |
|
boolean |
retainAll(Collection c)
|
|
void |
revokeService(Class serviceClass,
BeanContextServiceProvider serviceProvider,
boolean revokeCurrentServicesNow)
|
|
void |
serviceAvailable(BeanContextServiceAvailableEvent bcsae)
|
|
void |
serviceRevoked(BeanContextServiceRevokedEvent bcsre)
Implements the BeanContextServiceRevokedListener.serviceRevoked(java.beans.beancontext.BeanContextServiceRevokedEvent)
method. |
|
void |
setBeanContext(BeanContext beanContext)
Overrides the BeanContextChild.setBeanContext(java.beans.beancontext.BeanContext)
method. |
|
protected static void |
setDelegateMap(PropertyMap map,
ControlBean bean,
AnnotatedElement annotElem)
|
|
void |
setDesignTime(boolean designTime)
|
|
int |
size()
|
|
Object[] |
toArray()
|
|
Object[] |
toArray(Object[] a)
|
|
void |
vetoableChange(PropertyChangeEvent pce)
|
|
| Methods inherited from class Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected ControlBeanContext(ControlBean bean)
ControlBean is null, this ControlBeanContext object represents a top-level Control
container. This constructor uses the default implementation of the
BeanContextServices interface from the JDK.
bean - The control bean that contains/scopes the ControlBeanContext. If null, it means the
ControlBeanContext is for a top-level container.
protected ControlBeanContext(ControlBean bean,
ControlBeanContext.BeanContextServicesFactory beanContextServicesFactory)
ControlBean is null, this ControlBeanContext object represents a top-level Control
container. This constructor uses the beanContextServicesDelegate instance as the
implementation of the BeanContextServices interface.
bean - The control beanbeanContextServicesFactory - A factory that can be used to create the BeanContextServicesFactory object
that implements support for the BeanContextServices interface.| Method Detail |
|---|
public void initialize()
public void serviceRevoked(BeanContextServiceRevokedEvent bcsre)
BeanContextServiceRevokedListener.serviceRevoked(java.beans.beancontext.BeanContextServiceRevokedEvent)
method. This is called if the associated ControlBean has requested a service that is being subsequently
revoked.
serviceRevoked in interface BeanContextServiceRevokedListener
public void setBeanContext(BeanContext beanContext)
throws PropertyVetoException
BeanContextChild.setBeanContext(java.beans.beancontext.BeanContext)
method. This hook is used to perform additional processing that needs to occur when the control is associated
with a new nesting context.
setBeanContext in interface BeanContextChildPropertyVetoExceptionpublic String generateUniqueID(Class clazz)
public boolean add(Object targetChild)
add in interface Collectionpublic boolean remove(Object targetChild)
remove in interface Collectionpublic ControlBean getBean(String id)
getBean in interface ControlBeanContextid - the identifier for the target control, relative to the current
context.public ControlBean getControlBean()
getControlBean in interface ControlBeanContextpublic boolean hasSingleThreadedParent()
public boolean isSingleThreadedContainer()
isSingleThreadedContainer in interface ControlBeanContextpublic void initializeControl()
public PropertyMap getAnnotationMap(AnnotatedElement annotElem)
ControlContainerContext, enabling containers to implement
property binding mechanisms (such as external config) that may override the values
contained within the element annotations.
getAnnotationMap in interface ControlBeanContext
protected PropertyMap getBeanAnnotationMap(ControlBean bean,
AnnotatedElement annotElem)
protected static void setDelegateMap(PropertyMap map,
ControlBean bean,
AnnotatedElement annotElem)
public Class getControlInterface()
ControlBeanContext
getControlInterface in interface ControlBeanContextpublic <T extends Annotation> T getControlPropertySet(Class<T> propertySet)
ControlBeanContext
getControlPropertySet in interface ControlBeanContextpropertySet - the PropertySet to return
PropertySet
public <T extends Annotation> T getMethodPropertySet(Method m,
Class<T> propertySet)
ControlBeanContext
getMethodPropertySet in interface ControlBeanContextm - 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 ControlBeanContextm - 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 ControlBeanContextm - the Method whose parameter names should be returned.
IllegalArgumentException
public Object getParameterValue(Method m,
String parameterName,
Object[] parameters)
throws IllegalArgumentException
ControlBeanContext
getParameterValue in interface ControlBeanContextm - the Method associated with the input parameter listparameterName - the name of the requested parameterparameters - the array of method parameters
IllegalArgumentExceptionpublic PropertyMap getControlPropertyMap()
ControlBeanContext
getControlPropertyMap in interface ControlBeanContextPropertyMap
public <T> T getService(Class<T> serviceClass,
Object selector)
ControlBeanContext
getService in interface ControlBeanContextserviceClass - 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 ControlBeanContextControlHandlepublic ClassLoader getClassLoader()
ControlBeanContext
getClassLoader in interface ControlBeanContextpublic void addLifeCycleListener(ControlBeanContext.LifeCycle listener)
ControlBeanContext
addLifeCycleListener in interface ControlBeanContextControlBeanContext.LifeCyclepublic void removeLifeCycleListener(ControlBeanContext.LifeCycle listener)
ControlBeanContext
removeLifeCycleListener in interface ControlBeanContextControlBeanContext.LifeCyclepublic void propertyChange(PropertyChangeEvent pce)
propertyChange in interface PropertyChangeListener
public void vetoableChange(PropertyChangeEvent pce)
throws PropertyVetoException
vetoableChange in interface VetoableChangeListenerPropertyVetoExceptionpublic Iterator getCurrentServiceClasses()
getCurrentServiceClasses in interface BeanContextServicespublic Iterator getCurrentServiceSelectors(Class serviceClass)
getCurrentServiceSelectors in interface BeanContextServicesprotected ControlBeanContext.BeanContextServicesFactory getBeanContextServicesFactory()
public boolean equals(Object o)
equals in interface Collectionequals in class Objectpublic int hashCode()
hashCode in interface CollectionhashCode in class Object
public boolean addService(Class serviceClass,
BeanContextServiceProvider serviceProvider)
addService in interface BeanContextServices
public void revokeService(Class serviceClass,
BeanContextServiceProvider serviceProvider,
boolean revokeCurrentServicesNow)
revokeService in interface BeanContextServicespublic boolean hasService(Class serviceClass)
hasService in interface BeanContextServices
public Object getService(BeanContextChild child,
Object requestor,
Class serviceClass,
Object serviceSelector,
BeanContextServiceRevokedListener bcsrl)
throws TooManyListenersException
getService in interface BeanContextServicesTooManyListenersException
public void releaseService(BeanContextChild child,
Object requestor,
Object service)
releaseService in interface BeanContextServicespublic void addBeanContextServicesListener(BeanContextServicesListener bcsl)
addBeanContextServicesListener in interface BeanContextServicespublic void removeBeanContextServicesListener(BeanContextServicesListener bcsl)
removeBeanContextServicesListener in interface BeanContextServices
public Object instantiateChild(String beanName)
throws IOException,
ClassNotFoundException
instantiateChild in interface BeanContextIOException
ClassNotFoundException
public InputStream getResourceAsStream(String name,
BeanContextChild bcc)
throws IllegalArgumentException
getResourceAsStream in interface BeanContextIllegalArgumentException
public URL getResource(String name,
BeanContextChild bcc)
throws IllegalArgumentException
getResource in interface BeanContextIllegalArgumentExceptionpublic void addBeanContextMembershipListener(BeanContextMembershipListener bcml)
addBeanContextMembershipListener in interface BeanContextpublic void removeBeanContextMembershipListener(BeanContextMembershipListener bcml)
removeBeanContextMembershipListener in interface BeanContextpublic BeanContext getBeanContext()
getBeanContext in interface BeanContextChild
public void addPropertyChangeListener(String name,
PropertyChangeListener pcl)
addPropertyChangeListener in interface BeanContextChild
public void removePropertyChangeListener(String name,
PropertyChangeListener pcl)
removePropertyChangeListener in interface BeanContextChild
public void addVetoableChangeListener(String name,
VetoableChangeListener vcl)
addVetoableChangeListener in interface BeanContextChild
public void removeVetoableChangeListener(String name,
VetoableChangeListener vcl)
removeVetoableChangeListener in interface BeanContextChildpublic int size()
size in interface Collectionpublic boolean isEmpty()
isEmpty in interface Collectionpublic boolean contains(Object o)
contains in interface Collectionpublic Iterator iterator()
iterator in interface Iterableiterator in interface Collectionpublic Object[] toArray()
toArray in interface Collectionpublic Object[] toArray(Object[] a)
toArray in interface Collectionpublic boolean containsAll(Collection c)
containsAll in interface Collectionpublic boolean addAll(Collection c)
addAll in interface Collectionpublic boolean removeAll(Collection c)
removeAll in interface Collectionpublic boolean retainAll(Collection c)
retainAll in interface Collectionpublic void clear()
clear in interface Collectionpublic void setDesignTime(boolean designTime)
setDesignTime in interface DesignModepublic boolean isDesignTime()
isDesignTime in interface DesignModepublic boolean needsGui()
needsGui in interface Visibilitypublic void dontUseGui()
dontUseGui in interface Visibilitypublic void okToUseGui()
okToUseGui in interface Visibilitypublic boolean avoidingGui()
avoidingGui in interface Visibilitypublic void serviceAvailable(BeanContextServiceAvailableEvent bcsae)
serviceAvailable in interface BeanContextServicesListenerpublic static String[] prioritizeInterceptors(String[] interceptors)
InterceptorUtils.prioritizeInterceptors(String[]) instead. This method will
be removed in the next point release.
interceptors -
public static String getDefaultControlBinding(Class controlIntf)
ControlUtils.getDefaultControlBinding(Class) insated. This method will be
removed in the next point release.
controlIntf - the control interface class
public static String resolveDefaultBinding(String implBinding,
String controlClass)
ControlUtils.resolveDefaultBinding(String, String) insated. This method
will be removed in the next point release.
implBinding - the value of the defaultBinding attribute returned from a ControlInterface annotationcontrolClass - the actual name of the interface decorated by the ControlInterface annotation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||