You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by cs...@apache.org on 2006/07/06 18:45:24 UTC
svn commit: r419614 [2/6] - in /beehive/trunk/controls/test: ./
src/controls/org/apache/beehive/controls/test/controls/assembly/
src/controls/org/apache/beehive/controls/test/controls/beaninfo/
src/controls/org/apache/beehive/controls/test/controls/gen...
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/ExtPropertySet.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/ExtPropertySet.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/ExtPropertySet.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/ExtPropertySet.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2006 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.encoding;
+
+import org.apache.beehive.controls.api.properties.PropertySet;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * An externally defined property set.
+ */
+@PropertySet
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD})
+public @interface ExtPropertySet {
+ public static final int AGE_DEFAULT = 5;
+
+ public int age() default org.apache.beehive.controls.test.controls.encoding.ExtPropertySet.AGE_DEFAULT;
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/ExtPropertySet.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/NestProps.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/NestProps.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/NestProps.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/NestProps.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2006 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.encoding;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+
+import java.lang.annotation.Annotation;
+
+/**
+ * A simple control that nests the Props control, for nested property testing.
+ */
+@ControlInterface
+public interface NestProps extends Props {
+ //
+ // Returns a propertySet value for a simple nested control
+ //
+ public Annotation getNestedPropertySet(Class propertySet);
+
+ //
+ // Returns a propertySet value for an extension nested control
+ //
+ public Annotation getExtensionControlPropertySet(Class propertySet);
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/NestProps.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/NestPropsImpl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/NestPropsImpl.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/NestPropsImpl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/NestPropsImpl.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2006 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.encoding;
+
+import org.apache.beehive.controls.api.bean.Control;
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import org.apache.beehive.controls.api.context.Context;
+import org.apache.beehive.controls.api.context.ControlBeanContext;
+import org.apache.beehive.controls.api.events.Client;
+import org.apache.beehive.controls.api.events.EventHandler;
+
+import java.beans.PropertyChangeEvent;
+import java.lang.annotation.Annotation;
+
+@ControlImplementation
+public class NestPropsImpl implements NestProps, java.io.Serializable {
+ static final long serialVersionUID = 1L;
+
+ @Context
+ ControlBeanContext context;
+
+ @Control
+ @SimpleProps(simpleString = "A field annotation value")
+ Props propControl;
+
+ @Control
+ @ArrayProps(arrayString = {"One", "Two", "Three"})
+ private PropsExtension propExtControl;
+
+ @Client
+ PropertyEvents client;
+
+ /**
+ * Provides a simple test API to externally query the PropertySet values on this
+ * control.
+ */
+ public Annotation getControlPropertySet(Class propertySet) {
+ return context.getControlPropertySet(propertySet);
+ }
+
+ /**
+ * Provides a simple test API to externally query the PropertySet values on a
+ * nested control.
+ */
+ public Annotation getNestedPropertySet(Class propertySet) {
+ return propControl.getControlPropertySet(propertySet);
+ }
+
+ public Annotation getExtensionControlPropertySet(Class propertySet) {
+ return propExtControl.getControlPropertySet(propertySet);
+ }
+
+ //
+ // Expose PropertyEvents from three potential sources: local properties, or from either of
+ // the two nested controls
+ //
+ @EventHandler(field = "context", eventSet = ControlBeanContext.LifeCycle.class,
+ eventName = "onPropertyChange")
+ public void onContextChange(PropertyChangeEvent pce) {
+ client.onChange(pce);
+ }
+
+ @EventHandler(field = "propControl", eventSet = PropertyEvents.class,
+ eventName = "onChange")
+ public void onPropsChange(PropertyChangeEvent pce) {
+ client.onChange(pce);
+ }
+
+ @EventHandler(field = "propExtControl", eventSet = PropertyEvents.class,
+ eventName = "onChange")
+ public void onExtPropsChange(PropertyChangeEvent pce) {
+ client.onChange(pce);
+ }
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/NestPropsImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/Props.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/Props.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/Props.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/Props.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,134 @@
+/*
+ * Copyright 2006 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.encoding;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+import org.apache.beehive.controls.api.bean.ExternalPropertySets;
+import org.apache.beehive.controls.api.events.EventSet;
+import org.apache.beehive.controls.api.packaging.PropertyInfo;
+import org.apache.beehive.controls.api.properties.PropertySet;
+
+import java.beans.PropertyChangeEvent;
+import java.lang.annotation.Annotation;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * A simple control that can be used for property testing of basic primitive properties,
+ * as well as nested an array property types.
+ */
+@ControlInterface
+@ExternalPropertySets({ExtPropertySet.class})
+public interface Props {
+ //
+ // A simple enumeration used to test enum annotations
+ //
+ public enum SimpleEnum {
+ ChoiceA, ChoiceB, ChoiceC; }
+
+ //
+ // Define static final constants for SimpleProps defaults
+ //
+ static final int INT_DEFAULT = 87;
+ static final String STRING_DEFAULT = "Hello";
+ static final Class CLASS_DEFAULT = Object.class;
+ static final org.apache.beehive.controls.test.controls.encoding.Props.SimpleEnum ENUM_DEFAULT = org.apache.beehive.controls.test.controls.encoding.Props.SimpleEnum.ChoiceA;
+
+ //
+ //
+ // Define a PropertySet that tests simple types
+ //
+ @PropertySet
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD})
+ public @interface SimpleProps {
+ int simpleInt() default org.apache.beehive.controls.test.controls.encoding.Props.INT_DEFAULT;
+
+ String simpleString() default org.apache.beehive.controls.test.controls.encoding.Props.STRING_DEFAULT;
+
+ Class simpleClass() default Object.class;
+
+ org.apache.beehive.controls.test.controls.encoding.Props.SimpleEnum simpleEnum() default org.apache.beehive.controls.test.controls.encoding.Props.SimpleEnum.ChoiceA;
+ }
+
+ //
+ // Define static final constants for ArrayProps defaults
+ //
+ static final int [] ARRAY_INT_DEFAULT = {99, 33, 66, 22};
+ static final String [] ARRAY_STRING_DEFAULT = {"How", "are", "you", ",", "today", "?"};
+ static final Class [] ARRAY_CLASS_DEFAULT = {java.util.HashMap.class, java.util.Iterator.class};
+ static final org.apache.beehive.controls.test.controls.encoding.Props.SimpleEnum [] ARRAY_ENUM_DEFAULT = {org.apache.beehive.controls.test.controls.encoding.Props.SimpleEnum.ChoiceB, org.apache.beehive.controls.test.controls.encoding.Props.SimpleEnum.ChoiceC};
+
+ //
+ // Define a PropertySet that tests array types
+ //
+ @PropertySet
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target({ElementType.TYPE, ElementType.FIELD})
+ public @interface ArrayProps {
+ int [] arrayInt() default {99, 33, 66, 22};
+
+ String [] arrayString() default {"How", "are", "you", ",", "today", "?"};
+
+ Class [] arrayClass() default {java.util.HashMap.class, java.util.Iterator.class};
+
+ org.apache.beehive.controls.test.controls.encoding.Props.SimpleEnum [] arrayEnum() default {org.apache.beehive.controls.test.controls.encoding.Props.SimpleEnum.ChoiceB, org.apache.beehive.controls.test.controls.encoding.Props.SimpleEnum.ChoiceC};
+ }
+
+ //
+ // Define static final constants for SimpleProps defaults
+ //
+ static final int ANNOT_INT_DEFAULT = 9999999;
+ static final String ANNOT_STRING_DEFAULT = "Hola";
+ static final Class ANNOT_CLASS_DEFAULT = java.beans.Beans.class;
+ static final org.apache.beehive.controls.test.controls.encoding.Props.SimpleEnum ANNOT_ENUM_DEFAULT = org.apache.beehive.controls.test.controls.encoding.Props.SimpleEnum.ChoiceC;
+
+ //
+ // Define a PropertySet that tests properties that are themselves annotation types
+ //
+ @PropertySet
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD})
+ public @interface TestAnnot {
+ @PropertyInfo(bound = true) // will generate PropertyChange events
+ org.apache.beehive.controls.test.controls.encoding.Props.SimpleProps simpleAnnot()
+ default @org.apache.beehive.controls.test.controls.encoding.Props.SimpleProps(
+ simpleInt = org.apache.beehive.controls.test.controls.encoding.Props.ANNOT_INT_DEFAULT,
+ simpleString = org.apache.beehive.controls.test.controls.encoding.Props.ANNOT_STRING_DEFAULT,
+ simpleClass = java.beans.Beans.class,
+ simpleEnum = org.apache.beehive.controls.test.controls.encoding.Props.SimpleEnum.ChoiceC);
+
+ org.apache.beehive.controls.test.controls.encoding.Props.ArrayProps arrayAnnot();
+ }
+
+ //
+ // Exposes PropertyChange events to an external client.
+ //
+ @EventSet
+ public interface PropertyEvents {
+ public void onChange(PropertyChangeEvent pce);
+ }
+
+ //
+ // Define property keys to enable access to test members in a PropertyMap
+ //
+ public Annotation getControlPropertySet(Class propertySet);
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/Props.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/PropsExtension.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/PropsExtension.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/PropsExtension.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/PropsExtension.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2006 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.encoding;
+
+import org.apache.beehive.controls.api.bean.ControlExtension;
+
+/**
+ * Defines a new extension interface that derives from Props
+ */
+@ControlExtension
+@org.apache.beehive.controls.test.controls.property.Props.SimpleProps(simpleInt = 3)
+// matches INT_PRIM_VALUE below
+public interface PropsExtension extends Props {
+ // the class annotation value set above
+ public static int SIMPLE_INT_VALUE = 3;
+
+ // the method annotation vales set below
+ public static Class SIMPLE_CLASS_VALUE1 = java.beans.Beans.class;
+ public static Class SIMPLE_CLASS_VALUE2 = org.apache.beehive.controls.api.bean.ControlBean.class;
+
+ @SimpleProps(simpleClass = java.beans.Beans.class)
+ public Object getPropertySetOnMethod1(Class propertySet);
+
+ @SimpleProps(simpleClass = org.apache.beehive.controls.api.bean.ControlBean.class)
+ public Object getPropertySetOnMethod2(Class propertySet);
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/PropsExtension.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/PropsImpl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/PropsImpl.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/PropsImpl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/PropsImpl.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2006 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.encoding;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import org.apache.beehive.controls.api.bean.Extensible;
+import org.apache.beehive.controls.api.context.Context;
+import org.apache.beehive.controls.api.context.ControlBeanContext;
+import org.apache.beehive.controls.api.events.Client;
+import org.apache.beehive.controls.api.events.EventHandler;
+import org.apache.beehive.controls.api.properties.PropertySet;
+
+import java.beans.PropertyChangeEvent;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+
+@ControlImplementation
+public class PropsImpl implements Props, Extensible, java.io.Serializable {
+ static final long serialVersionUID = 1L;
+
+ @Context
+ ControlBeanContext context;
+
+ @Client
+ PropertyEvents client;
+
+ /**
+ * Provides a simple test API to externally query the control instance PropertySet values
+ * returned by ControlBeanContext APIs
+ */
+ public Annotation getControlPropertySet(Class propertySet) {
+ return context.getControlPropertySet(propertySet);
+ }
+
+ /**
+ * Set up a handler for context property change events, then expose them using the
+ * EventSet declared on the public interface.
+ */
+ @EventHandler(field = "context", eventSet = ControlBeanContext.LifeCycle.class,
+ eventName = "onPropertyChange")
+ public void onContextChange(PropertyChangeEvent pce) {
+ client.onChange(pce);
+ }
+
+ /**
+ * This implementation of Extensible.invoke allows the testing of annotations found
+ * on JCX methods
+ */
+ public Object invoke(Method m, Object [] args) throws Throwable {
+ if (!(args[0] instanceof Class) ||
+ !(((Class) args[0]).isAnnotationPresent(PropertySet.class)))
+ throw new IllegalArgumentException("Arg 0 must be an PropertySet interface!");
+
+ return context.getMethodPropertySet(m, (Class) args[0]);
+ }
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/encoding/PropsImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/event/Event2Listener.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/event/Event2Listener.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/event/Event2Listener.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/event/Event2Listener.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,63 @@
+/*
+ * 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:$
+ */
+package org.apache.beehive.controls.test.controls.event;
+
+
+/**
+ * A listener class for Hello.EventSet2 event
+ */
+public class Event2Listener implements Hello.EventSet2 {
+ private String method1Result = "method1NotReceived";
+ private String method2Result = "set2method2NotReceived";
+ private String overloadMethod1 = "overloadMethod1NotReceived";
+ private String overloadMethod2 = "overloadMethod2NotReceived";
+
+
+ public void method1() {
+ //Event received, flip the counter
+ method1Result = "0";
+ }
+
+ public int set2Method2() {
+ //Event received, flip the counter
+ method2Result = "0";
+ return 0;
+ }
+
+ public boolean set2OverloadedMethod() {
+ //Event received, flip the counter
+ overloadMethod1 = "0";
+ return true;
+ }
+
+ public boolean set2OverloadedMethod(int anArg) {
+ //Event received, flip the counter
+ overloadMethod2 = "0";
+ return true;
+ }
+
+ public String getMethod2Result() {
+
+ return method2Result;
+ }
+
+ public String getAllResult() {
+
+ return method1Result + method2Result + overloadMethod1 + overloadMethod2;
+ }
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/event/Event2Listener.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/event/Hello.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/event/Hello.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/event/Hello.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/event/Hello.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,54 @@
+/*
+ * 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.event;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+import org.apache.beehive.controls.api.events.EventSet;
+
+/**
+ * A ControlInterface that declares three events
+ */
+@ControlInterface
+public interface Hello {
+
+ @EventSet
+ public interface EventSet0 {
+ }
+
+
+ @EventSet
+ public interface EventSet1 {
+ public void method1();
+ }
+
+ @EventSet(unicast = true)
+ public interface EventSet2 {
+ public void method1();
+
+ public int set2Method2();
+
+ public boolean set2OverloadedMethod();
+
+ public boolean set2OverloadedMethod(int anArg);
+ }
+
+ public void triggerEvents();
+
+ public void triggerEventsUsingHandle();
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/event/Hello.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/event/HelloImpl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/event/HelloImpl.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/event/HelloImpl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/event/HelloImpl.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,88 @@
+/*
+ * 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.event;
+
+import org.apache.beehive.controls.api.ControlException;
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import org.apache.beehive.controls.api.context.Context;
+import org.apache.beehive.controls.api.context.ControlBeanContext;
+import org.apache.beehive.controls.api.context.ControlHandle;
+import org.apache.beehive.controls.api.events.Client;
+import org.apache.beehive.controls.api.events.EventRef;
+
+/**
+ * A control implementation that raises events when the method is invoked
+ */
+@ControlImplementation
+public class HelloImpl implements Hello, java.io.Serializable {
+ @Client
+ private Hello.EventSet0 eventSet0;
+ @Client
+ private Hello.EventSet1 eventSet1;
+ @Client
+ private Hello.EventSet2 eventSet2;
+
+ @Context
+ private ControlBeanContext beanContext;
+
+ public void triggerEvents() {
+ eventSet1.method1();
+ eventSet2.method1();
+ eventSet2.set2Method2();
+ eventSet2.set2OverloadedMethod();
+ eventSet2.set2OverloadedMethod(68);
+
+ }
+
+ public void triggerEventsUsingHandle() {
+ ControlHandle handle = beanContext.getControlHandle();
+ if (handle == null)
+ throw new ControlException("No control handle for context:" + beanContext);
+
+ Object [] emptyArgs = new Object []{};
+
+ try {
+ // Create an event ref using the method descriptor string format
+ EventRef eventRef = new EventRef(Hello.EventSet1.class.getName() + ".method1()V");
+ handle.sendEvent(eventRef, emptyArgs);
+
+ // Create an event ref using Method reflection
+ eventRef = new EventRef(Hello.EventSet2.class.getMethod("method1", new Class []{}));
+ handle.sendEvent(eventRef, emptyArgs);
+
+ // Create an event ref using string descriptor, the serialize/deserialize before use
+ eventRef = new EventRef(Hello.EventSet2.class.getName() + ".set2Method2()I");
+ eventRef = SerializeUtils.testSerialize(eventRef);
+ handle.sendEvent(eventRef, emptyArgs);
+
+ // Create an event ref using Method reflection, then serialize/deserialize before use
+ eventRef = new EventRef(Hello.EventSet2.class.getMethod("set2OverloadedMethod",
+ new Class []{}));
+ eventRef = SerializeUtils.testSerialize(eventRef);
+ handle.sendEvent(eventRef, emptyArgs);
+
+ // Create an event ref using string descriptor, where arg matching is required
+ eventRef = new EventRef(Hello.EventSet2.class.getName() + ".set2OverloadedMethod(I)Z");
+ handle.sendEvent(eventRef, new Object []{68});
+ }
+ catch (Exception e) {
+ throw new ControlException("Event dispatch error", e);
+ }
+ }
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/event/HelloImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/event/SerializeUtils.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/event/SerializeUtils.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/event/SerializeUtils.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/event/SerializeUtils.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,97 @@
+/*
+ * 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:$
+ */
+package org.apache.beehive.controls.test.controls.event;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+/**
+ * Utility code for testing serialization behavior
+ */
+public final class SerializeUtils {
+ /**
+ * Serializes an object into a byte array, then deserializes it from the array and returns
+ * the deserialized object.
+ */
+ public static <T extends Object> T testSerialize(T obj) {
+ byte [] serializedObject;
+ T returnObject;
+
+ ByteArrayOutputStream baos = null;
+ ObjectOutputStream oos = null;
+ try {
+ baos = new ByteArrayOutputStream();
+ oos = new ObjectOutputStream(baos);
+ oos.writeObject(obj);
+ oos.flush();
+ serializedObject = baos.toByteArray();
+ }
+ catch (Exception e) {
+ throw new RuntimeException("Error serializing object", e);
+ }
+ finally {
+ if (oos != null)
+ try {
+ oos.close();
+ }
+ catch (IOException ignore) {
+ }
+ if (baos != null)
+ try {
+ baos.close();
+ }
+ catch (IOException ignore) {
+ }
+ }
+
+ ByteArrayInputStream bais = null;
+ ObjectInputStream ois = null;
+ try {
+ bais = new ByteArrayInputStream(serializedObject);
+ ois = new ObjectInputStream(bais);
+ returnObject = (T) ois.readObject();
+ ois.close();
+ bais.close();
+ }
+ catch (Exception e) {
+ throw new RuntimeException("Error deserializing object", e);
+ }
+ finally {
+ if (bais != null)
+ try {
+ bais.close();
+ }
+ catch (IOException ignore) {
+ }
+ if (ois != null)
+ try {
+ ois.close();
+ }
+ catch (IOException ignore) {
+ }
+ }
+
+ if (!obj.equals(returnObject))
+ throw new RuntimeException("Deserialized object is not equivalent to original!");
+
+ return returnObject;
+ }
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/event/SerializeUtils.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/ExtendedSimpleControl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/ExtendedSimpleControl.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/ExtendedSimpleControl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/ExtendedSimpleControl.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,30 @@
+/*
+ * 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.generic;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+
+/**
+ * This test interface does an extension of a generic type while binding some of the
+ * formal type parameters. This ensures that the type binding is properly applied
+ * to the code-generated bean types.
+ */
+@ControlInterface
+public interface ExtendedSimpleControl extends SimpleControl<Integer> {
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/ExtendedSimpleControl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/ExtendedSimpleControlImpl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/ExtendedSimpleControlImpl.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/ExtendedSimpleControlImpl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/ExtendedSimpleControlImpl.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,27 @@
+/*
+ * 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.generic;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+
+@ControlImplementation
+public class ExtendedSimpleControlImpl
+ extends SimpleControlImpl<Integer>
+ implements ExtendedSimpleControl, java.io.Serializable {
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/ExtendedSimpleControlImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/ListControl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/ListControl.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/ListControl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/ListControl.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,66 @@
+/*
+ * 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.generic;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+import org.apache.beehive.controls.api.events.EventSet;
+import org.apache.beehive.controls.api.properties.PropertySet;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+@ControlInterface
+public interface ListControl<E, T extends List<? extends E>> {
+ //
+ // Note: JSR-175 annotation types cannot have formal type parameters
+ //
+ @PropertySet
+ @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD})
+ @Retention(RetentionPolicy.RUNTIME)
+ public static @interface ListProps {
+ /**
+ * This property can be used to set the concrete List implementation
+ * to use for containing elements
+ */
+ Class<? extends List> listClass() default ArrayList.class;
+ }
+
+ public void add(E val);
+
+ public <X extends E> boolean contains(X val);
+
+ public E get(int index);
+
+ public T copy(Collection<? extends E> src);
+
+ public <X extends E> E getLast(Collection<X> coll);
+
+ //
+ // Test an EventSet that uses formal type paramters defined in the outer control interface.
+ //
+ @EventSet(unicast = true)
+ public interface ListEvents<E> {
+ public E onAdd(E newElement);
+ }
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/ListControl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/ListControlImpl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/ListControlImpl.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/ListControlImpl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/ListControlImpl.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,112 @@
+/*
+ * 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.generic;
+
+import org.apache.beehive.controls.api.ControlException;
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import org.apache.beehive.controls.api.bean.Extensible;
+import org.apache.beehive.controls.api.context.Context;
+import org.apache.beehive.controls.api.context.ControlBeanContext;
+import org.apache.beehive.controls.api.events.Client;
+import org.apache.beehive.controls.api.events.EventHandler;
+
+import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+@ControlImplementation
+public class ListControlImpl<E, T extends List<E>>
+ implements ListControl<E, T>, Extensible, java.io.Serializable {
+ @Context
+ ControlBeanContext context;
+
+ @EventHandler(field = "context", eventSet = ControlBeanContext.LifeCycle.class,
+ eventName = "onCreate")
+ public void onCreate() {
+ }
+
+ @Client
+ ListEvents<E> client;
+
+ /**
+ * Returns the list used to store control elements. This is lazily instantiated, to
+ * allow the list class to be set by either an annotation or by calling setListClass()
+ * on the bean prior to manipulating the list.
+ */
+ private T getList() {
+ if (_list == null) {
+ Class<? extends List> listClass =
+ context.getControlPropertySet(ListProps.class).listClass();
+ try {
+ _list = (T) listClass.newInstance();
+ }
+ catch (Exception e) {
+ throw new ControlException("Cannot create List", e);
+ }
+ }
+ return _list;
+ }
+
+ public void add(E val) {
+ getList().add(val);
+ client.onAdd(val);
+ }
+
+ ;
+
+ public <X extends E> boolean contains(X val) {
+ return getList().contains(val);
+ }
+
+ public E get(int index) {
+ return getList().get(index);
+ }
+
+ public T copy(Collection<? extends E> src) {
+ T list = getList();
+ for (E item : src)
+ list.add(item);
+
+ return list;
+ }
+
+ public <X extends E> E getLast(Collection<X> coll) {
+ E last = null;
+ Iterator<X> collIter = coll.iterator();
+ while (collIter.hasNext())
+ last = collIter.next();
+
+ return last;
+ }
+
+ /**
+ * TBD
+ */
+ public Object invoke(Method method, Object [] args) throws Throwable {
+ // To Be Implemented
+ //
+ return null;
+ }
+
+ //
+ // NEVER ACCESS DIRECTLY... ALWAYS CALL GETLIST()!!!!
+ //
+ T _list;
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/ListControlImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/SimpleControl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/SimpleControl.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/SimpleControl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/SimpleControl.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,35 @@
+/*
+ * 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.generic;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+
+import java.util.Vector;
+
+/**
+ * A simple control interface declared with type parameter
+ * and uses an API with type parameters
+ */
+@ControlInterface
+public interface SimpleControl<P> {
+
+ public void setThem(Vector<P> v);
+
+ public P getTheFirst();
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/SimpleControl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/SimpleControlImpl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/SimpleControlImpl.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/SimpleControlImpl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/SimpleControlImpl.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,37 @@
+/*
+ * 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.generic;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+
+import java.util.Vector;
+
+@ControlImplementation
+public class SimpleControlImpl<P> implements SimpleControl<P>, java.io.Serializable {
+ private Vector<P> mylist = new Vector<P>();
+
+ public void setThem(Vector<P> v) {
+ mylist = v;
+ }
+
+ public P getTheFirst() {
+ return mylist.get(0);
+ }
+
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/generic/SimpleControlImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/AddIn.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/AddIn.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/AddIn.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/AddIn.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,35 @@
+/*
+ * 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.inherit;
+
+/**
+ * This is a regular interface that will be extended to add operation and events to a subclassed
+ * ControlInterface
+ */
+public interface AddIn {
+ public void addInOperation1();
+
+ public void addInOperation2();
+
+ public interface AddInEvents {
+ public void addInEvent1();
+
+ public void addInEvent2();
+ }
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/AddIn.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Ext1.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Ext1.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Ext1.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Ext1.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,56 @@
+/*
+ * 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.inherit;
+
+import org.apache.beehive.controls.api.bean.ControlExtension;
+import org.apache.beehive.controls.api.events.EventSet;
+
+/**
+ * This is the third level interface for the inheritence test hiearachy. It defines a
+ * ControlExtension interface that extends the 2nd level ControlInterface
+ */
+@ControlExtension
+public interface Ext1 extends Intf2 {
+ @Intf1Props(intf1Prop1 = 1)
+ public int [] ext1Operation1();
+
+ @Intf2Props(intf2Prop2 = 2)
+ public int [] ext1Operation2();
+
+ @EventSet
+ public interface Ext1Events extends Intf2Events {
+ @Intf1Props(intf1Prop1 = 1)
+ public void ext1Event1();
+
+ @Intf2Props(intf2Prop2 = 2)
+ public void ext1Event2();
+ }
+
+ /**
+ * Declare an EventSet that is new and unique to this extension
+ */
+ @EventSet(unicast = true)
+ public interface Ext1NewEvents {
+ @Intf1Props(intf1Prop1 = 1)
+ public void ext1NewEvent1();
+
+ @Intf2Props(intf2Prop2 = 2)
+ public void ext2NewEvent2();
+ }
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Ext1.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Ext2.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Ext2.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Ext2.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Ext2.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,69 @@
+/*
+ * 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.inherit;
+
+import org.apache.beehive.controls.api.bean.ControlExtension;
+import org.apache.beehive.controls.api.events.EventSet;
+
+/**
+ * This is the fourth level interface for the inheritence test hiearachy. It defines a
+ * ControlExtension interface that extends another ControlExtension
+ */
+@ControlExtension
+public interface Ext2 extends Ext1 {
+ @Intf1Props(intf1Prop1 = 1)
+ public void ext2Operation1();
+
+ @Intf2Props(intf2Prop2 = 2)
+ public void ext2Operation2();
+
+ @EventSet
+ public interface Ext2Events extends Ext1Events {
+ @Intf1Props(intf1Prop1 = 1)
+ public void ext2Event1();
+
+ @Intf2Props(intf2Prop2 = 2)
+ public void ext2Event2();
+ }
+
+ /**
+ * Declare an EventSet that extends an EventSet on the original ControlInterface interface,
+ * but skips a level of inheritance
+ */
+ @EventSet
+ public interface Ext2SkipEvents extends Intf2Events {
+ @Intf1Props(intf1Prop1 = 1)
+ public void extSkip2Event1();
+
+ @Intf1Props(intf1Prop1 = 1)
+ public void extSkip2Event2();
+ }
+
+ /**
+ * Declare an EventSet that is new and unique to this extension
+ */
+ @EventSet(unicast = true)
+ public interface Ext2NewEvents {
+ @Intf1Props(intf1Prop1 = 1)
+ public void ext2NewEvent1();
+
+ @Intf2Props(intf2Prop2 = 2)
+ public void ext2NewEvent2();
+ }
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Ext2.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Hello.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Hello.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Hello.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Hello.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2006 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.inherit;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+import org.apache.beehive.controls.api.properties.PropertySet;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+@ControlInterface
+public interface Hello
+{
+ //
+ // A simple enumerated type used to customize the greeting by gender
+ //
+ public enum GenderType
+ {
+ NEUTRAL, MALE, FEMALE
+ }
+
+ public @interface Gender
+ {
+ org.apache.beehive.controls.test.controls.inherit.Hello.GenderType value();
+ }
+
+ /**
+ * Declare a simple PropertySet, that allows the salutation used by the custom
+ * control to be customized.
+ */
+ @PropertySet
+ @Target( {ElementType.TYPE, ElementType.FIELD, ElementType.METHOD} )
+ @Retention(RetentionPolicy.RUNTIME)
+ public @interface Greeting
+ {
+ String salutation() default "Hello";
+ Gender gender() default @Gender(GenderType.NEUTRAL);
+ }
+
+ String hello(String name);
+
+ String lastVisitor();
+
+ int visitorCount();
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Hello.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/HelloImpl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/HelloImpl.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/HelloImpl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/HelloImpl.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2006 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.inherit;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import org.apache.beehive.controls.api.bean.Extensible;
+
+import java.lang.reflect.Method;
+
+@ControlImplementation
+public class HelloImpl implements Hello, Extensible, java.io.Serializable
+{
+ public String _lastVisitor = "<none>";
+ int _visitorCount = 0;
+
+ public String hello(String name)
+ {
+ _lastVisitor = name;
+ _visitorCount++;
+ return "Hello, " + name;
+ }
+
+ public String lastVisitor()
+ {
+ return _lastVisitor;
+ }
+
+ public int visitorCount()
+ {
+ return _visitorCount;
+ }
+
+ /**
+ * Implements the Extensible.invoke interface when a JCX-declared method is called
+ */
+ public Object invoke(Method method, Object [] args)
+ {
+ //
+ // To Be Implemented
+ //
+ return null;
+ }
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/HelloImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Intf1.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Intf1.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Intf1.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Intf1.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,72 @@
+/*
+ * 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.inherit;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+import org.apache.beehive.controls.api.events.EventSet;
+import org.apache.beehive.controls.api.properties.PropertySet;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * This is the first level interface for the inheritence test hiearachy. It extends an interface
+ * that is not a ControlInterface, to ensure that it is possible to derive a Control from an
+ * existing interface.
+ */
+@ControlInterface
+public interface Intf1 extends Root {
+ public int intf1Operation1();
+
+ public int intf1Operation2();
+
+ /**
+ * Declare a PropertySet for this interface
+ */
+ @PropertySet
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD})
+ public @interface Intf1Props {
+ public int intf1Prop1() default 1;
+
+ public int intf1Prop2() default 2;
+ }
+
+ /**
+ * Declare an EventSet that extends one on the Root interface
+ */
+ @EventSet
+ public interface Intf1Events extends RootEvents {
+ public void intf1Event1();
+
+ public void intf1Event2();
+ }
+
+ /**
+ * Declare an EventSet that is new and unique to this interface
+ */
+ @EventSet(unicast = true)
+ public interface Intf1NewEvents {
+ public void intf1NewEvent1();
+
+ public void intf1NewEvent2();
+ }
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Intf1.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Intf1Impl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Intf1Impl.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Intf1Impl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Intf1Impl.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,60 @@
+/*
+ * 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.inherit;
+
+import org.apache.beehive.controls.api.bean.Control;
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import org.apache.beehive.controls.api.context.Context;
+import org.apache.beehive.controls.api.context.ControlBeanContext;
+import org.apache.beehive.controls.api.events.Client;
+
+/**
+ * This is the first level interface for the inheritence test hiearachy. It extends an interface
+ * that is not a ControlInterface, to ensure that it is possible to derive a Control from an
+ * existing interface.
+ */
+@ControlImplementation
+public class Intf1Impl extends RootImpl
+ implements Intf1, java.io.Serializable {
+ @Context
+ ControlBeanContext context;
+ @Client
+ Intf1Events intfEvents;
+ @Client
+ Intf1NewEvents intfNewEvents;
+
+ @Control
+ Hello _h1;
+
+ public int intf1Operation1() {
+ intfEvents.rootEvent1();
+ intfEvents.intf1Event1();
+ intfNewEvents.intf1NewEvent1();
+
+ return context.getControlPropertySet(Intf1Props.class).intf1Prop1();
+ }
+
+ public int intf1Operation2() {
+ intfEvents.rootEvent2();
+ intfEvents.intf1Event2();
+ intfNewEvents.intf1NewEvent2();
+
+ return context.getControlPropertySet(Intf1Props.class).intf1Prop2();
+ }
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Intf1Impl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Intf2.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Intf2.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Intf2.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Intf2.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,68 @@
+/*
+ * 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.inherit;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+import org.apache.beehive.controls.api.events.EventSet;
+import org.apache.beehive.controls.api.properties.PropertySet;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * This is the second level interface for the inheritence test hiearachy. It extends another
+ * ControlInterface and also adds new operations/events via an extended interface.
+ */
+@ControlInterface
+public interface Intf2 extends Intf1, AddIn {
+ public int intf2Operation1();
+
+ public int intf2Operation2();
+
+ /**
+ * Declare a PropertySet for this interface
+ */
+ @PropertySet
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD})
+ public @interface Intf2Props {
+ public int intf2Prop1() default 1;
+
+ public int intf2Prop2() default 2;
+ }
+
+ @EventSet
+ public interface Intf2Events extends Intf1Events, AddInEvents {
+ public void intf2Event1();
+
+ public void intf2Event2();
+ }
+
+ /**
+ * Declare an EventSet that is new and unique to this interface
+ */
+ @EventSet(unicast = true)
+ public interface Intf2NewEvents extends AddInEvents {
+ public void intf2NewEvent1();
+
+ public void intf2NewEvent2();
+ }
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Intf2.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Intf2Impl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Intf2Impl.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Intf2Impl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Intf2Impl.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,87 @@
+/*
+ * 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.inherit;
+
+import org.apache.beehive.controls.api.bean.Control;
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import org.apache.beehive.controls.api.bean.Extensible;
+import org.apache.beehive.controls.api.context.Context;
+import org.apache.beehive.controls.api.context.ControlBeanContext;
+import org.apache.beehive.controls.api.events.Client;
+
+import java.lang.reflect.Method;
+
+/**
+ * This is the second level control implementation, that tests subclassing one ControlImplementation
+ * from another. This implementation also adds support for the Extensible interface, to enable
+ * ControlExtension subinterfaces to be declared.
+ */
+@ControlImplementation
+public class Intf2Impl extends Intf1Impl
+ implements Intf2, Extensible, java.io.Serializable {
+ @Context
+ ControlBeanContext context;
+ @Client
+ Intf2Events intfEvents;
+ @Client
+ Intf2NewEvents intfNewEvents;
+
+ @Control
+ Hello _h2;
+
+ public int intf2Operation1() {
+ super.intf1Operation1();
+
+ intfEvents.addInEvent1();
+ intfEvents.intf1Event1();
+ intfEvents.intf2Event1();
+
+ intfNewEvents.addInEvent1();
+ intfNewEvents.intf2NewEvent1();
+
+ return context.getControlPropertySet(Intf2Props.class).intf2Prop1();
+ }
+
+ public int intf2Operation2() {
+ super.intf1Operation2();
+
+ intfEvents.intf1Event1();
+ intfEvents.addInEvent1();
+ intfEvents.intf2Event1();
+
+ intfNewEvents.addInEvent1();
+ intfNewEvents.intf2NewEvent1();
+
+ return context.getControlPropertySet(Intf2Props.class).intf2Prop2();
+ }
+
+ public void addInOperation1() {
+ // Same as above
+ intf2Operation1();
+ }
+
+ public void addInOperation2() {
+ // Same as above
+ intf2Operation2();
+ }
+
+ public Object invoke(Method method, Object [] args) {
+ return null;
+ }
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Intf2Impl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Root.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Root.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Root.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Root.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,36 @@
+/*
+ * 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.inherit;
+
+/**
+ * This is the root interface for the inheritance test control hierarchy. It is <b>not</b> a
+ * ControlInterface, and exists to verify that it is possible to subclass a ControlInterface/
+ * ControlImpl from an existing interface/impl class pair.
+ */
+public interface Root {
+ public void rootOperation1();
+
+ public void rootOperation2();
+
+ public interface RootEvents {
+ public void rootEvent1();
+
+ public void rootEvent2();
+ }
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/Root.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/RootImpl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/RootImpl.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/RootImpl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/RootImpl.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,32 @@
+/*
+ * 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.inherit;
+
+/**
+ * This is the root implementation for the inheritance test control hierarchy. It is <b>not</b> a
+ * ControlImplementation, and exists to verify that it is possible to subclass a ControlInterface/
+ * ControlImpl from an existing interface/impl class pair.
+ */
+public class RootImpl implements Root {
+ public void rootOperation1() {
+ }
+
+ public void rootOperation2() {
+ }
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/inherit/RootImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Copied: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/methodOverride/BaseExtCtrlImpl.java (from r413714, beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/methodOverride/BaseExtImpl.java)
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/methodOverride/BaseExtCtrlImpl.java?p2=beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/methodOverride/BaseExtCtrlImpl.java&p1=beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/methodOverride/BaseExtImpl.java&r1=413714&r2=419614&rev=419614&view=diff
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/methodOverride/BaseExtImpl.java (original)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/methodOverride/BaseExtCtrlImpl.java Thu Jul 6 09:45:19 2006
@@ -26,7 +26,7 @@
/**
*/
@ControlImplementation(isTransient=true)
-public class BaseExtImpl implements BaseExtCtrl, Extensible {
+public class BaseExtCtrlImpl implements BaseExtCtrl, Extensible {
/**
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/methodOverride/BaseExtCtrlImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/packaging/BoundExtPropertySet.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/packaging/BoundExtPropertySet.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/packaging/BoundExtPropertySet.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/packaging/BoundExtPropertySet.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2006 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.packaging;
+
+import org.apache.beehive.controls.api.packaging.PropertyInfo;
+import org.apache.beehive.controls.api.properties.PropertySet;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * An externally defined property set.
+ */
+@PropertySet
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD})
+public @interface BoundExtPropertySet {
+ public static final int AGE_DEFAULT = 5;
+
+ @PropertyInfo(bound = true)
+ public int age() default org.apache.beehive.controls.test.controls.packaging.BoundExtPropertySet.AGE_DEFAULT;
+
+ @PropertyInfo(constrained = true)
+ public float height() default 0.0f;
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/packaging/BoundExtPropertySet.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/packaging/BoundPropertyControl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/packaging/BoundPropertyControl.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/packaging/BoundPropertyControl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/packaging/BoundPropertyControl.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2006 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.packaging;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+import org.apache.beehive.controls.api.bean.ExternalPropertySets;
+import org.apache.beehive.controls.api.packaging.PropertyInfo;
+import org.apache.beehive.controls.api.properties.PropertySet;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * A control interface with bound and/or constrain propertySet
+ */
+@ControlInterface
+@ExternalPropertySets({BoundExtPropertySet.class})
+public interface BoundPropertyControl {
+ static final String BRAND_DEFAULT = "DEFAULT_BRAND";
+ static final String MATERIAL_DEFAULT = "DEFAULT_MATERIAL";
+ static final String QUALITY_DEFAULT = "DEFAULT_QUALITY";
+
+ @PropertySet
+ @Retention(RetentionPolicy.RUNTIME)
+ public @interface Wheel {
+ @PropertyInfo(bound = true)
+ public String Brand() default org.apache.beehive.controls.test.controls.packaging.BoundPropertyControl.BRAND_DEFAULT;
+ }
+
+ @PropertySet
+ @Retention(RetentionPolicy.RUNTIME)
+ public @interface Door {
+ @PropertyInfo(constrained = true)
+ public String Material() default org.apache.beehive.controls.test.controls.packaging.BoundPropertyControl.MATERIAL_DEFAULT;
+ }
+
+ @PropertySet
+ @Retention(RetentionPolicy.RUNTIME)
+ public @interface Window {
+ @PropertyInfo(bound = true, constrained = true)
+ public String Quality() default org.apache.beehive.controls.test.controls.packaging.BoundPropertyControl.QUALITY_DEFAULT;
+ }
+
+ public String sayHello();
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/packaging/BoundPropertyControl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/packaging/BoundPropertyControlImpl.java
URL: http://svn.apache.org/viewvc/beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/packaging/BoundPropertyControlImpl.java?rev=419614&view=auto
==============================================================================
--- beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/packaging/BoundPropertyControlImpl.java (added)
+++ beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/packaging/BoundPropertyControlImpl.java Thu Jul 6 09:45:19 2006
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2006 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:$
+ */
+
+package org.apache.beehive.controls.test.controls.packaging;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import org.apache.beehive.controls.api.context.Context;
+import org.apache.beehive.controls.api.context.ControlBeanContext;
+
+/**
+ * A control impl that accesses the property declared by its control interface via control context
+ */
+
+@ControlImplementation(isTransient=true)
+public class BoundPropertyControlImpl implements BoundPropertyControl
+{
+ @Context
+ private ControlBeanContext context;
+
+ /*Accesses the propertySet value and returns the value*/
+ public String sayHello()
+ {
+ /**BUG: could not refer to Greeting directly*/
+ //Greeting greeting=(SingleProperty.Greeting)context.getControlPropertySet(SingleProperty.Greeting.class);
+
+ //return greeting.GreetWord();
+ return "Hello";
+ }
+
+}
Propchange: beehive/trunk/controls/test/src/junit-controls/org/apache/beehive/controls/test/controls/packaging/BoundPropertyControlImpl.java
------------------------------------------------------------------------------
svn:eol-style = native