|
||||||||||
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 BeanContextChild
PropertyVetoException
public String generateUniqueID(Class clazz)
public boolean add(Object targetChild)
add
in interface Collection
public boolean remove(Object targetChild)
remove
in interface Collection
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)
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 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 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
public void vetoableChange(PropertyChangeEvent pce) throws PropertyVetoException
vetoableChange
in interface VetoableChangeListener
PropertyVetoException
public Iterator getCurrentServiceClasses()
getCurrentServiceClasses
in interface BeanContextServices
public Iterator getCurrentServiceSelectors(Class serviceClass)
getCurrentServiceSelectors
in interface BeanContextServices
protected ControlBeanContext.BeanContextServicesFactory getBeanContextServicesFactory()
public boolean equals(Object o)
equals
in interface Collection
equals
in class Object
public int hashCode()
hashCode
in interface Collection
hashCode
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 BeanContextServices
public 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 BeanContextServices
TooManyListenersException
public void releaseService(BeanContextChild child, Object requestor, Object service)
releaseService
in interface BeanContextServices
public void addBeanContextServicesListener(BeanContextServicesListener bcsl)
addBeanContextServicesListener
in interface BeanContextServices
public void removeBeanContextServicesListener(BeanContextServicesListener bcsl)
removeBeanContextServicesListener
in interface BeanContextServices
public Object instantiateChild(String beanName) throws IOException, ClassNotFoundException
instantiateChild
in interface BeanContext
IOException
ClassNotFoundException
public InputStream getResourceAsStream(String name, BeanContextChild bcc) throws IllegalArgumentException
getResourceAsStream
in interface BeanContext
IllegalArgumentException
public URL getResource(String name, BeanContextChild bcc) throws IllegalArgumentException
getResource
in interface BeanContext
IllegalArgumentException
public void addBeanContextMembershipListener(BeanContextMembershipListener bcml)
addBeanContextMembershipListener
in interface BeanContext
public void removeBeanContextMembershipListener(BeanContextMembershipListener bcml)
removeBeanContextMembershipListener
in interface BeanContext
public 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 BeanContextChild
public int size()
size
in interface Collection
public boolean isEmpty()
isEmpty
in interface Collection
public boolean contains(Object o)
contains
in interface Collection
public Iterator iterator()
iterator
in interface Iterable
iterator
in interface Collection
public Object[] toArray()
toArray
in interface Collection
public Object[] toArray(Object[] a)
toArray
in interface Collection
public boolean containsAll(Collection c)
containsAll
in interface Collection
public boolean addAll(Collection c)
addAll
in interface Collection
public boolean removeAll(Collection c)
removeAll
in interface Collection
public boolean retainAll(Collection c)
retainAll
in interface Collection
public void clear()
clear
in interface Collection
public void setDesignTime(boolean designTime)
setDesignTime
in interface DesignMode
public boolean isDesignTime()
isDesignTime
in interface DesignMode
public boolean needsGui()
needsGui
in interface Visibility
public void dontUseGui()
dontUseGui
in interface Visibility
public void okToUseGui()
okToUseGui
in interface Visibility
public boolean avoidingGui()
avoidingGui
in interface Visibility
public void serviceAvailable(BeanContextServiceAvailableEvent bcsae)
serviceAvailable
in interface BeanContextServicesListener
public 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 |