Awesome. Psyched to see this stuff in the tree.
[EMAIL PROTECTED] wrote:
Author: kentam Date: Mon Jan 10 16:16:04 2005 New Revision: 124852
URL: http://svn.apache.org/viewcvs?view=rev&rev=124852 Log: Define a set of intrinsic "base" control properties that all controls have by default, and expose the binding of control implementation class as one of those properties. For example, the following syntax is now supported:
@Control @BaseProperties( controlImplementation="foo.myControlImplementation" ) YourControl yc;
External configuration of the control implementation now looks just like external configuration of any other property.
Added support for controlling the presence of programmatic setters for control properties via the @PropertySet( hasSetters ) attribute. For example:
@PropertySet( hasSetters=false ) public interface myPropertySet { //... }
will suppress programmatic setter functions on the resulting control bean.
Added DRT tests for the above work.
Added: incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/BaseProperties.java (contents, props changed) Modified: incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/context/ControlBeanContext.java incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/context/ControlContainerContext.java incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/BaseMap.java incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/BeanPropertyMap.java incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/PropertySet.java incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlBean.java incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlBeanContext.java incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlContainerContext.java incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptControlInterface.java incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptPropertySet.java incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlBean.vm incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlBeanInfo.vm incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/binding/BindingTestControl.java incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/composition/InnerControl.java incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/composition/OuterControlImpl.jcs incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/beaninfo/InfoTestBean.beaninfo incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/DeclarativeTest.java incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/ProgrammaticTest.java incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Ext1Bean.beaninfo incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Ext2Bean.beaninfo incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Intf1Bean.beaninfo incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Intf2Bean.beaninfo incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/binding/TestControlBinding.java incubator/beehive/trunk/controls/test/webapps/controlsWeb/binding/BindingTests.jpf
Modified: incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/context/ControlBeanContext.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/context/ControlBeanContext.java?view=diff&rev=124852&p1=incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/context/ControlBeanContext.java&r1=124851&p2=incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/context/ControlBeanContext.java&r2=124852
==============================================================================
--- incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/context/ControlBeanContext.java (original)
+++ incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/context/ControlBeanContext.java Mon Jan 10 16:16:04 2005
@@ -27,7 +27,6 @@
import org.apache.beehive.controls.api.bean.ControlBean;
import org.apache.beehive.controls.api.events.EventSet;
import org.apache.beehive.controls.api.properties.PropertyMap;
-import org.apache.beehive.controls.api.properties.PropertySet;
/**
* The ControlBeanContext interface defines the basic set of contextual services and lifecycle
@@ -64,12 +63,6 @@
public Class getControlInterface();
/**
- * Returns the binding from a control interface to a control implementation for the
- * current container context.
- */
- public Class getControlBinding(Class controlIntf);
-
- /**
* Returns the current value of PropertySet for the associated control, or
* null if the property set has not been bound. Actual bindings for property
* values may be the result of annotations on the control field or class,
@@ -159,7 +152,7 @@
*
* @return a ControlHandle instance for the control, or null.
*
- * @see org.apache.beehive.control.api.context.ControlHandle
+ * @see org.apache.beehive.controls.api.context.ControlHandle
*/
public ControlHandle getControlHandle();
@@ -178,6 +171,11 @@
public java.lang.ClassLoader getClassLoader();
/**
+ * Returns true if this container guarantees single-threaded behaviour.
+ */
+ public boolean isSingleThreadedContainer();
+
+ /**
* Returns any child ControlBean that is nested in the ControlBeanContext, or null
* if no matching child is found. The <code>id</code> parameter is relative to
* the current nesting context, not an absolute control id.
@@ -218,14 +216,14 @@
/**
* Registers a new listener for LifeCycle events on the context.
*
- * @see org.apache.beehive.controls.api.context.ControlBeanContext$LifeCycle
+ * @see org.apache.beehive.controls.api.context.ControlBeanContext.LifeCycle
*/
public void addLifeCycleListener(LifeCycle listener);
/**
* Removes a currently registered LifeCycle event listener on the context.
*
- * @see org.apache.beehive.controls.api.context.ControlBeanContext$LifeCycle
+ * @see org.apache.beehive.controls.api.context.ControlBeanContext.LifeCycle
*/
public void removeLifeCycleListener(LifeCycle listener);
}
Modified: incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/context/ControlContainerContext.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/context/ControlContainerContext.java?view=diff&rev=124852&p1=incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/context/ControlContainerContext.java&r1=124851&p2=incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/context/ControlContainerContext.java&r2=124852 ============================================================================== --- incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/context/ControlContainerContext.java (original) +++ incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/context/ControlContainerContext.java Mon Jan 10 16:16:04 2005 @@ -19,7 +19,6 @@ */
import org.apache.beehive.controls.api.bean.ControlBean;
-import org.apache.beehive.controls.api.context.ControlHandle;
import org.apache.beehive.controls.api.events.EventDispatcher;
/**
@@ -40,18 +39,10 @@ */
public void endContext();
- /**
- * Returns the binding from a control interface to a control implementation for the
- * current container context.
- */
- public Class getControlBinding(Class controlIntf);
-
/**
* Returns a ControlHandle to the component containing the control. This handle can be
* used to dispatch events and operations to a control instance. This method will return
* null if the containing component does not support direct dispatch.
- *
- * @param targetID the composite ID of the target control bean
*/
public ControlHandle getControlHandle(ControlBean bean);
}
Modified: incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/BaseMap.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/BaseMap.java?view=diff&rev=124852&p1=incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/BaseMap.java&r1=124851&p2=incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/BaseMap.java&r2=124852 ============================================================================== --- incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/BaseMap.java (original) +++ incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/BaseMap.java Mon Jan 10 16:16:04 2005 @@ -130,7 +130,7 @@ * Sets a delegate base property map from which values will be derived if not found within * the local property map. */ - public void setDelegateMap(PropertyMap delegateMap) + public synchronized void setDelegateMap(PropertyMap delegateMap) { if (!isCompatibleClass(delegateMap.getMapClass())) throw new IllegalArgumentException("The delegate map is an incompatible type");
Added: incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/BaseProperties.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/BaseProperties.java?view=auto&rev=124852
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/BaseProperties.java Mon Jan 10 16:16:04 2005
@@ -0,0 +1,42 @@
+package org.apache.beehive.controls.api.properties;
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * + * http://www.apache.org/licenses/LICENSE-2.0
+ * + * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+
+import java.lang.annotation.Annotation;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+
+/**
+ * Base properties that are present intrinsically on all controls.
+ */
[EMAIL PROTECTED]( hasSetters=false )
[EMAIL PROTECTED]( {ElementType.TYPE, ElementType.FIELD} )
[EMAIL PROTECTED]( RetentionPolicy.RUNTIME )
+public @interface BaseProperties
+{
+ /**
+ * Fully qualified classname of the implementation class for the control. If null,
+ * the default algorithm for * determining the implementation class will be used --
+ * basically, adding "Impl" to the control interface name.
+ */
+ String controlImplementation() default "";
+}
Modified: incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/BeanPropertyMap.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/BeanPropertyMap.java?view=diff&rev=124852&p1=incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/BeanPropertyMap.java&r1=124851&p2=incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/BeanPropertyMap.java&r2=124852
==============================================================================
--- incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/BeanPropertyMap.java (original)
+++ incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/BeanPropertyMap.java Mon Jan 10 16:16:04 2005
@@ -18,19 +18,10 @@
*/
import java.lang.annotation.Annotation;
-import java.lang.reflect.AnnotatedElement;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
-import java.util.Iterator;
-
-
-import org.apache.beehive.controls.api.bean.ControlBean;
-import org.apache.beehive.controls.api.bean.ControlExtension;
-import org.apache.beehive.controls.api.bean.ControlInterface;
/**
* The BeanPropertyMap class represents a collection of property values where properties are
@@ -101,7 +92,7 @@
/**
* Sets the property specifed by 'key' within this map.
*/
- public void setProperty(PropertyKey key, Object value)
+ public synchronized void setProperty(PropertyKey key, Object value)
{
if (!isValidKey(key))
throw new IllegalArgumentException("Key " + key + " is not valid for " + getMapClass());
@@ -190,5 +181,5 @@
HashMap<PropertyKey,Object> _properties = new HashMap<PropertyKey,Object>(); // locally maintained PropertySets
- HashSet<Class> _propertySets = new HashSet();
+ HashSet<Class> _propertySets = new HashSet<Class>();
}
Modified: incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/PropertySet.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/PropertySet.java?view=diff&rev=124852&p1=incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/PropertySet.java&r1=124851&p2=incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/PropertySet.java&r2=124852 ============================================================================== --- incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/PropertySet.java (original) +++ incubator/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/PropertySet.java Mon Jan 10 16:16:04 2005 @@ -74,5 +74,11 @@ * The externalConfig member defines whether properties in the set will be settable * via external configuration. */ - boolean externalConfig() default false; + boolean externalConfig() default true; + + /** + * The hasSetters member defines whether properties in the set will have programmatic + * setter methods. + */ + boolean hasSetters() default true; }
Modified: incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlBean.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlBean.java?view=diff&rev=124852&p1=incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlBean.java&r1=124851&p2=incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlBean.java&r2=124852
==============================================================================
--- incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlBean.java (original)
+++ incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlBean.java Mon Jan 10 16:16:04 2005
@@ -39,11 +39,7 @@
import org.apache.beehive.controls.api.context.ControlThreadContext;
import org.apache.beehive.controls.api.events.EventRef;
import org.apache.beehive.controls.api.events.EventSet;
-import org.apache.beehive.controls.api.properties.AnnotatedElementMap;
-import org.apache.beehive.controls.api.properties.BeanPropertyMap;
-import org.apache.beehive.controls.api.properties.PropertyKey;
-import org.apache.beehive.controls.api.properties.PropertyMap;
-import org.apache.beehive.controls.api.properties.PropertySetProxy;
+import org.apache.beehive.controls.api.properties.*;
import org.apache.beehive.controls.spi.svc.Interceptor;
/**
@@ -81,6 +77,9 @@
_id = _localID;
_controlIntf = controlIntf;
+ // Create the context that acts as the BeanContextProxy for this bean (the context that this bean _defines_).
+ _cbc = new ControlBeanContext( this );
+
//
// If no containing context was specified during construction, see if there is a current
// active container context and implicitly associated the control with it.
@@ -89,21 +88,6 @@
context = ControlThreadContext.getContext();
//
- // If we've got a context, use it to bind to an implementation of the control, else use default binding.
- //
- if (context != null)
- _implClass = context.getControlBinding(_controlIntf);
- else
- _implClass = ControlBeanContext.getDefaultControlBinding(_controlIntf);
-
- //
- // Cache the threading policy associated with the impl
- //
- Threading thr = (Threading)_implClass.getAnnotation(Threading.class);
- if ( thr != null )
- _threadingPolicy = thr.value();
-
- //
// Associate this bean with the context. Beans may run without a context!
// Note that the add() call has the side-effect of calling ControlBean.setBeanContext(), which does
// additional setup work, so we make sure we always call that anyways!
@@ -149,16 +133,61 @@
//
_properties = new BeanPropertyMap(classMap);
}
+
+ //
+ // See if the property map specifies an implementation class for the control; if not, use default binding.
+ //
+
+ String implBinding = null;
+ BaseProperties bp = _properties.getPropertySet( BaseProperties.class );
+ if ( bp != null )
+ implBinding = bp.controlImplementation();
+ else
+ implBinding = ControlBeanContext.getDefaultControlBinding(_controlIntf);
+
+ // REVIEW: consider surfacing ClassNotFoundException in the generated bean's ctors. Is that a violation
+ // of JavaBean spec for the signature of bean ctors?
+
+ try
+ {
+ _implClass = _controlIntf.getClassLoader().loadClass(implBinding);
+ }
+ catch (ClassNotFoundException cnfe)
+ {
+ throw new ControlException("Unable to load control implementation: " + implBinding, cnfe);
+ }
+
+ //
+ // Cache the threading policy associated with the impl
+ //
+ Threading thr = (Threading)_implClass.getAnnotation(Threading.class);
+ if ( thr != null )
+ _threadingPolicy = thr.value();
+
+ ensureThreadingBehaviour();
}
/**
+ * Configure this bean to be thread-safe given the threading settings of the impl class and
+ * the outer container.
+ */
+ private void ensureThreadingBehaviour()
+ {
+ //
+ // If the implementation class requires a guarantee of single-threaded behavior and the
+ // outer container does not guarantee it, then enable invocation locking on this
+ // bean instance.
+ //
+ if (hasSingleThreadedImpl() && ! _cbc.hasSingleThreadedParent())
+ _invokeLock = new Semaphore(1, true);
+ else
+ _invokeLock = null;
+ }
+ /**
* Return the BeanContextService proxy associated with this bean instance
*/
- final public synchronized ControlBeanContext getBeanContextProxy()
+ final public ControlBeanContext getBeanContextProxy()
{
- if (_cbc == null)
- _cbc = new ControlBeanContext(this);
-
return _cbc;
}
@@ -188,15 +217,7 @@
*/
final public synchronized void setBeanContext(BeanContext bc)
{
- //
- // If the implementation class requires a guarantee of single-threaded behavior and the
- // outer container does not guarantee it, then enable invocation locking on this
- // bean instance.
- //
- if (hasSingleThreadedImpl() && !hasSingleThreadedContainer())
- _invokeLock = new Semaphore(1, true);
- else
- _invokeLock = null;
+ ensureThreadingBehaviour();
}
/**
@@ -216,49 +237,15 @@
}
/**
- * This method will return true if the external container for this control
- * guarantees single-threaded behavior. For example, the EJB container does
- * provide this guarantee, the servlet container does not.
+ * Returns true if the implementation class for this ControlBean requires the framework
+ * to ensure thread-safety for it.
*/
- /* package */ synchronized boolean hasSingleThreadedContainer()
- {
- BeanContext bc = getBeanContext();
- if (bc instanceof ControlBeanContext)
- return ((ControlBeanContext)bc).isSingleThreadedContainer();
-
- // Better safe than sorry, when it comes to thread safety
- return false;
- }
-
- /**
- * Returns true if the implementation class for this ControlBean can be assumed to
- * be thread-safe.
- */
- private boolean hasSingleThreadedImpl()
+ /*package*/ boolean hasSingleThreadedImpl()
{
return _threadingPolicy == ThreadingPolicy.SINGLE_THREADED;
}
/**
- * Returns true if the ControlBean instance is running in an environment that
- * guarantees single-threaded behaviour, false otherwise.
- */
- public synchronized boolean isSingleThreadedBean()
- {
- //
- // If the thread safe marker interface isn't found on the implementation, then
- // assume than single-threaded behavior is guaranteed to be locally enforced.
- //
- if (hasSingleThreadedImpl())
- return true;
-
- //
- // else, delegate to the outer container, which might be single threaded itself.
- //
- return hasSingleThreadedContainer();
- }
-
- /**
* Obtains an instance of the appropriate ImplInitializer class
*/
protected synchronized ImplInitializer getImplInitializer()
@@ -918,7 +905,7 @@
* The threading policy associated with the control implementation wrapped by this
* ControlBean.
*/
- transient private ThreadingPolicy _threadingPolicy = ThreadingPolicy.SINGLE_THREADED;
+ transient private ThreadingPolicy _threadingPolicy = null;
/**
* Contains the per-instance properties set for this ControlBean.
Modified: incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlBeanContext.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlBeanContext.java?view=diff&rev=124852&p1=incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlBeanContext.java&r1=124851&p2=incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlBeanContext.java&r2=124852
==============================================================================
--- incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlBeanContext.java (original)
+++ incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlBeanContext.java Mon Jan 10 16:16:04 2005
@@ -176,6 +176,8 @@
super.setBeanContext(beanContext);
+ _hasSingleThreadedParent = cbcs.isSingleThreadedContainer();
+
if (_bean != null)
{
@@ -187,14 +189,6 @@
_bean.setBeanContext(beanContext);
//
- // The parent context relationship has been established (by the super.setBeanContext() call above).
- // The bean can now answer the question of whether it's single threaded (it needs to be able to query
- // the parent context to determine that), which means this context can now determine whether _it's_
- // single threaded.
- //
- _isSingleThreadedContainer = _bean.isSingleThreadedBean();
-
- //
// Establish a new value for the absolute control ID based upon the nesting context
// and parent bean (if any).
//
@@ -355,6 +349,11 @@
return _bean;
}
+ public synchronized boolean hasSingleThreadedParent()
+ {
+ return _hasSingleThreadedParent;
+ }
+
/**
* Returns true if this container associated with this context service enforces
* single-threaded invocation, false otherwise.
@@ -364,7 +363,7 @@
*/
public synchronized boolean isSingleThreadedContainer()
{
- return _isSingleThreadedContainer;
+ return ( hasSingleThreadedParent() || ( _bean != null && _bean.hasSingleThreadedImpl() ));
}
/**
@@ -448,27 +447,9 @@
}
/**
- * Returns the control implementation class that is bound to (implements) the
- * public or extension interface in the current context.
- */
- public Class getControlBinding(Class controlIntf)
- {
- //
- // Delegate up until a container-specific subclass of ControlBeanContext
- // (ControlContainerContext?) is found to manage the binding.
- //
- ControlBeanContext cbc = (ControlBeanContext)getBeanContext();
- if (cbc != null)
- return cbc.getControlBinding(controlIntf);
-
- // No parent context exists, just return default binding
- return getDefaultControlBinding(controlIntf);
- }
-
- /**
* Returns the default binding based entirely upon annotations or naming conventions.
*/
- static public Class getDefaultControlBinding(Class controlIntf)
+ static public String getDefaultControlBinding(Class controlIntf)
{
controlIntf = ControlBean.getMostDerivedInterface(controlIntf);
@@ -476,14 +457,8 @@
(ControlInterface)controlIntf.getAnnotation(ControlInterface.class);
String implBinding = intfAnnot.defaultBinding();
implBinding = resolveDefaultBinding( implBinding, controlIntf.getName() );
- try
- {
- return controlIntf.getClassLoader().loadClass(implBinding);
- }
- catch (ClassNotFoundException cnfe)
- {
- throw new ControlException("Unable to load control implementation", cnfe);
- }
+
+ return implBinding;
}
/**
@@ -830,11 +805,9 @@
private ControlBean _bean;
/**
- * Indicates whether this context acts as a single-threaded container (for ControlBeans nested
- * by the ControlBean that scopes this context, i.e. _bean). This is dependent on the parent context,
- * so may be changed during setBeanContext(). It defaults to false for safety.
+ * Indicates whether this context's parent guarantees single-threaded behaviour.
*/
- private boolean _isSingleThreadedContainer = false;
+ private boolean _hasSingleThreadedParent = false;
/**
* Maps children by the local (relative) ID of the child to the actual bean instance.
Modified: incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlContainerContext.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlContainerContext.java?view=diff&rev=124852&p1=incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlContainerContext.java&r1=124851&p2=incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlContainerContext.java&r2=124852
==============================================================================
--- incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlContainerContext.java (original)
+++ incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlContainerContext.java Mon Jan 10 16:16:04 2005
@@ -166,18 +166,6 @@
return null;
}
- /** - * Returns the binding from a control interface to a control implementation for the
- * current container context.
- */
- public Class getControlBinding(Class controlClass)
- {
- //
- // TODO: Add caching of relationships and external binding mechanisms
- //
- return getDefaultControlBinding(controlClass);
- }
-
/**
* Returns true if this container guarantees single-threaded behaviour. By default, top-level
* containers are assumed to NOT guarantee this; specific container implementations (for example,
Modified: incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptControlInterface.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptControlInterface.java?view=diff&rev=124852&p1=incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptControlInterface.java&r1=124851&p2=incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptControlInterface.java&r2=124852
==============================================================================
--- incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptControlInterface.java (original)
+++ incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptControlInterface.java Mon Jan 10 16:16:04 2005
@@ -239,8 +239,22 @@
if ( _intfDecl == null )
return propSets;
+ // TODO: enforce presence of prefixes when multiple property sets w/ the same
+ // property name exist
+
+ //
+ // Add the intrinsic/base property set
//
- // Handle external property sets
+
+ TypeDeclaration basePropsDecl =
+ _env.getTypeDeclaration( "org.apache.beehive.controls.api.properties.BaseProperties" );
+ if ( basePropsDecl != null )
+ {
+ propSets.add( new AptPropertySet( null, basePropsDecl, _env ) );
+ }
+
+ //
+ // Add external property sets
//
ExternalPropertySets extPropsAnnotation = _intfDecl.getAnnotation(ExternalPropertySets.class);
if ( extPropsAnnotation != null )
@@ -269,11 +283,12 @@
}
}
+ //
+ // Add nested property sets
+ //
+
if ( _intfDecl.getNestedTypes() == null )
return propSets;
-
- // TODO: enforce presence of prefixes when multiple property sets w/ the same
- // property name exist
for (TypeDeclaration innerDecl : _intfDecl.getNestedTypes())
{
Modified: incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptPropertySet.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptPropertySet.java?view=diff&rev=124852&p1=incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptPropertySet.java&r1=124851&p2=incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptPropertySet.java&r2=124852
==============================================================================
--- incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptPropertySet.java (original)
+++ incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/AptPropertySet.java Mon Jan 10 16:16:04 2005
@@ -55,6 +55,8 @@
}
_propertySet = (AnnotationTypeDeclaration)propertySet;
+ _hasSetters = _propertySet.getAnnotation(PropertySet.class).hasSetters();
+
_env = env;
_properties = initProperties();
}
@@ -127,8 +129,17 @@
return _propertySet.getAnnotation(PropertySet.class).prefix();
}
+ /**
+ * Returns whether or not this propertyset exposes setters
+ */
+ public boolean hasSetters()
+ {
+ return _hasSetters;
+ }
+
private AnnotationTypeDeclaration _propertySet;
private AptControlInterface _controlIntf; // may be null if an external property set
private ArrayList<AptProperty> _properties;
private AnnotationProcessorEnvironment _env;
+ private boolean _hasSetters;
}
Modified: incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlBean.vm
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlBean.vm?view=diff&rev=124852&p1=incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlBean.vm&r1=124851&p2=incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlBean.vm&r2=124852
==============================================================================
--- incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlBean.vm (original)
+++ incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlBean.vm Mon Jan 10 16:16:04 2005
@@ -204,9 +204,10 @@
* A PropertyKey that can be used to access the $property.name property of the
* $property.propertySet.shortName PropertySet
*/
- public static PropertyKey $property.keyName = new PropertyKey(${property.propertySet.className}.class, "$property.name");
+ public static final PropertyKey $property.keyName = new PropertyKey(${property.propertySet.className}.class, "$property.name");
- public void ${property.writeMethod}($property.type value)
+ #if ($property.propertySet.hasSetters())
+ public synchronized void ${property.writeMethod}($property.type value)
#if ($property.constrained)
throws java.beans.PropertyVetoException
#end
@@ -226,6 +227,7 @@
firePropertyChange($property.keyName, oldValue, value);
#end
}
+ #end
public $property.type ${property.readMethod}()
{
Modified: incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlBeanInfo.vm
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlBeanInfo.vm?view=diff&rev=124852&p1=incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlBeanInfo.vm&r1=124851&p2=incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlBeanInfo.vm&r2=124852
==============================================================================
--- incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlBeanInfo.vm (original)
+++ incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlBeanInfo.vm Mon Jan 10 16:16:04 2005
@@ -169,7 +169,16 @@
#foreach ($propertySet in $intf.propertySets)
#foreach ($property in $propertySet.properties) + #if ($propertySet.hasSetters())
pd = new PropertyDescriptor("$property.name", ${bean.className}.class);
+ #else
+ #if ($property.getType().equals("boolean"))
+ #set ( $getterName = "is${property.accessorName}" )
+ #else
+ #set ( $getterName = "get${property.accessorName}" )
+ #end
+ pd = new PropertyDescriptor("$property.name", ${bean.className}.class, "$getterName", null );
+ #end
#if ($property.propertyInfo)
pd.setBound($property.propertyInfo.bound());
pd.setConstrained($property.propertyInfo.constrained());
Modified: incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/binding/BindingTestControl.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/binding/BindingTestControl.java?view=diff&rev=124852&p1=incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/binding/BindingTestControl.java&r1=124851&p2=incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/binding/BindingTestControl.java&r2=124852 ============================================================================== --- incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/binding/BindingTestControl.java (original) +++ incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/binding/BindingTestControl.java Mon Jan 10 16:16:04 2005 @@ -1,10 +1,10 @@ package org.apache.beehive.controls.test.controls.binding;
import org.apache.beehive.controls.api.bean.ControlInterface;
+import org.apache.beehive.controls.api.properties.BaseProperties;
[EMAIL PROTECTED] (
- defaultBinding = "org.apache.beehive.controls.test.controls.binding.BindingTestControlImpl"
-)
[EMAIL PROTECTED]
[EMAIL PROTECTED](controlImplementation="org.apache.beehive.controls.test.controls.binding.BindingTestControlImpl")
public interface BindingTestControl
{
public String getStatus();
Modified: incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/composition/InnerControl.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/composition/InnerControl.java?view=diff&rev=124852&p1=incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/composition/InnerControl.java&r1=124851&p2=incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/composition/InnerControl.java&r2=124852
==============================================================================
--- incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/composition/InnerControl.java (original)
+++ incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/composition/InnerControl.java Mon Jan 10 16:16:04 2005
@@ -26,6 +26,7 @@
public String name() default DEFAULT_NAME;
//does not have a default value assigned
public String job();
+ public int rank() default 0;
}
Modified: incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/composition/OuterControlImpl.jcs Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/composition/OuterControlImpl.jcs?view=diff&rev=124852&p1=incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/composition/OuterControlImpl.jcs&r1=124851&p2=incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/composition/OuterControlImpl.jcs&r2=124852 ============================================================================== --- incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/composition/OuterControlImpl.jcs (original) +++ incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/composition/OuterControlImpl.jcs Mon Jan 10 16:16:04 2005 @@ -129,6 +129,7 @@ BeanPropertyMap props = new BeanPropertyMap(InnerControl.Identity.class); props.setProperty( InnerControlBean.NameKey, "ken" ); props.setProperty( InnerControlBean.JobKey, "engineer"); + props.setProperty( InnerControlBean.RankKey, new Integer(2)); InnerControlBean inner=(InnerControlBean)org.apache.beehive.controls.api.bean.Controls.instantiate( Thread.currentThread().getContextClassLoader(), "org.apache.beehive.controls.test.controls.composition.InnerControlBean", props);
Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/beaninfo/InfoTestBean.beaninfo Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/beaninfo/InfoTestBean.beaninfo?view=diff&rev=124852&p1=incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/beaninfo/InfoTestBean.beaninfo&r1=124851&p2=incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/beaninfo/InfoTestBean.beaninfo&r2=124852 ============================================================================== --- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/beaninfo/InfoTestBean.beaninfo (original) +++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/beaninfo/InfoTestBean.beaninfo Mon Jan 10 16:16:04 2005 @@ -66,7 +66,7 @@ public int org.apache.beehive.controls.test.controls.beaninfo.InfoTestBean.getProp1() </read-method> <write-method> - public void org.apache.beehive.controls.test.controls.beaninfo.InfoTestBean.setProp1(int) + public synchronized void org.apache.beehive.controls.test.controls.beaninfo.InfoTestBean.setProp1(int) </write-method> <feature-descriptor name="InfoTest prop1" full-name="InfoTest prop1" @@ -78,6 +78,24 @@ </short-description> </feature-descriptor> </property-descriptor> + <property-descriptor name="controlImplementation"> + type="java.lang.String" + isBound=false + isConstrained=false + isDefault=false> + <read-method> + public java.lang.String org.apache.beehive.controls.test.controls.beaninfo.InfoTestBean.getControlImplementation() + </read-method> + <feature-descriptor name="controlImplementation" + full-name="controlImplementation" + is-expert=false + is-hidden=false + is-preferred=false> + <short-description> + controlImplementation + </short-description> + </feature-descriptor> + </property-descriptor> <property-descriptor name="prop2"> type="boolean" isBound=false @@ -87,7 +105,7 @@ public boolean org.apache.beehive.controls.test.controls.beaninfo.InfoTestBean.isProp2() </read-method> <write-method> - public void org.apache.beehive.controls.test.controls.beaninfo.InfoTestBean.setProp2(boolean) + public synchronized void org.apache.beehive.controls.test.controls.beaninfo.InfoTestBean.setProp2(boolean) </write-method> <feature-descriptor name="prop2" full-name="prop2"
Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/DeclarativeTest.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/DeclarativeTest.java?view=diff&rev=124852&p1=incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/DeclarativeTest.java&r1=124851&p2=incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/DeclarativeTest.java&r2=124852
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/DeclarativeTest.java (original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/DeclarativeTest.java Mon Jan 10 16:16:04 2005
@@ -26,13 +26,13 @@
public DeclarativeTest(String name) throws Exception
{
super(name);
- _testContext = createTestBeanContext();
- org.apache.beehive.controls.api.bean.Controls.initializeClient( null, this, _testContext );
}
// begin and end control bean context for each test
public void setUp() throws Exception
{
+ _testContext = createTestBeanContext();
+ org.apache.beehive.controls.api.bean.Controls.initializeClient( null, this, _testContext );
_testContext.beginContext();
}
Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/ProgrammaticTest.java
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/ProgrammaticTest.java?view=diff&rev=124852&p1=incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/ProgrammaticTest.java&r1=124851&p2=incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/ProgrammaticTest.java&r2=124852
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/ProgrammaticTest.java (original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/ProgrammaticTest.java Mon Jan 10 16:16:04 2005
@@ -49,6 +49,7 @@
Assert.assertNotNull(innerBean);
Assert.assertEquals(innerBean.getName(), "ken");
Assert.assertEquals(innerBean.getJob(), "engineer");
+ Assert.assertTrue(innerBean.getRank() == 2);
Assert.assertNotNull(outerControl2);
}
Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Ext1Bean.beaninfo Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Ext1Bean.beaninfo?view=diff&rev=124852&p1=incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Ext1Bean.beaninfo&r1=124851&p2=incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Ext1Bean.beaninfo&r2=124852 ============================================================================== --- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Ext1Bean.beaninfo (original) +++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Ext1Bean.beaninfo Mon Jan 10 16:16:04 2005 @@ -169,6 +169,24 @@ </method-descriptor> </method-descriptors> <property-descriptors default-index=-1> + <property-descriptor name="controlImplementation"> + type="java.lang.String" + isBound=false + isConstrained=false + isDefault=false> + <read-method> + public java.lang.String org.apache.beehive.controls.test.controls.inherit.Intf1Bean.getControlImplementation() + </read-method> + <feature-descriptor name="controlImplementation" + full-name="controlImplementation" + is-expert=false + is-hidden=false + is-preferred=false> + <short-description> + controlImplementation + </short-description> + </feature-descriptor> + </property-descriptor> <property-descriptor name="intf1Prop1"> type="int" isBound=false @@ -178,7 +196,7 @@ public int org.apache.beehive.controls.test.controls.inherit.Intf1Bean.getIntf1Prop1() </read-method> <write-method> - public void org.apache.beehive.controls.test.controls.inherit.Intf1Bean.setIntf1Prop1(int) + public synchronized void org.apache.beehive.controls.test.controls.inherit.Intf1Bean.setIntf1Prop1(int) </write-method> <feature-descriptor name="intf1Prop1" full-name="intf1Prop1" @@ -199,7 +217,7 @@ public int org.apache.beehive.controls.test.controls.inherit.Intf1Bean.getIntf1Prop2() </read-method> <write-method> - public void org.apache.beehive.controls.test.controls.inherit.Intf1Bean.setIntf1Prop2(int) + public synchronized void org.apache.beehive.controls.test.controls.inherit.Intf1Bean.setIntf1Prop2(int) </write-method> <feature-descriptor name="intf1Prop2" full-name="intf1Prop2" @@ -220,7 +238,7 @@ public int org.apache.beehive.controls.test.controls.inherit.Intf2Bean.getIntf2Prop1() </read-method> <write-method> - public void org.apache.beehive.controls.test.controls.inherit.Intf2Bean.setIntf2Prop1(int) + public synchronized void org.apache.beehive.controls.test.controls.inherit.Intf2Bean.setIntf2Prop1(int) </write-method> <feature-descriptor name="intf2Prop1" full-name="intf2Prop1" @@ -241,7 +259,7 @@ public int org.apache.beehive.controls.test.controls.inherit.Intf2Bean.getIntf2Prop2() </read-method> <write-method> - public void org.apache.beehive.controls.test.controls.inherit.Intf2Bean.setIntf2Prop2(int) + public synchronized void org.apache.beehive.controls.test.controls.inherit.Intf2Bean.setIntf2Prop2(int) </write-method> <feature-descriptor name="intf2Prop2" full-name="intf2Prop2"
Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Ext2Bean.beaninfo Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Ext2Bean.beaninfo?view=diff&rev=124852&p1=incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Ext2Bean.beaninfo&r1=124851&p2=incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Ext2Bean.beaninfo&r2=124852 ============================================================================== --- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Ext2Bean.beaninfo (original) +++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Ext2Bean.beaninfo Mon Jan 10 16:16:04 2005 @@ -199,6 +199,24 @@ </method-descriptor> </method-descriptors> <property-descriptors default-index=-1> + <property-descriptor name="controlImplementation"> + type="java.lang.String" + isBound=false + isConstrained=false + isDefault=false> + <read-method> + public java.lang.String org.apache.beehive.controls.test.controls.inherit.Intf1Bean.getControlImplementation() + </read-method> + <feature-descriptor name="controlImplementation" + full-name="controlImplementation" + is-expert=false + is-hidden=false + is-preferred=false> + <short-description> + controlImplementation + </short-description> + </feature-descriptor> + </property-descriptor> <property-descriptor name="intf1Prop1"> type="int" isBound=false @@ -208,7 +226,7 @@ public int org.apache.beehive.controls.test.controls.inherit.Intf1Bean.getIntf1Prop1() </read-method> <write-method> - public void org.apache.beehive.controls.test.controls.inherit.Intf1Bean.setIntf1Prop1(int) + public synchronized void org.apache.beehive.controls.test.controls.inherit.Intf1Bean.setIntf1Prop1(int) </write-method> <feature-descriptor name="intf1Prop1" full-name="intf1Prop1" @@ -229,7 +247,7 @@ public int org.apache.beehive.controls.test.controls.inherit.Intf1Bean.getIntf1Prop2() </read-method> <write-method> - public void org.apache.beehive.controls.test.controls.inherit.Intf1Bean.setIntf1Prop2(int) + public synchronized void org.apache.beehive.controls.test.controls.inherit.Intf1Bean.setIntf1Prop2(int) </write-method> <feature-descriptor name="intf1Prop2" full-name="intf1Prop2" @@ -250,7 +268,7 @@ public int org.apache.beehive.controls.test.controls.inherit.Intf2Bean.getIntf2Prop1() </read-method> <write-method> - public void org.apache.beehive.controls.test.controls.inherit.Intf2Bean.setIntf2Prop1(int) + public synchronized void org.apache.beehive.controls.test.controls.inherit.Intf2Bean.setIntf2Prop1(int) </write-method> <feature-descriptor name="intf2Prop1" full-name="intf2Prop1" @@ -271,7 +289,7 @@ public int org.apache.beehive.controls.test.controls.inherit.Intf2Bean.getIntf2Prop2() </read-method> <write-method> - public void org.apache.beehive.controls.test.controls.inherit.Intf2Bean.setIntf2Prop2(int) + public synchronized void org.apache.beehive.controls.test.controls.inherit.Intf2Bean.setIntf2Prop2(int) </write-method> <feature-descriptor name="intf2Prop2" full-name="intf2Prop2"
Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Intf1Bean.beaninfo Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Intf1Bean.beaninfo?view=diff&rev=124852&p1=incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Intf1Bean.beaninfo&r1=124851&p2=incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Intf1Bean.beaninfo&r2=124852 ============================================================================== --- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Intf1Bean.beaninfo (original) +++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Intf1Bean.beaninfo Mon Jan 10 16:16:04 2005 @@ -79,6 +79,24 @@ </method-descriptor> </method-descriptors> <property-descriptors default-index=-1> + <property-descriptor name="controlImplementation"> + type="java.lang.String" + isBound=false + isConstrained=false + isDefault=false> + <read-method> + public java.lang.String org.apache.beehive.controls.test.controls.inherit.Intf1Bean.getControlImplementation() + </read-method> + <feature-descriptor name="controlImplementation" + full-name="controlImplementation" + is-expert=false + is-hidden=false + is-preferred=false> + <short-description> + controlImplementation + </short-description> + </feature-descriptor> + </property-descriptor> <property-descriptor name="intf1Prop1"> type="int" isBound=false @@ -88,7 +106,7 @@ public int org.apache.beehive.controls.test.controls.inherit.Intf1Bean.getIntf1Prop1() </read-method> <write-method> - public void org.apache.beehive.controls.test.controls.inherit.Intf1Bean.setIntf1Prop1(int) + public synchronized void org.apache.beehive.controls.test.controls.inherit.Intf1Bean.setIntf1Prop1(int) </write-method> <feature-descriptor name="intf1Prop1" full-name="intf1Prop1" @@ -109,7 +127,7 @@ public int org.apache.beehive.controls.test.controls.inherit.Intf1Bean.getIntf1Prop2() </read-method> <write-method> - public void org.apache.beehive.controls.test.controls.inherit.Intf1Bean.setIntf1Prop2(int) + public synchronized void org.apache.beehive.controls.test.controls.inherit.Intf1Bean.setIntf1Prop2(int) </write-method> <feature-descriptor name="intf1Prop2" full-name="intf1Prop2"
Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Intf2Bean.beaninfo Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Intf2Bean.beaninfo?view=diff&rev=124852&p1=incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Intf2Bean.beaninfo&r1=124851&p2=incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Intf2Bean.beaninfo&r2=124852 ============================================================================== --- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Intf2Bean.beaninfo (original) +++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/inherit/Intf2Bean.beaninfo Mon Jan 10 16:16:04 2005 @@ -139,6 +139,24 @@ </method-descriptor> </method-descriptors> <property-descriptors default-index=-1> + <property-descriptor name="controlImplementation"> + type="java.lang.String" + isBound=false + isConstrained=false + isDefault=false> + <read-method> + public java.lang.String org.apache.beehive.controls.test.controls.inherit.Intf1Bean.getControlImplementation() + </read-method> + <feature-descriptor name="controlImplementation" + full-name="controlImplementation" + is-expert=false + is-hidden=false + is-preferred=false> + <short-description> + controlImplementation + </short-description> + </feature-descriptor> + </property-descriptor> <property-descriptor name="intf1Prop1"> type="int" isBound=false @@ -148,7 +166,7 @@ public int org.apache.beehive.controls.test.controls.inherit.Intf1Bean.getIntf1Prop1() </read-method> <write-method> - public void org.apache.beehive.controls.test.controls.inherit.Intf1Bean.setIntf1Prop1(int) + public synchronized void org.apache.beehive.controls.test.controls.inherit.Intf1Bean.setIntf1Prop1(int) </write-method> <feature-descriptor name="intf1Prop1" full-name="intf1Prop1" @@ -169,7 +187,7 @@ public int org.apache.beehive.controls.test.controls.inherit.Intf1Bean.getIntf1Prop2() </read-method> <write-method> - public void org.apache.beehive.controls.test.controls.inherit.Intf1Bean.setIntf1Prop2(int) + public synchronized void org.apache.beehive.controls.test.controls.inherit.Intf1Bean.setIntf1Prop2(int) </write-method> <feature-descriptor name="intf1Prop2" full-name="intf1Prop2" @@ -190,7 +208,7 @@ public int org.apache.beehive.controls.test.controls.inherit.Intf2Bean.getIntf2Prop1() </read-method> <write-method> - public void org.apache.beehive.controls.test.controls.inherit.Intf2Bean.setIntf2Prop1(int) + public synchronized void org.apache.beehive.controls.test.controls.inherit.Intf2Bean.setIntf2Prop1(int) </write-method> <feature-descriptor name="intf2Prop1" full-name="intf2Prop1" @@ -211,7 +229,7 @@ public int org.apache.beehive.controls.test.controls.inherit.Intf2Bean.getIntf2Prop2() </read-method> <write-method> - public void org.apache.beehive.controls.test.controls.inherit.Intf2Bean.setIntf2Prop2(int) + public synchronized void org.apache.beehive.controls.test.controls.inherit.Intf2Bean.setIntf2Prop2(int) </write-method> <feature-descriptor name="intf2Prop2" full-name="intf2Prop2"
Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/binding/TestControlBinding.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/binding/TestControlBinding.java?view=diff&rev=124852&p1=incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/binding/TestControlBinding.java&r1=124851&p2=incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/binding/TestControlBinding.java&r2=124852 ============================================================================== --- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/binding/TestControlBinding.java (original) +++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/binding/TestControlBinding.java Mon Jan 10 16:16:04 2005 @@ -11,7 +11,6 @@ public TestControlBinding(String s){super(s);}
@Freq("checkin")
- @Status("inactive")
@Desc("Test that a control implementation can be overridden with binding: " +
"http://issues.apache.org/jira/browse/BEEHIVE-20")
public void testBindingOverride() throws Exception
Modified: incubator/beehive/trunk/controls/test/webapps/controlsWeb/binding/BindingTests.jpf
Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/webapps/controlsWeb/binding/BindingTests.jpf?view=diff&rev=124852&p1=incubator/beehive/trunk/controls/test/webapps/controlsWeb/binding/BindingTests.jpf&r1=124851&p2=incubator/beehive/trunk/controls/test/webapps/controlsWeb/binding/BindingTests.jpf&r2=124852
==============================================================================
--- incubator/beehive/trunk/controls/test/webapps/controlsWeb/binding/BindingTests.jpf (original)
+++ incubator/beehive/trunk/controls/test/webapps/controlsWeb/binding/BindingTests.jpf Mon Jan 10 16:16:04 2005
@@ -24,6 +24,7 @@
import org.apache.beehive.controls.api.bean.Control;
import org.apache.beehive.controls.api.bean.ControlBean;
+import org.apache.beehive.controls.api.properties.BaseProperties;
import org.apache.beehive.controls.test.controls.binding.BindingTestControl;
import org.apache.beehive.controls.test.controls.binding.DefaultBindingTestControl;
@@ -39,6 +40,7 @@ {
@Control
+ @BaseProperties( controlImplementation="org.apache.beehive.controls.test.controls.binding.BindingTestControlOverrideImpl" )
public BindingTestControl btc;
@Control
