| java.lang.Object org.apache.beehive.controls.runtime.bean.ControlBean
ControlBean | abstract public class ControlBean implements org.apache.beehive.controls.api.bean.ControlBean(Code) | | The ControlBean class is an abstract base class for the JavaBean classes generated to support
Beehive Controls.
The ControlBean class indirectly implements BeanContextProxy; the
org.apache.beehive.controls.api.context.ControlBeanContext that it contains/scopes acts as that proxy.
All support APIs (which may be called from derived subclasses or contextual services)
are generally marked as protected and have names that start with an underscore. This avoids the
possibility that the name might conflict with a user-defined method on a control's public or
extended Control interfaces.
NOTE: Adding public methods should be done with great care; any such method becomes part of the
public API, and occupies the method namespace for all controls.
|
Method Summary | |
void | addInvokeListener(InvokeListener invokeListener) Registers a new InvokeListener for this ControlBean. | public void | decodeImpl(Object impl) Called during XMLDecoder reconstruction of a ControlBean. | Object | dispatchEvent(EventRef event, Object[] args) Dispatches the requested operation event on the ControlBean. | protected static void | enforceVersionRequired(String intfName, Version version, VersionRequired versionRequired) Enforces the VersionRequired annotation at runtime (called from each ControlBean). | public synchronized Object | ensureControl() Returns the target control instance associated with this ControlBean, performing lazy
instantiation and initialization of the instance. | protected Interceptor | ensureInterceptor(String n) Retrieves interceptor instances, creates them lazily. | protected void | firePropertyChange(PropertyKey propertyKey, Object oldValue, Object newValue) Delivers a PropertyChangeEvent to any registered PropertyChangeListeners associated
with the property referenced by the specified key. | protected void | fireVetoableChange(PropertyKey propertyKey, Object oldValue, Object newValue) Delivers a PropertyChangeEvent to any registered VetoableChangeListeners associated
with the property referenced by the specified key. | protected PropertyMap | getAnnotationMap(AnnotatedElement annotElem) Returns the PropertyMap containing values associated with an AnnotatedElement. | final public BeanContext | getBeanContext() Returns the nesting BeanContext for this ControlBean. | final public ControlBeanContext | getBeanContextProxy() | public ControlBeanContext | getControlBeanContext() Returns the bean context instance associated with the this bean, as opposed to the
parent context returned by the public getBeanContext() API. | final public String | getControlID() | final public Class | getControlInterface() Returns the public interface for this control. | protected Object | getControlProperty(PropertyKey key) Returns a property on the ControlBean instance. | protected Object | getControlService(Class serviceClass, Object selector) Locates and obtains a context service from the BeanContextServices instance
supporting this bean. | protected T | getEventNotifier(Class<T> eventSet) | protected synchronized ImplInitializer | getImplInitializer() | Object | getImplementation() Returns the implementation instance associated with this ControlBean. | Vector<InvokeListener> | getInvokeListeners() | protected String | getLocalID() | public static Class | getMostDerivedInterface(Class controlIntf) Computes the most derived ControlInterface for the specified ControlExtension. | protected String[] | getParameterNames(Method m) Returns the parameter names for a method on the ControlBean. | protected synchronized PropertyChangeSupport | getPropertyChangeSupport() This protected version is only available to concrete subclasses that expose bound
property support. | BeanPropertyMap | getPropertyMap() | abstract protected Map | getPropertyMapCache() Returns the local cache for ControlBean property maps. | protected Object | getRawControlProperty(PropertyKey key) Returns a property on the ControlBean instance. | protected synchronized VetoableChangeSupport | getVetoableChangeSupport() This protected version is only available to concrete subclasses that expose bound
property support. | boolean | hasSingleThreadedImpl() Returns true if the implementation class for this ControlBean requires the framework
to ensure thread-safety for it. | protected void | postInvoke(Method m, Object[] args, Object retval, Throwable t, String[] interceptorNames, String pivotedInterceptor) The postInvoke method is called after all operations on the control. | protected void | postInvoke(Method m, Object[] args, Object retval, Throwable t) The postInvoke method is called after all operations on the control. | protected void | preInvoke(Method m, Object[] args, String[] interceptorNames) The preinvoke method is called before all operations on the control. | protected void | preInvoke(Method m, Object[] args) The preinvoke method is called before all operations on the control. | void | removeInvokeListener(InvokeListener invokeListener) Deregisters an existing InvokeListener for this ControlBean. | final public synchronized void | setBeanContext(BeanContext bc) Called by the BeanContextProxy (_cbc) whenever the _parent_ context containing this control bean is
changed. | protected void | setControlProperty(PropertyKey key, Object o) Sets a property on the ControlBean instance. | protected void | setEventNotifier(Class<T> eventSet, T notifier) | void | setLocalID(String localID) Set the local (parent-relative) ID for this ControlBean. |
_implClass | protected Class _implClass(Code) | | The control implementation class bound to this ControlBean
|
ControlBean | protected ControlBean(org.apache.beehive.controls.api.context.ControlBeanContext context, String id, PropertyMap initProperties, Class controlIntf)(Code) | | Parameters: context - the containing ControlBeanContext. May be null, in which case the bean will attempt toassociate with an active context at runtime (via thread-locals). Parameters: id - the local ID for the control, scoped to the control bean context. Parameters: initProperties - a PropertyMap containing initial properties for the control Parameters: controlIntf - the control interface or extension directly implemented by the control bean |
addInvokeListener | void addInvokeListener(InvokeListener invokeListener)(Code) | | Registers a new InvokeListener for this ControlBean.
|
decodeImpl | public void decodeImpl(Object impl)(Code) | | Called during XMLDecoder reconstruction of a ControlBean.
|
enforceVersionRequired | protected static void enforceVersionRequired(String intfName, Version version, VersionRequired versionRequired)(Code) | | Enforces the VersionRequired annotation at runtime (called from each ControlBean).
Parameters: intfName - Parameters: version - Parameters: versionRequired - |
ensureControl | public synchronized Object ensureControl()(Code) | | Returns the target control instance associated with this ControlBean, performing lazy
instantiation and initialization of the instance.
REVIEW: could probably improve the granularity of locking here, but start w/ just
synchronizing the entire fn.
|
ensureInterceptor | protected Interceptor ensureInterceptor(String n)(Code) | | Retrieves interceptor instances, creates them lazily.
|
firePropertyChange | protected void firePropertyChange(PropertyKey propertyKey, Object oldValue, Object newValue)(Code) | | Delivers a PropertyChangeEvent to any registered PropertyChangeListeners associated
with the property referenced by the specified key.
This method *should not* be synchronized, as the PropertyChangeSupport has its own
built in synchronization mechanisms.
|
fireVetoableChange | protected void fireVetoableChange(PropertyKey propertyKey, Object oldValue, Object newValue) throws java.beans.PropertyVetoException(Code) | | Delivers a PropertyChangeEvent to any registered VetoableChangeListeners associated
with the property referenced by the specified key.
This method *should not* be synchronized, as the VetoableChangeSupport has its own
built in synchronization mechanisms.
|
getAnnotationMap | protected PropertyMap getAnnotationMap(AnnotatedElement annotElem)(Code) | | Returns the PropertyMap containing values associated with an AnnotatedElement. Elements
that are associated with the bean's Control interface will be locally cached.
|
getBeanContext | final public BeanContext getBeanContext()(Code) | | Returns the nesting BeanContext for this ControlBean. This is thread-safe even though it
is not synchronized.
|
getBeanContextProxy | final public ControlBeanContext getBeanContextProxy()(Code) | | Return the BeanContextService proxy associated with this bean instance
|
getControlBeanContext | public ControlBeanContext getControlBeanContext()(Code) | | Returns the bean context instance associated with the this bean, as opposed to the
parent context returned by the public getBeanContext() API.
|
getControlID | final public String getControlID()(Code) | | Returns the control ID for this control
|
getControlInterface | final public Class getControlInterface()(Code) | | Returns the public interface for this control.
|
getControlProperty | protected Object getControlProperty(PropertyKey key)(Code) | | Returns a property on the ControlBean instance. All generated property getter methods
will delegate down to this method
|
getControlService | protected Object getControlService(Class serviceClass, Object selector) throws TooManyListenersException(Code) | | Locates and obtains a context service from the BeanContextServices instance
supporting this bean.
The base design for the BeanContextServicesSupport is that it will delegate up to peers
in a nesting context, so a nested control bean will look 'up' to find a service provider.
|
getEventNotifier | protected T getEventNotifier(Class<T> eventSet)(Code) | | Returns an EventNotifier/UnicastEventNotifier for this ControlBean for the target event set
|
getImplInitializer | protected synchronized ImplInitializer getImplInitializer()(Code) | | Obtains an instance of the appropriate ImplInitializer class
|
getImplementation | Object getImplementation()(Code) | | Returns the implementation instance associated with this ControlBean.
|
getLocalID | protected String getLocalID()(Code) | | Returns the local (parent-relative) ID for this ControlBean
|
getParameterNames | protected String[] getParameterNames(Method m)(Code) | | Returns the parameter names for a method on the ControlBean. Actual mapping is done
by generated subclasses, so if we reach the base ControlBean implementation, then
no parameter names are available for the target method.
|
getPropertyChangeSupport | protected synchronized PropertyChangeSupport getPropertyChangeSupport()(Code) | | This protected version is only available to concrete subclasses that expose bound
property support. This method is synchronized to enable lazy instantiation, in
the belief that it is a bigger win to avoid allocating when there are no listeners
than it is to introduce synchronization overhead on access.
|
getPropertyMap | BeanPropertyMap getPropertyMap()(Code) | | Returns the property map containing the properties for the bean
|
getPropertyMapCache | abstract protected Map getPropertyMapCache()(Code) | | Returns the local cache for ControlBean property maps.
|
getRawControlProperty | protected Object getRawControlProperty(PropertyKey key)(Code) | | Returns a property on the ControlBean instance. This version does not coerce
an annotation type property from a PropertyMap to a proxy instance of the
type.
|
getVetoableChangeSupport | protected synchronized VetoableChangeSupport getVetoableChangeSupport()(Code) | | This protected version is only available to concrete subclasses that expose bound
property support. This method is synchronized to enable lazy instantiation, in
the belief that is a bigger win to avoid allocating when there are no listeners
than it is to introduce synchronization overhead on access.
|
hasSingleThreadedImpl | boolean hasSingleThreadedImpl()(Code) | | Returns true if the implementation class for this ControlBean requires the framework
to ensure thread-safety for it.
|
postInvoke | protected void postInvoke(Method m, Object[] args, Object retval, Throwable t, String[] interceptorNames, String pivotedInterceptor)(Code) | | The postInvoke method is called after all operations on the control. In addition to
providing the basic hook for logging, context initialization, resource management, and other common
services, it also provides a hook for interceptors. During preInvoke, interceptors will be
called in the order that they are in the list. During postInvoke, they will be called in the
reverse order. Here is an example of the call sequence with I1, I2, and I3 being interceptors in the list:
I1.preInvoke() -> I2.preInvoke() -> I3.preInvoke() -> invoke method
|
I1.postInvoke() <- I2.postInvoke() <- I3.postInvoke() <---
In the event that an interceptor in the list pivoted during preInvoke, the "pivotedInterceptor"
parameter indicates the interceptor that had pivoted, and the interceptors succeeding it in the list will
not be called during postInvoke.
|
postInvoke | protected void postInvoke(Method m, Object[] args, Object retval, Throwable t)(Code) | | The postInvoke method is called after all operations on the control. It is the basic
hook for logging, context initialization, resource management, and other common
services.
|
preInvoke | protected void preInvoke(Method m, Object[] args, String[] interceptorNames) throws InterceptorPivotException(Code) | | The preinvoke method is called before all operations on the control. In addition to
providing a basic hook for logging, context initialization, resource management,
and other common services, it also provides a hook for interceptors.
|
preInvoke | protected void preInvoke(Method m, Object[] args)(Code) | | The preinvoke method is called before all operations on the control. It is the basic
hook for logging, context initialization, resource management, and other common
services
|
removeInvokeListener | void removeInvokeListener(InvokeListener invokeListener)(Code) | | Deregisters an existing InvokeListener for this ControlBean.
|
setBeanContext | final public synchronized void setBeanContext(BeanContext bc)(Code) | | Called by the BeanContextProxy (_cbc) whenever the _parent_ context containing this control bean is
changed. This is the place to do any initialization (or reinitialization) that is dependent
upon attributes of the container for the ControlBean.
Note: this is called in the ControlBean ctor, when a parent context calls add() on the nascent
bean.
Parameters: bc - the new parent context containing this control bean (not _cbc) |
setControlProperty | protected void setControlProperty(PropertyKey key, Object o)(Code) | | Sets a property on the ControlBean instance. All generated property setter methods
will delegate down to this method.
|
setEventNotifier | protected void setEventNotifier(Class<T> eventSet, T notifier)(Code) | | Sets the EventNotifier for this ControlBean
|
setLocalID | void setLocalID(String localID)(Code) | | Set the local (parent-relative) ID for this ControlBean. It has package access because
the local ID should only be set from within the associated context, and only when the
bean is currently anonymous (hence the assertion below)
|
|
|