You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ek...@apache.org on 2006/05/13 15:14:56 UTC
svn commit: r406090 [2/10] - in /beehive/trunk: ./ ant/ controls/
controls/src/ controls/src/api/org/apache/beehive/controls/api/context/
controls/src/api/org/apache/beehive/controls/api/events/
controls/src/api/org/apache/beehive/controls/api/packagin...
Modified: beehive/trunk/controls/src/api/org/apache/beehive/controls/api/events/EventDispatcherRemote.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/events/EventDispatcherRemote.java?rev=406090&r1=406089&r2=406090&view=diff
==============================================================================
--- beehive/trunk/controls/src/api/org/apache/beehive/controls/api/events/EventDispatcherRemote.java (original)
+++ beehive/trunk/controls/src/api/org/apache/beehive/controls/api/events/EventDispatcherRemote.java Sat May 13 06:14:42 2006
@@ -1,41 +1,41 @@
-/*
- * 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.api.events;
-
-import java.rmi.RemoteException;
-
-import org.apache.beehive.controls.api.context.ControlHandle;
-
-/**
- * The EventDispatcherRemote interface defines the event dispatch signature when event
- * dispatching is happening via RMI.
- *
- * @see org.apache.beehive.controls.api.events.EventDispatcher
- */
-public interface EventDispatcherRemote
-{
- /**
- * Dispatches a Control event to a target control.
- * @param target the target control
- * @param event the event to deliver to the control
- * @param args the parameters to the control event
- * @throws RemoteException wraps any exception thrown during event dispatch
- */
- public Object dispatchEvent(ControlHandle target, EventRef event, Object [] args)
- throws RemoteException;
-}
+/*
+ * 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.api.events;
+
+import java.rmi.RemoteException;
+
+import org.apache.beehive.controls.api.context.ControlHandle;
+
+/**
+ * The EventDispatcherRemote interface defines the event dispatch signature when event
+ * dispatching is happening via RMI.
+ *
+ * @see org.apache.beehive.controls.api.events.EventDispatcher
+ */
+public interface EventDispatcherRemote
+{
+ /**
+ * Dispatches a Control event to a target control.
+ * @param target the target control
+ * @param event the event to deliver to the control
+ * @param args the parameters to the control event
+ * @throws RemoteException wraps any exception thrown during event dispatch
+ */
+ public Object dispatchEvent(ControlHandle target, EventRef event, Object [] args)
+ throws RemoteException;
+}
Propchange: beehive/trunk/controls/src/api/org/apache/beehive/controls/api/events/EventDispatcherRemote.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: beehive/trunk/controls/src/api/org/apache/beehive/controls/api/events/EventRef.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/events/EventRef.java?rev=406090&r1=406089&r2=406090&view=diff
==============================================================================
--- beehive/trunk/controls/src/api/org/apache/beehive/controls/api/events/EventRef.java (original)
+++ beehive/trunk/controls/src/api/org/apache/beehive/controls/api/events/EventRef.java Sat May 13 06:14:42 2006
@@ -1,254 +1,254 @@
-/*
- * 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.api.events;
-
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.WeakHashMap;
-
-/**
- * The EventRef class represents a reference to a specific Control event. EventRefs can
- * be used to fire external events into a Control, in contexts where the event source may
- * not share the associated EventSet class instance with the event target, or even have
- * access to the EventSet class itself.
- * <p>
- * It is roughly equivalent to the java.lang.reflect.Method object that refers to a method
- * on an EventSet interface, but has several additional properties:
- * <ul>
- * <li>It is serializable, so can be persisted/restored or passed across the wire</li>
- * <li>It supports materializing the EventRef back to a Method reference in a way that allows
- * EventRefs to be passed across class loaders</li>
- * <li>It can be constructed in contexts where a reference to the actual EventSet class might
- * not be available (using a String event descriptor format to describe events)</li>
- * </ul>
- */
-public class EventRef implements java.io.Serializable
-{
- //
- // Static helper map to go from a primitive type to the type descriptor string
- //
- static private HashMap<Class,String> _primToType = new HashMap<Class,String>();
- static
- {
- _primToType.put(Integer.TYPE, "I");
- _primToType.put(Boolean.TYPE, "Z");
- _primToType.put(Byte.TYPE, "B");
- _primToType.put(Character.TYPE, "C");
- _primToType.put(Short.TYPE, "S");
- _primToType.put(Long.TYPE, "J");
- _primToType.put(Float.TYPE, "F");
- _primToType.put(Double.TYPE, "D");
- _primToType.put(Void.TYPE, "V");
- }
-
- /**
- * Constructs a new EventRef based upon a Method reference. The input method must be one
- * that is declared within a Control EventSet interface.
- * @param eventMethod the Method associated with the event
- */
- public EventRef(Method eventMethod)
- {
- _method = eventMethod;
- _descriptor = computeEventDescriptor(eventMethod);
- }
-
- /**
- * Constructs a new EventRef using an event descriptor string. The format of this string
- * is:
- * <pre>
- * <eventSet>.<eventName><eventDescriptor>
- * </pre>
- * where <i>eventSet</i> refers to the fully qualified name of the EventSet class,
- * <i>eventName</i> refers to the name of the event Method, and <i>eventDescriptor</i>
- * describes the event argument and return types using the method descriptor format
- * defined in the Java Language Specification.
- * <p>
- * For example, given the following EventSet interface:
- * <pre>
- * <sp>@ControlInterface
- * public interface MyControl
- * {
- * <sp>@EventSet
- * public interface MyEvents
- * {
- * public String myEvent(int arg0, Object arg2);
- * }
- * }
- * </pre>
- * the eventDescriptor for myEvent would be:
- * <pre>
- * MyControl.MyEvents.myEvent(ILjava/lang/Object;)Ljava/lang/String;
- * </pre>
- * @param eventDescriptor the event descriptor string associated with the event
- */
- public EventRef(String eventDescriptor)
- {
- _descriptor = eventDescriptor;
- }
-
- /**
- * Returns the event descriptor string associated with the EventRef.
- * @param controlInterface the ControlInterface
- */
- public String getEventDescriptor(Class controlInterface)
- {
- //
- // NOTE: The input controlInterface is currently unused, but included to
- // enable downstream optimization of serialization representation. See the
- // OPTIMIZE comment below for more details. If implemented, the interface
- // is needed to reverse the transformation from a hash back to a method or
- // descriptor.
- //
- if (_descriptor == null)
- _descriptor = computeEventDescriptor(_method);
-
- return _descriptor;
- }
-
- /**
- * Helper method that computes the event descriptor sting for a method
- */
- private String computeEventDescriptor(Method method)
- {
- StringBuilder sb = new StringBuilder();
-
- // Add event class and method name
- sb.append(method.getDeclaringClass().getName());
- sb.append(".");
- sb.append(method.getName());
-
- // Add event arguments
- Class [] parms = method.getParameterTypes();
- sb.append("(");
- for (int i = 0; i < parms.length; i++)
- appendTypeDescriptor(sb, parms[i]);
- sb.append(")");
-
- // Add event return type
- appendTypeDescriptor(sb, method.getReturnType());
-
- return sb.toString();
- }
-
- /**
- * Helper method that appends a type descriptor to a StringBuilder. Used
- * while accumulating an event descriptor string.
- */
- private void appendTypeDescriptor(StringBuilder sb, Class clazz)
- {
- if (clazz.isPrimitive())
- sb.append(_primToType.get(clazz));
- else if (clazz.isArray())
- sb.append(clazz.getName().replace('.','/'));
- else
- {
- sb.append("L");
- sb.append(clazz.getName().replace('.','/'));
- sb.append(";");
- }
- }
-
- /**
- * Returns the event Method associated with this EventRef.
- */
- public Method getEventMethod(Class controlInterface)
- {
- //
- // If we already hold a method reference and its loader matches up with the input
- // interface, then just return it.
- //
- if (_method != null &&
- _method.getDeclaringClass().getClassLoader().equals(controlInterface.getClassLoader()))
- return _method;
-
- //
- // Otherwise, obtain the mapping from descriptors to methods, and use it to
- // convert back to a method.
- //
- String eventDescriptor = getEventDescriptor(controlInterface);
- HashMap<String,Method> descriptorMap = getDescriptorMap(controlInterface);
- if (!descriptorMap.containsKey(eventDescriptor))
- {
- throw new IllegalArgumentException("Control interface " + controlInterface +
- " does not contain an event method that " +
- " corresponds to " + eventDescriptor);
- }
- return descriptorMap.get(eventDescriptor);
- }
-
- /**
- * A WeakHashMap used to cache the event descriptor-to-Method mapping for control
- * interfaces.
- */
- static private WeakHashMap<Class, HashMap<String,Method>> _descriptorMaps =
- new WeakHashMap<Class, HashMap<String,Method>>();
-
- private HashMap<String,Method> getDescriptorMap(Class controlInterface)
- {
- //
- // If the local cache has the mapping, then return it.
- //
- HashMap<String,Method> descMap = _descriptorMaps.get(controlInterface);
- if (descMap == null)
- {
- //
- // Compute the mapping from event descriptors to event methods, using reflection
- //
- descMap = new HashMap<String, Method>();
- Class [] innerClasses = controlInterface.getClasses();
- for (int i = 0; i < innerClasses.length; i++)
- {
- if (!innerClasses[i].isInterface() ||
- !innerClasses[i].isAnnotationPresent(EventSet.class))
- continue;
-
- Method [] eventMethods = innerClasses[i].getMethods();
- for (int j = 0; j < eventMethods.length; j++)
- descMap.put(computeEventDescriptor(eventMethods[j]), eventMethods[j]);
- }
- _descriptorMaps.put(controlInterface, descMap);
- }
- return descMap;
- }
-
-
- /**
- * Two EventRefs are equal if the method descriptor string associated with them is equal
- */
- public boolean equals(Object obj)
- {
- if (obj == null || !(obj instanceof EventRef))
- return false;
-
- return _descriptor.equals(((EventRef)obj)._descriptor);
- }
-
- public String toString()
- {
- return "EventRef: " + _descriptor;
- }
-
- //
- // OPTIMIZE: A more efficient internal representation for serialization/wire purposes
- // would be to compute a hash of the descriptor string (ala RMI opnums), that could be
- // reconstituted on the other end, given a candidate ControlInterface. The public APIs
- // are structured to support this downstream optimization.
- //
- private String _descriptor;
- transient private Method _method;
-}
+/*
+ * 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.api.events;
+
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.WeakHashMap;
+
+/**
+ * The EventRef class represents a reference to a specific Control event. EventRefs can
+ * be used to fire external events into a Control, in contexts where the event source may
+ * not share the associated EventSet class instance with the event target, or even have
+ * access to the EventSet class itself.
+ * <p>
+ * It is roughly equivalent to the java.lang.reflect.Method object that refers to a method
+ * on an EventSet interface, but has several additional properties:
+ * <ul>
+ * <li>It is serializable, so can be persisted/restored or passed across the wire</li>
+ * <li>It supports materializing the EventRef back to a Method reference in a way that allows
+ * EventRefs to be passed across class loaders</li>
+ * <li>It can be constructed in contexts where a reference to the actual EventSet class might
+ * not be available (using a String event descriptor format to describe events)</li>
+ * </ul>
+ */
+public class EventRef implements java.io.Serializable
+{
+ //
+ // Static helper map to go from a primitive type to the type descriptor string
+ //
+ static private HashMap<Class,String> _primToType = new HashMap<Class,String>();
+ static
+ {
+ _primToType.put(Integer.TYPE, "I");
+ _primToType.put(Boolean.TYPE, "Z");
+ _primToType.put(Byte.TYPE, "B");
+ _primToType.put(Character.TYPE, "C");
+ _primToType.put(Short.TYPE, "S");
+ _primToType.put(Long.TYPE, "J");
+ _primToType.put(Float.TYPE, "F");
+ _primToType.put(Double.TYPE, "D");
+ _primToType.put(Void.TYPE, "V");
+ }
+
+ /**
+ * Constructs a new EventRef based upon a Method reference. The input method must be one
+ * that is declared within a Control EventSet interface.
+ * @param eventMethod the Method associated with the event
+ */
+ public EventRef(Method eventMethod)
+ {
+ _method = eventMethod;
+ _descriptor = computeEventDescriptor(eventMethod);
+ }
+
+ /**
+ * Constructs a new EventRef using an event descriptor string. The format of this string
+ * is:
+ * <pre>
+ * <eventSet>.<eventName><eventDescriptor>
+ * </pre>
+ * where <i>eventSet</i> refers to the fully qualified name of the EventSet class,
+ * <i>eventName</i> refers to the name of the event Method, and <i>eventDescriptor</i>
+ * describes the event argument and return types using the method descriptor format
+ * defined in the Java Language Specification.
+ * <p>
+ * For example, given the following EventSet interface:
+ * <pre>
+ * <sp>@ControlInterface
+ * public interface MyControl
+ * {
+ * <sp>@EventSet
+ * public interface MyEvents
+ * {
+ * public String myEvent(int arg0, Object arg2);
+ * }
+ * }
+ * </pre>
+ * the eventDescriptor for myEvent would be:
+ * <pre>
+ * MyControl.MyEvents.myEvent(ILjava/lang/Object;)Ljava/lang/String;
+ * </pre>
+ * @param eventDescriptor the event descriptor string associated with the event
+ */
+ public EventRef(String eventDescriptor)
+ {
+ _descriptor = eventDescriptor;
+ }
+
+ /**
+ * Returns the event descriptor string associated with the EventRef.
+ * @param controlInterface the ControlInterface
+ */
+ public String getEventDescriptor(Class controlInterface)
+ {
+ //
+ // NOTE: The input controlInterface is currently unused, but included to
+ // enable downstream optimization of serialization representation. See the
+ // OPTIMIZE comment below for more details. If implemented, the interface
+ // is needed to reverse the transformation from a hash back to a method or
+ // descriptor.
+ //
+ if (_descriptor == null)
+ _descriptor = computeEventDescriptor(_method);
+
+ return _descriptor;
+ }
+
+ /**
+ * Helper method that computes the event descriptor sting for a method
+ */
+ private String computeEventDescriptor(Method method)
+ {
+ StringBuilder sb = new StringBuilder();
+
+ // Add event class and method name
+ sb.append(method.getDeclaringClass().getName());
+ sb.append(".");
+ sb.append(method.getName());
+
+ // Add event arguments
+ Class [] parms = method.getParameterTypes();
+ sb.append("(");
+ for (int i = 0; i < parms.length; i++)
+ appendTypeDescriptor(sb, parms[i]);
+ sb.append(")");
+
+ // Add event return type
+ appendTypeDescriptor(sb, method.getReturnType());
+
+ return sb.toString();
+ }
+
+ /**
+ * Helper method that appends a type descriptor to a StringBuilder. Used
+ * while accumulating an event descriptor string.
+ */
+ private void appendTypeDescriptor(StringBuilder sb, Class clazz)
+ {
+ if (clazz.isPrimitive())
+ sb.append(_primToType.get(clazz));
+ else if (clazz.isArray())
+ sb.append(clazz.getName().replace('.','/'));
+ else
+ {
+ sb.append("L");
+ sb.append(clazz.getName().replace('.','/'));
+ sb.append(";");
+ }
+ }
+
+ /**
+ * Returns the event Method associated with this EventRef.
+ */
+ public Method getEventMethod(Class controlInterface)
+ {
+ //
+ // If we already hold a method reference and its loader matches up with the input
+ // interface, then just return it.
+ //
+ if (_method != null &&
+ _method.getDeclaringClass().getClassLoader().equals(controlInterface.getClassLoader()))
+ return _method;
+
+ //
+ // Otherwise, obtain the mapping from descriptors to methods, and use it to
+ // convert back to a method.
+ //
+ String eventDescriptor = getEventDescriptor(controlInterface);
+ HashMap<String,Method> descriptorMap = getDescriptorMap(controlInterface);
+ if (!descriptorMap.containsKey(eventDescriptor))
+ {
+ throw new IllegalArgumentException("Control interface " + controlInterface +
+ " does not contain an event method that " +
+ " corresponds to " + eventDescriptor);
+ }
+ return descriptorMap.get(eventDescriptor);
+ }
+
+ /**
+ * A WeakHashMap used to cache the event descriptor-to-Method mapping for control
+ * interfaces.
+ */
+ static private WeakHashMap<Class, HashMap<String,Method>> _descriptorMaps =
+ new WeakHashMap<Class, HashMap<String,Method>>();
+
+ private HashMap<String,Method> getDescriptorMap(Class controlInterface)
+ {
+ //
+ // If the local cache has the mapping, then return it.
+ //
+ HashMap<String,Method> descMap = _descriptorMaps.get(controlInterface);
+ if (descMap == null)
+ {
+ //
+ // Compute the mapping from event descriptors to event methods, using reflection
+ //
+ descMap = new HashMap<String, Method>();
+ Class [] innerClasses = controlInterface.getClasses();
+ for (int i = 0; i < innerClasses.length; i++)
+ {
+ if (!innerClasses[i].isInterface() ||
+ !innerClasses[i].isAnnotationPresent(EventSet.class))
+ continue;
+
+ Method [] eventMethods = innerClasses[i].getMethods();
+ for (int j = 0; j < eventMethods.length; j++)
+ descMap.put(computeEventDescriptor(eventMethods[j]), eventMethods[j]);
+ }
+ _descriptorMaps.put(controlInterface, descMap);
+ }
+ return descMap;
+ }
+
+
+ /**
+ * Two EventRefs are equal if the method descriptor string associated with them is equal
+ */
+ public boolean equals(Object obj)
+ {
+ if (obj == null || !(obj instanceof EventRef))
+ return false;
+
+ return _descriptor.equals(((EventRef)obj)._descriptor);
+ }
+
+ public String toString()
+ {
+ return "EventRef: " + _descriptor;
+ }
+
+ //
+ // OPTIMIZE: A more efficient internal representation for serialization/wire purposes
+ // would be to compute a hash of the descriptor string (ala RMI opnums), that could be
+ // reconstituted on the other end, given a candidate ControlInterface. The public APIs
+ // are structured to support this downstream optimization.
+ //
+ private String _descriptor;
+ transient private Method _method;
+}
Propchange: beehive/trunk/controls/src/api/org/apache/beehive/controls/api/events/EventRef.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: beehive/trunk/controls/src/api/org/apache/beehive/controls/api/events/RemoteEventDispatcher.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/events/RemoteEventDispatcher.java?rev=406090&r1=406089&r2=406090&view=diff
==============================================================================
--- beehive/trunk/controls/src/api/org/apache/beehive/controls/api/events/RemoteEventDispatcher.java (original)
+++ beehive/trunk/controls/src/api/org/apache/beehive/controls/api/events/RemoteEventDispatcher.java Sat May 13 06:14:42 2006
@@ -1,45 +1,45 @@
-/*
- * 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.api.events;
-
-import java.rmi.RemoteException;
-
-import org.apache.beehive.controls.api.context.ControlHandle;
-
-/**
- * The RemoteEventDispatcher interface defines the method signature that a container supporting
- * the external dispatch of Control events would implement if events can be dispatched using RMI.
- */
-public interface RemoteEventDispatcher
-{
- /**
- * Dispatches a Control event to a target control.
- * @param target the target control
- * @param event the event to deliver to the control
- * @param args the parameters to the control event
- * @throws IllegalAccessException the underlying event method is not accessible due to
- * access control.
- * @throws IllegalArgumentException the target is not valid, the event is not a valid event
- * type for the requested target, or the argument types do not match the event
- * signature.
- * @throws InvocationTargetException wraps any exception thrown by the underlying event
- * handler.
- */
- public Object dispatchEvent(ControlHandle target, EventRef event, Object [] args)
- throws RemoteException;
-}
+/*
+ * 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.api.events;
+
+import java.rmi.RemoteException;
+
+import org.apache.beehive.controls.api.context.ControlHandle;
+
+/**
+ * The RemoteEventDispatcher interface defines the method signature that a container supporting
+ * the external dispatch of Control events would implement if events can be dispatched using RMI.
+ */
+public interface RemoteEventDispatcher
+{
+ /**
+ * Dispatches a Control event to a target control.
+ * @param target the target control
+ * @param event the event to deliver to the control
+ * @param args the parameters to the control event
+ * @throws IllegalAccessException the underlying event method is not accessible due to
+ * access control.
+ * @throws IllegalArgumentException the target is not valid, the event is not a valid event
+ * type for the requested target, or the argument types do not match the event
+ * signature.
+ * @throws InvocationTargetException wraps any exception thrown by the underlying event
+ * handler.
+ */
+ public Object dispatchEvent(ControlHandle target, EventRef event, Object [] args)
+ throws RemoteException;
+}
Propchange: beehive/trunk/controls/src/api/org/apache/beehive/controls/api/events/RemoteEventDispatcher.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/BeanInfo.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/BeanInfo.java?rev=406090&r1=406089&r2=406090&view=diff
==============================================================================
--- beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/BeanInfo.java (original)
+++ beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/BeanInfo.java Sat May 13 06:14:42 2006
@@ -1,43 +1,43 @@
-/*
- * 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.api.packaging;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Target;
-
-/**
- * The FeatureInfo annotation type defines a JSR-175 syntax for annotating a Control to
- * provide BeanInfo FeatureDescriptor information for the bean, its properties, methods,
- * or events.
- * <p>
- * The elements of FeatureInfo correspond 1-to-1 with the information exposed by the
- * <code>java.beans.FeatureDescriptor</code> class.
- *
- * @see java.beans.FeatureDescriptor
- */
-@Target({ElementType.TYPE, ElementType.METHOD})
-public @interface BeanInfo
-{
- /**
- * The NoCustomizer class can be used as the value of the customizerClass attribute to
- * indicate that the bean has no customizer.
- */
- static public class NoCustomizer {}
-
- public Class customizerClass() default NoCustomizer.class;
-}
+/*
+ * 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.api.packaging;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+/**
+ * The FeatureInfo annotation type defines a JSR-175 syntax for annotating a Control to
+ * provide BeanInfo FeatureDescriptor information for the bean, its properties, methods,
+ * or events.
+ * <p>
+ * The elements of FeatureInfo correspond 1-to-1 with the information exposed by the
+ * <code>java.beans.FeatureDescriptor</code> class.
+ *
+ * @see java.beans.FeatureDescriptor
+ */
+@Target({ElementType.TYPE, ElementType.METHOD})
+public @interface BeanInfo
+{
+ /**
+ * The NoCustomizer class can be used as the value of the customizerClass attribute to
+ * indicate that the bean has no customizer.
+ */
+ static public class NoCustomizer {}
+
+ public Class customizerClass() default NoCustomizer.class;
+}
Propchange: beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/BeanInfo.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/EventSetInfo.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/EventSetInfo.java?rev=406090&r1=406089&r2=406090&view=diff
==============================================================================
--- beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/EventSetInfo.java (original)
+++ beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/EventSetInfo.java Sat May 13 06:14:42 2006
@@ -1,38 +1,38 @@
-/*
- * 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.api.packaging;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Target;
-
-/**
- * The EventSetInfo annotation type defines a JSR-175 syntax for annotating a Control
- * property declaration to provide java.beans.EventSetDescriptor information. Generic
- * feature information is defined using the <code>FeatureInfo</code> annotation type
- * <p>
- * The elements of EventStInfo correspond 1-to-1 with the information exposed by the
- * <code>java.beans.EventSetDescriptor</code> class.
- *
- * @see java.beans.EventSetDescriptor
- */
-@Target({ElementType.TYPE}) // appears on EventSet interface declaration
-public @interface EventSetInfo
-{
- public boolean isUnicast() default false; // single listener model
- public boolean isDefault() default true; // is the default event set
-}
+/*
+ * 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.api.packaging;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+/**
+ * The EventSetInfo annotation type defines a JSR-175 syntax for annotating a Control
+ * property declaration to provide java.beans.EventSetDescriptor information. Generic
+ * feature information is defined using the <code>FeatureInfo</code> annotation type
+ * <p>
+ * The elements of EventStInfo correspond 1-to-1 with the information exposed by the
+ * <code>java.beans.EventSetDescriptor</code> class.
+ *
+ * @see java.beans.EventSetDescriptor
+ */
+@Target({ElementType.TYPE}) // appears on EventSet interface declaration
+public @interface EventSetInfo
+{
+ public boolean isUnicast() default false; // single listener model
+ public boolean isDefault() default true; // is the default event set
+}
Propchange: beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/EventSetInfo.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/FeatureAttribute.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/FeatureAttribute.java?rev=406090&r1=406089&r2=406090&view=diff
==============================================================================
--- beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/FeatureAttribute.java (original)
+++ beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/FeatureAttribute.java Sat May 13 06:14:42 2006
@@ -1,36 +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.api.packaging;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Target;
-
-/**
- * The FeatureAttribute annotation type defines a JSR-175 syntax for specifying JavaBean
- * FeatureDescriptor attributes associated with a Control.
- *
- * @see org.apache.beehive.controls.api.packaging.FeatureInfo
- */
-public @interface FeatureAttribute
-{
- /* Specifies the feature attribute name */
- public String name();
-
- /* Specifies the feature attribute value */
- public String value();
-}
+/*
+ * 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.api.packaging;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+/**
+ * The FeatureAttribute annotation type defines a JSR-175 syntax for specifying JavaBean
+ * FeatureDescriptor attributes associated with a Control.
+ *
+ * @see org.apache.beehive.controls.api.packaging.FeatureInfo
+ */
+public @interface FeatureAttribute
+{
+ /* Specifies the feature attribute name */
+ public String name();
+
+ /* Specifies the feature attribute value */
+ public String value();
+}
Propchange: beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/FeatureAttribute.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/FeatureInfo.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/FeatureInfo.java?rev=406090&r1=406089&r2=406090&view=diff
==============================================================================
--- beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/FeatureInfo.java (original)
+++ beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/FeatureInfo.java Sat May 13 06:14:42 2006
@@ -1,43 +1,43 @@
-/*
- * 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.api.packaging;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Target;
-
-/**
- * The FeatureInfo annotation type defines a JSR-175 syntax for annotating a Control to
- * provide BeanInfo FeatureDescriptor information for the bean, its properties, methods,
- * or events.
- * <p>
- * The elements of FeatureInfo correspond 1-to-1 with the information exposed by the
- * <code>java.beans.FeatureDescriptor</code> class.
- *
- * @see java.beans.FeatureDescriptor
- */
-@Target({ElementType.TYPE, ElementType.METHOD})
-public @interface FeatureInfo
-{
- public String displayName() default ""; // default: use reflection name
- public String name() default ""; // default: use reflection name
- public String shortDescription() default "";
- public boolean isExpert() default false;
- public boolean isHidden() default false;
- public boolean isPreferred() default false;
- public FeatureAttribute [] attributes() default {};
-}
+/*
+ * 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.api.packaging;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+/**
+ * The FeatureInfo annotation type defines a JSR-175 syntax for annotating a Control to
+ * provide BeanInfo FeatureDescriptor information for the bean, its properties, methods,
+ * or events.
+ * <p>
+ * The elements of FeatureInfo correspond 1-to-1 with the information exposed by the
+ * <code>java.beans.FeatureDescriptor</code> class.
+ *
+ * @see java.beans.FeatureDescriptor
+ */
+@Target({ElementType.TYPE, ElementType.METHOD})
+public @interface FeatureInfo
+{
+ public String displayName() default ""; // default: use reflection name
+ public String name() default ""; // default: use reflection name
+ public String shortDescription() default "";
+ public boolean isExpert() default false;
+ public boolean isHidden() default false;
+ public boolean isPreferred() default false;
+ public FeatureAttribute [] attributes() default {};
+}
Propchange: beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/FeatureInfo.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/ManifestAttribute.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/ManifestAttribute.java?rev=406090&r1=406089&r2=406090&view=diff
==============================================================================
--- beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/ManifestAttribute.java (original)
+++ beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/ManifestAttribute.java Sat May 13 06:14:42 2006
@@ -1,37 +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.api.packaging;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Target;
-
-/**
- * The ManifestAttribute annotation type defines a JSR-175 syntax for specifying JAR
- * manifest attributes associated with a control type. The Beehive Controls packaging
- * support will process these annotation during the construction of a JAR file that
- * contains Controls.
- */
-@Target({ElementType.TYPE})
-public @interface ManifestAttribute
-{
- /* Specifies the manifest attribute name */
- public String name();
-
- /* Specifies the manifest attribute value */
- public String value();
-}
+/*
+ * 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.api.packaging;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+/**
+ * The ManifestAttribute annotation type defines a JSR-175 syntax for specifying JAR
+ * manifest attributes associated with a control type. The Beehive Controls packaging
+ * support will process these annotation during the construction of a JAR file that
+ * contains Controls.
+ */
+@Target({ElementType.TYPE})
+public @interface ManifestAttribute
+{
+ /* Specifies the manifest attribute name */
+ public String name();
+
+ /* Specifies the manifest attribute value */
+ public String value();
+}
Propchange: beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/ManifestAttribute.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/ManifestAttributes.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/ManifestAttributes.java?rev=406090&r1=406089&r2=406090&view=diff
==============================================================================
--- beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/ManifestAttributes.java (original)
+++ beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/ManifestAttributes.java Sat May 13 06:14:42 2006
@@ -1,34 +1,34 @@
-/*
- * 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.api.packaging;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Target;
-
-/**
- * The ManifestAttributes annotation type enables a set of manifest attributes attributes
- * to be defined for a given control type.
- *
- * @see org.apache.beehive.controls.api.packaging.ManifestAttribute
- */
-@Target({ElementType.TYPE})
-public @interface ManifestAttributes
-{
- /* Specifies the set of ManifestAttribute annotation values */
- public ManifestAttribute [] value();
-}
+/*
+ * 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.api.packaging;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+/**
+ * The ManifestAttributes annotation type enables a set of manifest attributes attributes
+ * to be defined for a given control type.
+ *
+ * @see org.apache.beehive.controls.api.packaging.ManifestAttribute
+ */
+@Target({ElementType.TYPE})
+public @interface ManifestAttributes
+{
+ /* Specifies the set of ManifestAttribute annotation values */
+ public ManifestAttribute [] value();
+}
Propchange: beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/ManifestAttributes.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/PropertyInfo.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/PropertyInfo.java?rev=406090&r1=406089&r2=406090&view=diff
==============================================================================
--- beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/PropertyInfo.java (original)
+++ beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/PropertyInfo.java Sat May 13 06:14:42 2006
@@ -1,48 +1,48 @@
-package org.apache.beehive.controls.api.packaging;
-
-/*
- * 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.ElementType;
-import java.lang.annotation.Target;
-
-import java.beans.PropertyEditor;
-
-/**
- * The PropertyInfo annotation type defines a JSR-175 syntax for annotating a Control
- * property declaration to provide java.beans.PropertyDescriptor information. Generic
- * feature information is defined using the <code>FeatureInfo</code> annotation type
- * <p>
- * The elements of PropertyInfo correspond 1-to-1 with the information exposed by the
- * <code>java.beans.PropertyDescriptor</code> class.
- *
- * @see java.beans.PropertyDescriptor
- */
-@Target({ElementType.METHOD}) // appears on PropertySet method declaration (i.e. properties)
-public @interface PropertyInfo
-{
- /**
- * The NoEditor class can be used as the value of the editorClass attribute to
- * indicate that the property has no editor
- */
- static public class NoEditor {};
-
- public boolean bound() default false; // Sends PropertyChange events
- public boolean constrained() default false; // Sends VetoableChange events
- public Class editorClass() default NoEditor.class; // default == no editor
-}
+package org.apache.beehive.controls.api.packaging;
+
+/*
+ * 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.ElementType;
+import java.lang.annotation.Target;
+
+import java.beans.PropertyEditor;
+
+/**
+ * The PropertyInfo annotation type defines a JSR-175 syntax for annotating a Control
+ * property declaration to provide java.beans.PropertyDescriptor information. Generic
+ * feature information is defined using the <code>FeatureInfo</code> annotation type
+ * <p>
+ * The elements of PropertyInfo correspond 1-to-1 with the information exposed by the
+ * <code>java.beans.PropertyDescriptor</code> class.
+ *
+ * @see java.beans.PropertyDescriptor
+ */
+@Target({ElementType.METHOD}) // appears on PropertySet method declaration (i.e. properties)
+public @interface PropertyInfo
+{
+ /**
+ * The NoEditor class can be used as the value of the editorClass attribute to
+ * indicate that the property has no editor
+ */
+ static public class NoEditor {};
+
+ public boolean bound() default false; // Sends PropertyChange events
+ public boolean constrained() default false; // Sends VetoableChange events
+ public Class editorClass() default NoEditor.class; // default == no editor
+}
Propchange: beehive/trunk/controls/src/api/org/apache/beehive/controls/api/packaging/PropertyInfo.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: beehive/trunk/controls/src/api/org/apache/beehive/controls/api/properties/PropertySetProxy.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: beehive/trunk/controls/src/beehive-controls.pom
------------------------------------------------------------------------------
svn:eol-style = native
Modified: beehive/trunk/controls/src/runtime/META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/src/runtime/META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory?rev=406090&r1=406089&r2=406090&view=diff
==============================================================================
--- beehive/trunk/controls/src/runtime/META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory (original)
+++ beehive/trunk/controls/src/runtime/META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory Sat May 13 06:14:42 2006
@@ -1,7 +1,7 @@
-#
-# This configures APT so the ControlProcessorFactory can be used to process Control annotations
-#
-org.apache.beehive.controls.runtime.generator.apt.ControlAnnotationProcessorFactory
-org.apache.beehive.controls.runtime.generator.apt.ControlClientAnnotationProcessorFactory
-org.apache.beehive.controls.runtime.generator.apt.ControlMemberTypeAnnotationProcessorFactory
-org.apache.beehive.controls.runtime.generator.apt.ControlSecondaryAnnotationProcessorFactory
+#
+# This configures APT so the ControlProcessorFactory can be used to process Control annotations
+#
+org.apache.beehive.controls.runtime.generator.apt.ControlAnnotationProcessorFactory
+org.apache.beehive.controls.runtime.generator.apt.ControlClientAnnotationProcessorFactory
+org.apache.beehive.controls.runtime.generator.apt.ControlMemberTypeAnnotationProcessorFactory
+org.apache.beehive.controls.runtime.generator.apt.ControlSecondaryAnnotationProcessorFactory
Propchange: beehive/trunk/controls/src/runtime/META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory
------------------------------------------------------------------------------
svn:eol-style = native
Modified: beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/assembly/AppAssemblyContext.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/assembly/AppAssemblyContext.java?rev=406090&r1=406089&r2=406090&view=diff
==============================================================================
--- beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/assembly/AppAssemblyContext.java (original)
+++ beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/assembly/AppAssemblyContext.java Sat May 13 06:14:42 2006
@@ -1,63 +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.runtime.assembly;
-
-import org.apache.beehive.controls.api.assembly.ControlAssemblyContext;
-import org.apache.beehive.controls.api.assembly.ControlAssemblyException;
-
-import java.io.File;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * A ControlAssemblyContext implementation supporting standard Enterprise app modules
- */
-public class AppAssemblyContext
- extends BaseAssemblyContext
- implements ControlAssemblyContext.EntAppModule
-{
-
- public static class Factory
- implements ControlAssemblyContext.Factory
- {
- public AppAssemblyContext newInstance( Class controlIntfOrExt,
- Map<String,String> bindings,
- Set<String> clients,
- File moduleRoot,
- String moduleName,
- File srcOutputRoot )
- throws ControlAssemblyException
- {
- return new AppAssemblyContext( controlIntfOrExt, bindings, clients,
- moduleRoot, moduleName, srcOutputRoot );
- }
- }
-
- protected AppAssemblyContext( Class controlIntfOrExt, Map<String,String> bindings,
- Set<String> clients, File moduleRoot,
- String moduleName, File srcOutputRoot )
- throws ControlAssemblyException
- {
- super( controlIntfOrExt, bindings, clients, moduleRoot, moduleName, srcOutputRoot );
- }
-
- public File getApplicationXml()
- {
- return new File( getModuleDir(), "META-INF" + File.separator + "application.xml" );
- }
-}
+/*
+ * 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.runtime.assembly;
+
+import org.apache.beehive.controls.api.assembly.ControlAssemblyContext;
+import org.apache.beehive.controls.api.assembly.ControlAssemblyException;
+
+import java.io.File;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * A ControlAssemblyContext implementation supporting standard Enterprise app modules
+ */
+public class AppAssemblyContext
+ extends BaseAssemblyContext
+ implements ControlAssemblyContext.EntAppModule
+{
+
+ public static class Factory
+ implements ControlAssemblyContext.Factory
+ {
+ public AppAssemblyContext newInstance( Class controlIntfOrExt,
+ Map<String,String> bindings,
+ Set<String> clients,
+ File moduleRoot,
+ String moduleName,
+ File srcOutputRoot )
+ throws ControlAssemblyException
+ {
+ return new AppAssemblyContext( controlIntfOrExt, bindings, clients,
+ moduleRoot, moduleName, srcOutputRoot );
+ }
+ }
+
+ protected AppAssemblyContext( Class controlIntfOrExt, Map<String,String> bindings,
+ Set<String> clients, File moduleRoot,
+ String moduleName, File srcOutputRoot )
+ throws ControlAssemblyException
+ {
+ super( controlIntfOrExt, bindings, clients, moduleRoot, moduleName, srcOutputRoot );
+ }
+
+ public File getApplicationXml()
+ {
+ return new File( getModuleDir(), "META-INF" + File.separator + "application.xml" );
+ }
+}
Propchange: beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/assembly/AppAssemblyContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/AdaptorPersistenceDelegate.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/AnnotatedElementMapPersistenceDelegate.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/AnnotatedElementMapPersistenceDelegate.java?rev=406090&r1=406089&r2=406090&view=diff
==============================================================================
--- beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/AnnotatedElementMapPersistenceDelegate.java (original)
+++ beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/AnnotatedElementMapPersistenceDelegate.java Sat May 13 06:14:42 2006
@@ -1,42 +1,42 @@
-/*
- * 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.runtime.bean;
-
-import java.beans.PersistenceDelegate;
-import java.beans.Encoder;
-import java.beans.Expression;
-
-import org.apache.beehive.controls.api.properties.AnnotatedElementMap;
-
-/**
- * The AnnotatedElementMapPersistenceDelegate is an XMLEncoder PersistenceDelegate for
- * the <code>org.apache.beehive.controls.api.properties.AnnotatedElementMap</code>
- * class.
- */
-public class AnnotatedElementMapPersistenceDelegate extends PersistenceDelegate
-{
- protected Expression instantiate(Object oldInstance, Encoder out)
- {
- //
- // Modify the default constructor to pass in the AnnotatedElement wrapped by the map
- //
- AnnotatedElementMap aem = (AnnotatedElementMap)oldInstance;
- return new Expression(aem, aem.getClass(), "new",
- new Object [] { aem.getAnnotatedElement() });
- }
-}
+/*
+ * 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.runtime.bean;
+
+import java.beans.PersistenceDelegate;
+import java.beans.Encoder;
+import java.beans.Expression;
+
+import org.apache.beehive.controls.api.properties.AnnotatedElementMap;
+
+/**
+ * The AnnotatedElementMapPersistenceDelegate is an XMLEncoder PersistenceDelegate for
+ * the <code>org.apache.beehive.controls.api.properties.AnnotatedElementMap</code>
+ * class.
+ */
+public class AnnotatedElementMapPersistenceDelegate extends PersistenceDelegate
+{
+ protected Expression instantiate(Object oldInstance, Encoder out)
+ {
+ //
+ // Modify the default constructor to pass in the AnnotatedElement wrapped by the map
+ //
+ AnnotatedElementMap aem = (AnnotatedElementMap)oldInstance;
+ return new Expression(aem, aem.getClass(), "new",
+ new Object [] { aem.getAnnotatedElement() });
+ }
+}
Propchange: beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/AnnotatedElementMapPersistenceDelegate.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/BeanPersistenceDelegate.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ContextPersistenceDelegate.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlBeanInfo.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlUtils.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlUtils.java?rev=406090&r1=406089&r2=406090&view=diff
==============================================================================
--- beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlUtils.java (original)
+++ beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlUtils.java Sat May 13 06:14:42 2006
@@ -1,96 +1,96 @@
-/*
- * 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.runtime.bean;
-
-import org.apache.beehive.controls.api.bean.ControlInterface;
-import org.apache.beehive.controls.api.bean.ControlExtension;
-import org.apache.beehive.controls.api.ControlException;
-
-/**
- * Utilities used by the Controls runtime.
- */
-public final class ControlUtils {
-
- private ControlUtils() {}
-
- /**
- * Implements the default control implementation binding algorithm ( <InterfaceName> + "Impl" ). See
- * documentation for the org.apache.beehive.controls.api.bean.ControlInterface annotation.
- *
- * @param implBinding the value of the defaultBinding attribute returned from a ControlInterface annotation
- * @param controlClass the actual name of the interface decorated by the ControlInterface annotation
- * @return the resolved defaultBinding value
- */
- public static String resolveDefaultBinding( String implBinding, String controlClass )
- {
- int intfIndex = implBinding.indexOf(ControlInterface.INTERFACE_NAME);
- if (intfIndex >= 0)
- {
- implBinding = implBinding.substring(0,intfIndex) + controlClass +
- implBinding.substring(intfIndex +
- ControlInterface.INTERFACE_NAME.length());
- }
- return implBinding;
- }
-
- /**
- * Returns the default binding based entirely upon annotations or naming conventions.
- * @param controlIntf the control interface class
- * @return the class name of the default control implementation binding
- */
- static String getDefaultControlBinding(Class controlIntf)
- {
- controlIntf = getMostDerivedInterface(controlIntf);
-
- ControlInterface intfAnnot =
- (ControlInterface)controlIntf.getAnnotation(ControlInterface.class);
- String implBinding = intfAnnot.defaultBinding();
- implBinding = resolveDefaultBinding( implBinding, controlIntf.getName() );
-
- return implBinding;
- }
-
- /**
- * Computes the most derived ControlInterface for the specified ControlExtension.
- * @param controlIntf
- * @return the most derived ControlInterface
- */
- static Class getMostDerivedInterface(Class controlIntf)
- {
- while (controlIntf.isAnnotationPresent(ControlExtension.class))
- {
- Class [] intfs = controlIntf.getInterfaces();
- boolean found = false;
- for (int i = 0; i < intfs.length; i++)
- {
- if (intfs[i].isAnnotationPresent(ControlExtension.class) ||
- intfs[i].isAnnotationPresent(ControlInterface.class))
- {
- controlIntf = intfs[i];
- found = true;
- break;
- }
- }
- if (!found)
- {
- throw new ControlException("Can't find base control interface for " + controlIntf);
- }
- }
- return controlIntf;
- }
-}
+/*
+ * 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.runtime.bean;
+
+import org.apache.beehive.controls.api.bean.ControlInterface;
+import org.apache.beehive.controls.api.bean.ControlExtension;
+import org.apache.beehive.controls.api.ControlException;
+
+/**
+ * Utilities used by the Controls runtime.
+ */
+public final class ControlUtils {
+
+ private ControlUtils() {}
+
+ /**
+ * Implements the default control implementation binding algorithm ( <InterfaceName> + "Impl" ). See
+ * documentation for the org.apache.beehive.controls.api.bean.ControlInterface annotation.
+ *
+ * @param implBinding the value of the defaultBinding attribute returned from a ControlInterface annotation
+ * @param controlClass the actual name of the interface decorated by the ControlInterface annotation
+ * @return the resolved defaultBinding value
+ */
+ public static String resolveDefaultBinding( String implBinding, String controlClass )
+ {
+ int intfIndex = implBinding.indexOf(ControlInterface.INTERFACE_NAME);
+ if (intfIndex >= 0)
+ {
+ implBinding = implBinding.substring(0,intfIndex) + controlClass +
+ implBinding.substring(intfIndex +
+ ControlInterface.INTERFACE_NAME.length());
+ }
+ return implBinding;
+ }
+
+ /**
+ * Returns the default binding based entirely upon annotations or naming conventions.
+ * @param controlIntf the control interface class
+ * @return the class name of the default control implementation binding
+ */
+ static String getDefaultControlBinding(Class controlIntf)
+ {
+ controlIntf = getMostDerivedInterface(controlIntf);
+
+ ControlInterface intfAnnot =
+ (ControlInterface)controlIntf.getAnnotation(ControlInterface.class);
+ String implBinding = intfAnnot.defaultBinding();
+ implBinding = resolveDefaultBinding( implBinding, controlIntf.getName() );
+
+ return implBinding;
+ }
+
+ /**
+ * Computes the most derived ControlInterface for the specified ControlExtension.
+ * @param controlIntf
+ * @return the most derived ControlInterface
+ */
+ static Class getMostDerivedInterface(Class controlIntf)
+ {
+ while (controlIntf.isAnnotationPresent(ControlExtension.class))
+ {
+ Class [] intfs = controlIntf.getInterfaces();
+ boolean found = false;
+ for (int i = 0; i < intfs.length; i++)
+ {
+ if (intfs[i].isAnnotationPresent(ControlExtension.class) ||
+ intfs[i].isAnnotationPresent(ControlInterface.class))
+ {
+ controlIntf = intfs[i];
+ found = true;
+ break;
+ }
+ }
+ if (!found)
+ {
+ throw new ControlException("Can't find base control interface for " + controlIntf);
+ }
+ }
+ return controlIntf;
+ }
+}
Propchange: beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ControlUtils.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/EventAdaptor.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/EventAdaptor.java?rev=406090&r1=406089&r2=406090&view=diff
==============================================================================
--- beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/EventAdaptor.java (original)
+++ beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/EventAdaptor.java Sat May 13 06:14:42 2006
@@ -1,30 +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.runtime.bean;
-
-/**
- * The EventAdaptor interface will be implemented by all code-generated event adaptor classes
- * used to deliver control events to clients.
- */
-public interface EventAdaptor
-{
- /**
- * Returns the client instance that will be the target of the event.
- */
- Object getClient();
-}
+/*
+ * 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.runtime.bean;
+
+/**
+ * The EventAdaptor interface will be implemented by all code-generated event adaptor classes
+ * used to deliver control events to clients.
+ */
+public interface EventAdaptor
+{
+ /**
+ * Returns the client instance that will be the target of the event.
+ */
+ Object getClient();
+}
Propchange: beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/EventAdaptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ImplInitializer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/ImplPersistenceDelegate.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/InterceptorUtils.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/InterceptorUtils.java?rev=406090&r1=406089&r2=406090&view=diff
==============================================================================
--- beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/InterceptorUtils.java (original)
+++ beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/InterceptorUtils.java Sat May 13 06:14:42 2006
@@ -1,117 +1,117 @@
-/*
- * 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.runtime.bean;
-
-import java.util.ArrayList;
-import java.util.Set;
-import java.util.HashSet;
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.IOException;
-
-/**
- * Class used to support prioritizing interceptors on methods of a {@link ControlBean}.
- */
-public final class InterceptorUtils {
-
- private InterceptorUtils() {}
-
- /**
- * Filename that contains ordering priority for controls interceptor services.
- * Each line in the file is a fully qualified interface name. The first line in the file
- * is highest priority.
- */
- public static final String INTERCEPTOR_CONFIG_FILE = "controls-interceptors.config";
-
- // todo: this interceptor priority list should be stored by ClassLoader instead of shared between them
- /**
- * List that keeps track of the interceptors in their priority order.
- */
- private static ArrayList<String> _interceptorPriorities;
-
- /**
- * Applies externally defined (via {@link #INTERCEPTOR_CONFIG_FILE}) ordering priority for
- * controls interceptor services.
- *
- * @param interceptors
- * @return String[]
- */
- public static String[] prioritizeInterceptors( String [] interceptors )
- {
- if ( interceptors == null )
- return null;
-
- // Read external configuration to obtain desired prioritization.
- if ( _interceptorPriorities == null )
- {
- // Only attempt to read the external configuration once; bounce the VM if you
- // want to try again.
- _interceptorPriorities = new ArrayList<String>();
- BufferedReader in = null;
- try
- {
- InputStream configFileStream =
- ControlBeanContext.class.getClassLoader().getResourceAsStream( INTERCEPTOR_CONFIG_FILE );
-
- if ( configFileStream != null )
- {
- in = new BufferedReader(new InputStreamReader(configFileStream));
- String str;
- while ((str = in.readLine()) != null)
- _interceptorPriorities.add(str);
- }
- }
- catch (IOException e)
- {
- // ignore
- }
- finally
- {
- try {
- if (in != null)
- in.close();
- }
- catch ( IOException ie ) { /* ignore */ }
- }
- }
-
- // Put input list of interceptors into a Set for easy lookup
- Set<String> input = new HashSet<String>();
- for ( String ii : interceptors )
- input.add( ii );
-
- // Scan through priorities list, building a prioritized list
- ArrayList<String> prioritized = new ArrayList<String>(interceptors.length);
- for ( String p : _interceptorPriorities )
- {
- if ( input.contains(p) )
- {
- input.remove(p);
- prioritized.add(p);
- }
- }
-
- // Anything still left in the input set did not have a priority associated with it,
- // so they just go at the end in arbitrary order.
- for ( String p : input )
- prioritized.add(p);
-
- return prioritized.toArray(new String[prioritized.size()]);
- }
-}
+/*
+ * 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.runtime.bean;
+
+import java.util.ArrayList;
+import java.util.Set;
+import java.util.HashSet;
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.IOException;
+
+/**
+ * Class used to support prioritizing interceptors on methods of a {@link ControlBean}.
+ */
+public final class InterceptorUtils {
+
+ private InterceptorUtils() {}
+
+ /**
+ * Filename that contains ordering priority for controls interceptor services.
+ * Each line in the file is a fully qualified interface name. The first line in the file
+ * is highest priority.
+ */
+ public static final String INTERCEPTOR_CONFIG_FILE = "controls-interceptors.config";
+
+ // todo: this interceptor priority list should be stored by ClassLoader instead of shared between them
+ /**
+ * List that keeps track of the interceptors in their priority order.
+ */
+ private static ArrayList<String> _interceptorPriorities;
+
+ /**
+ * Applies externally defined (via {@link #INTERCEPTOR_CONFIG_FILE}) ordering priority for
+ * controls interceptor services.
+ *
+ * @param interceptors
+ * @return String[]
+ */
+ public static String[] prioritizeInterceptors( String [] interceptors )
+ {
+ if ( interceptors == null )
+ return null;
+
+ // Read external configuration to obtain desired prioritization.
+ if ( _interceptorPriorities == null )
+ {
+ // Only attempt to read the external configuration once; bounce the VM if you
+ // want to try again.
+ _interceptorPriorities = new ArrayList<String>();
+ BufferedReader in = null;
+ try
+ {
+ InputStream configFileStream =
+ ControlBeanContext.class.getClassLoader().getResourceAsStream( INTERCEPTOR_CONFIG_FILE );
+
+ if ( configFileStream != null )
+ {
+ in = new BufferedReader(new InputStreamReader(configFileStream));
+ String str;
+ while ((str = in.readLine()) != null)
+ _interceptorPriorities.add(str);
+ }
+ }
+ catch (IOException e)
+ {
+ // ignore
+ }
+ finally
+ {
+ try {
+ if (in != null)
+ in.close();
+ }
+ catch ( IOException ie ) { /* ignore */ }
+ }
+ }
+
+ // Put input list of interceptors into a Set for easy lookup
+ Set<String> input = new HashSet<String>();
+ for ( String ii : interceptors )
+ input.add( ii );
+
+ // Scan through priorities list, building a prioritized list
+ ArrayList<String> prioritized = new ArrayList<String>(interceptors.length);
+ for ( String p : _interceptorPriorities )
+ {
+ if ( input.contains(p) )
+ {
+ input.remove(p);
+ prioritized.add(p);
+ }
+ }
+
+ // Anything still left in the input set did not have a priority associated with it,
+ // so they just go at the end in arbitrary order.
+ for ( String p : input )
+ prioritized.add(p);
+
+ return prioritized.toArray(new String[prioritized.size()]);
+ }
+}
Propchange: beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/InterceptorUtils.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/bean/UnicastEventNotifier.java
------------------------------------------------------------------------------
svn:eol-style = native