You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2006/07/20 18:50:24 UTC

svn commit: r423984 [1/2] - in /tapestry/tapestry5/tapestry-core/trunk/src: main/java/org/apache/tapestry/internal/ioc/ main/java/org/apache/tapestry/internal/ioc/services/ main/java/org/apache/tapestry/internal/util/ main/java/org/apache/tapestry/ioc/...

Author: hlship
Date: Thu Jul 20 09:50:22 2006
New Revision: 423984

URL: http://svn.apache.org/viewvc?rev=423984&view=rev
Log:
Move ClassFactory, ClassFab and related classes from HiveMind to Tapestry 5, refactoring, adding generics, and simplifying.

Added:
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/AbstractFab.java   (contents, props changed)
      - copied, changed from r386879, jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/impl/AbstractFab.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFabImpl.java   (contents, props changed)
      - copied, changed from r386879, jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/impl/ClassFabImpl.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFactoryClassLoader.java   (contents, props changed)
      - copied, changed from r386879, jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/impl/ClassFactoryClassLoader.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFactoryClassPool.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFactoryImpl.java   (contents, props changed)
      - copied, changed from r386879, jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/impl/ClassFactoryImpl.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/CtClassSource.java   (contents, props changed)
      - copied, changed from r386879, jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/impl/CtClassSource.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ServiceMessages.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/ClassFab.java   (contents, props changed)
      - copied, changed from r386879, jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/ClassFab.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/ClassFabUtils.java   (contents, props changed)
      - copied, changed from r386879, jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/ClassFabUtils.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/ClassFactory.java   (contents, props changed)
      - copied, changed from r386879, jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/ClassFactory.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/MethodFab.java   (contents, props changed)
      - copied, changed from r386879, jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/MethodFab.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/MethodIterator.java   (contents, props changed)
      - copied, changed from r386879, jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/MethodIterator.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/MethodSignature.java   (contents, props changed)
      - copied, changed from r386879, jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/MethodSignature.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/internal/ioc/services/
    tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/internal/ioc/services/ServiceStrings.properties
    tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/ioc/services/
    tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/ioc/services/AbstractIntWrapper.java   (contents, props changed)
      - copied, changed from r386879, jakarta/hivemind/trunk/framework/src/test/hivemind/test/services/AbstractIntWrapper.java
    tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/ioc/services/ClassFabImplTest.java
    tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/ioc/services/SimpleService.java   (contents, props changed)
      - copied, changed from r386879, jakarta/hivemind/trunk/framework/src/test/hivemind/test/services/SimpleService.java
    tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/services/
    tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/services/MethodIteratorTest.java
    tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/services/MethodSignatureTest.java
Modified:
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/ModuleImpl.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/util/InternalUtils.java
    tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/ioc/ModuleImplTest.java
    tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/ioc/TapestryIOCModule.java
    tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/util/InternalUtilsTest.java

Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/ModuleImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/ModuleImpl.java?rev=423984&r1=423983&r2=423984&view=diff
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/ModuleImpl.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/ModuleImpl.java Thu Jul 20 09:50:22 2006
@@ -25,11 +25,6 @@
 import java.util.Map;
 
 import org.apache.hivemind.service.BodyBuilder;
-import org.apache.hivemind.service.ClassFab;
-import org.apache.hivemind.service.ClassFabUtils;
-import org.apache.hivemind.service.ClassFactory;
-import org.apache.hivemind.service.MethodIterator;
-import org.apache.hivemind.service.MethodSignature;
 import org.apache.tapestry.internal.annotations.SuppressNullCheck;
 import org.apache.tapestry.ioc.IOCConstants;
 import org.apache.tapestry.ioc.ServiceCreator;
@@ -38,6 +33,11 @@
 import org.apache.tapestry.ioc.ServiceResources;
 import org.apache.tapestry.ioc.def.ModuleDef;
 import org.apache.tapestry.ioc.def.ServiceDef;
+import org.apache.tapestry.ioc.services.ClassFab;
+import org.apache.tapestry.ioc.services.ClassFabUtils;
+import org.apache.tapestry.ioc.services.ClassFactory;
+import org.apache.tapestry.ioc.services.MethodIterator;
+import org.apache.tapestry.ioc.services.MethodSignature;
 
 /**
  * @author Howard M. Lewis Ship
@@ -178,7 +178,7 @@
         creator = new LifecycleWrappedServiceCreator(lifecycle, resources, creator);
 
         // Built in services are not decorated, ever.
-        
+
         if (!_moduleDef.getModuleId().equals(INTERNAL_MODULE_ID))
             creator = new InterceptorStackBuilder(this, def.getServiceId(), creator);
 

Copied: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/AbstractFab.java (from r386879, jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/impl/AbstractFab.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/AbstractFab.java?p2=tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/AbstractFab.java&p1=jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/impl/AbstractFab.java&r1=386879&r2=423984&rev=423984&view=diff
==============================================================================
--- jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/impl/AbstractFab.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/AbstractFab.java Thu Jul 20 09:50:22 2006
@@ -12,23 +12,25 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.hivemind.service.impl;
+package org.apache.tapestry.internal.ioc.services;
+
+import static org.apache.tapestry.util.CollectionFactory.newMap;
 
-import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.tapestry.internal.annotations.SuppressNullCheck;
+
 import javassist.CtClass;
 
 /**
- * Common code for {@link org.apache.hivemind.service.impl.ClassFabImpl} and
- * {@link org.apache.hivemind.service.impl.InterfaceFabImpl}.
+ * Base class for {@link org.apache.tapestry.internal.ioc.services.ClassFabImpl}. This code is a
+ * fork from HiveMind; it is kept seperate from ClassFabImpl in case we want to re-introduce the
+ * idea of an InterfaceFab.
  * 
  * @author Howard M. Lewis Ship
- * @since 1.1
  */
 public class AbstractFab
 {
-
     private final CtClass _ctClass;
 
     private final CtClassSource _source;
@@ -41,10 +43,8 @@
 
     /**
      * Map from Class to CtClass.
-     * 
-     * @since 1.1
      */
-    private Map _ctClassCache = new HashMap();
+    private Map<Class, CtClass> _ctClassCache = newMap();
 
     public void addInterface(Class interfaceClass)
     {
@@ -53,6 +53,7 @@
         _ctClass.addInterface(ctInterfaceClass);
     }
 
+    @SuppressNullCheck
     protected CtClass[] convertClasses(Class[] inputClasses)
     {
         if (inputClasses == null || inputClasses.length == 0)
@@ -71,12 +72,9 @@
         return result;
     }
 
-    /**
-     * @since 1.1
-     */
     protected CtClass convertClass(Class inputClass)
     {
-        CtClass result = (CtClass) _ctClassCache.get(inputClass);
+        CtClass result = _ctClassCache.get(inputClass);
 
         if (result == null)
         {

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/AbstractFab.java
------------------------------------------------------------------------------
    cvs2svn:cvs-rev = 1.2

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/AbstractFab.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/AbstractFab.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Copied: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFabImpl.java (from r386879, jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/impl/ClassFabImpl.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFabImpl.java?p2=tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFabImpl.java&p1=jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/impl/ClassFabImpl.java&r1=386879&r2=423984&rev=423984&view=diff
==============================================================================
--- jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/impl/ClassFabImpl.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFabImpl.java Thu Jul 20 09:50:22 2006
@@ -12,14 +12,13 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.hivemind.service.impl;
+package org.apache.tapestry.internal.ioc.services;
+
+import static java.lang.String.format;
+import static org.apache.tapestry.util.CollectionFactory.newSet;
 
 import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import java.util.Set;
 
 import javassist.CannotCompileException;
 import javassist.CtClass;
@@ -28,100 +27,28 @@
 import javassist.CtMethod;
 import javassist.NotFoundException;
 
-import org.apache.hivemind.ApplicationRuntimeException;
-import org.apache.hivemind.service.ClassFab;
-import org.apache.hivemind.service.MethodFab;
-import org.apache.hivemind.service.MethodSignature;
+import org.apache.tapestry.internal.annotations.SuppressNullCheck;
+import org.apache.tapestry.internal.util.InternalUtils;
+import org.apache.tapestry.ioc.services.ClassFab;
+import org.apache.tapestry.ioc.services.ClassFabUtils;
+import org.apache.tapestry.ioc.services.MethodSignature;
+import org.apache.tapestry.util.Defense;
 
 /**
- * Implementation of {@link org.apache.hivemind.service.ClassFab}. Hides, as much as possible, the
- * underlying library (Javassist).
+ * Implementation of {@link org.apache.tapestry.ioc.services.ClassFab}. Hides, as much as possible,
+ * the underlying library (Javassist).
  * 
  * @author Howard Lewis Ship
  */
 public class ClassFabImpl extends AbstractFab implements ClassFab
 {
     /**
-     * Stores information about a constructor; used by toString().
-     * 
-     * @since 1.1
-     */
-
-    private class AddedConstructor
-    {
-        private Class[] _parameterTypes;
-
-        private Class[] _exceptionTypes;
-
-        private String _body;
-
-        AddedConstructor(Class[] parameterTypes, Class[] exceptionTypes, String body)
-        {
-            _parameterTypes = parameterTypes;
-            _exceptionTypes = exceptionTypes;
-            _body = body;
-        }
-
-        public String toString()
-        {
-            StringBuffer buffer = new StringBuffer();
-
-            buffer.append("public ");
-            buffer.append(getCtClass().getName());
-
-            buffer.append("(");
-
-            int count = size(_parameterTypes);
-            for (int i = 0; i < count; i++)
-            {
-                if (i > 0)
-                    buffer.append(", ");
-
-                buffer.append(_parameterTypes[i].getName());
-
-                buffer.append(" $");
-                buffer.append(i + 1);
-            }
-
-            buffer.append(")");
-
-            count = size(_exceptionTypes);
-            for (int i = 0; i < count; i++)
-            {
-                if (i == 0)
-                    buffer.append("\n  throws ");
-                else
-                    buffer.append(", ");
-
-                buffer.append(_exceptionTypes[i].getName());
-            }
-
-            buffer.append("\n");
-            buffer.append(_body);
-
-            buffer.append("\n");
-
-            return buffer.toString();
-        }
-
-        private int size(Object[] array)
-        {
-            return array == null ? 0 : array.length;
-        }
-    }
-
-    /**
-     * Map of {@link MethodFab}keyed on {@link MethodSignature}.
-     */
-    private Map _methods = new HashMap();
-
-    /**
-     * List of {@link AddedConstructor}.
-     * 
-     * @since 1.1
+     * Add fields, methods, and constructors are added, their psuedo-code is appended to this
+     * description, which is used by toString().
      */
+    private final StringBuffer _description = new StringBuffer();
 
-    private List _constructors = new ArrayList();
+    private final Set<MethodSignature> _addedSignatures = newSet();
 
     public ClassFabImpl(CtClassSource source, CtClass ctClass)
     {
@@ -140,14 +67,9 @@
 
         try
         {
-            buildClassAndInheritance(buffer);
-
-            buildFields(buffer);
-
-            buildConstructors(buffer);
-
-            buildMethods(buffer);
+            buffer.append(buildClassAndInheritance());
 
+            buffer.append(_description.toString());
         }
         catch (Exception ex)
         {
@@ -160,56 +82,13 @@
         return buffer.toString();
     }
 
-    /** @since 1.1 */
-    private void buildMethods(StringBuffer buffer)
-    {
-        Iterator i = _methods.values().iterator();
-        while (i.hasNext())
-        {
-
-            MethodFab mf = (MethodFab) i.next();
-
-            buffer.append("\n");
-            buffer.append(mf);
-            buffer.append("\n");
-        }
-    }
-
-    /** @since 1.1 */
-    private void buildConstructors(StringBuffer buffer)
-    {
-        Iterator i = _constructors.iterator();
-
-        while (i.hasNext())
-        {
-            buffer.append("\n");
-            buffer.append(i.next());
-        }
-    }
-
-    /** @since 1.1 */
-    private void buildFields(StringBuffer buffer) throws NotFoundException
+    private String buildClassAndInheritance() throws NotFoundException
     {
-        CtField fields[] = getCtClass().getDeclaredFields();
-
-        for (int i = 0; i < fields.length; i++)
-        {
-            buffer.append("\n");
-            buffer.append(modifiers(fields[i].getModifiers()));
-            buffer.append(" ");
-            buffer.append(fields[i].getType().getName());
-            buffer.append(" ");
-            buffer.append(fields[i].getName());
-            buffer.append(";\n");
-        }
-    }
+        StringBuffer buffer = new StringBuffer();
 
-    /** @since 1.1 */
-    private void buildClassAndInheritance(StringBuffer buffer) throws NotFoundException
-    {
-        buffer.append(modifiers(getCtClass().getModifiers()));
+        buffer.append(Modifier.toString(getCtClass().getModifiers()));
         buffer.append(" class ");
-        buffer.append(getCtClass().getName());
+        buffer.append(getName());
         buffer.append(" extends ");
         buffer.append(getCtClass().getSuperclass().getName());
         buffer.append("\n");
@@ -228,13 +107,10 @@
                 buffer.append(interfaces[i].getName());
             }
 
-            buffer.append("\n");
+            buffer.append("\n\n");
         }
-    }
 
-    private String modifiers(int modifiers)
-    {
-        return Modifier.toString(modifiers);
+        return buffer.toString();
     }
 
     /**
@@ -258,22 +134,18 @@
         }
         catch (CannotCompileException ex)
         {
-            throw new ApplicationRuntimeException(ServiceMessages.unableToAddField(
-                    name,
-                    getCtClass(),
-                    ex), ex);
+            // Have yet to find a way to make this happen!
+            throw new RuntimeException(ServiceMessages.unableToAddField(name, getCtClass(), ex), ex);
         }
-    }
 
-    public boolean containsMethod( MethodSignature ms )
-    {
-        return _methods.get( ms ) != null;
+        _description
+                .append(format("private %s %s;\n\n", ClassFabUtils.getJavaClassName(type), name));
     }
-    
-    public MethodFab addMethod(int modifiers, MethodSignature ms, String body)
+
+    public void addMethod(int modifiers, MethodSignature ms, String body)
     {
-        if (_methods.get(ms) != null)
-            throw new ApplicationRuntimeException(ServiceMessages.duplicateMethodInClass(ms, this));
+        if (_addedSignatures.contains(ms))
+            throw new RuntimeException(ServiceMessages.duplicateMethodInClass(ms, this));
 
         CtClass ctReturnType = convertClass(ms.getReturnType());
 
@@ -292,28 +164,27 @@
         }
         catch (Exception ex)
         {
-            throw new ApplicationRuntimeException(ServiceMessages.unableToAddMethod(
-                    ms,
-                    getCtClass(),
-                    ex), ex);
+            throw new RuntimeException(ServiceMessages.unableToAddMethod(ms, getCtClass(), ex), ex);
         }
 
-        // Return a MethodFab so the caller can add catches.
+        _addedSignatures.add(ms);
 
-        MethodFab result = new MethodFabImpl(getSource(), ms, method, body);
+        // modifiers, return type, name
 
-        _methods.put(ms, result);
+        _description.append(format("%s %s %s", Modifier.toString(modifiers), ClassFabUtils
+                .getJavaClassName(ms.getReturnType()), ms.getName()));
 
-        return result;
-    }
+        // parameters, exceptions and body from this:
+        addMethodDetailsToDescription(ms.getParameterTypes(), ms.getExceptionTypes(), body);
 
-    public MethodFab getMethodFab(MethodSignature ms)
-    {
-        return (MethodFab) _methods.get(ms);
+        _description.append("\n\n");
     }
 
+    @SuppressNullCheck
     public void addConstructor(Class[] parameterTypes, Class[] exceptions, String body)
     {
+        Defense.notBlank(body, "body");
+
         CtClass[] ctParameters = convertClasses(parameterTypes);
         CtClass[] ctExceptions = convertClasses(exceptions);
 
@@ -324,15 +195,69 @@
             constructor.setBody(body);
 
             getCtClass().addConstructor(constructor);
-
-            _constructors.add(new AddedConstructor(parameterTypes, exceptions, body));
         }
         catch (Exception ex)
         {
-            throw new ApplicationRuntimeException(ServiceMessages.unableToAddConstructor(
-                    getCtClass(),
-                    ex), ex);
+            throw new RuntimeException(ServiceMessages.unableToAddConstructor(getCtClass(), ex), ex);
         }
+
+        _description.append("public ");
+
+        // This isn't quite right; we should strip the package portion off of the name.
+        // However, fabricated classes are almost always in the "default" package, so
+        // this is OK.
+
+        _description.append(getName());
+
+        addMethodDetailsToDescription(parameterTypes, exceptions, body);
+
+        _description.append("\n\n");
     }
 
+    /**
+     * Adds a listing of method (or constructor) parameters and thrown exceptions, and the body, to
+     * the description
+     * 
+     * @param parameterTypes
+     *            types of method parameters, or null
+     * @param exceptions
+     *            types of throw exceptions, or null
+     * @param body
+     *            body of method or constructor
+     */
+    private void addMethodDetailsToDescription(Class[] parameterTypes, Class[] exceptions,
+            String body)
+    {
+        _description.append("(");
+
+        int count = InternalUtils.size(parameterTypes);
+        for (int i = 0; i < count; i++)
+        {
+            if (i > 0)
+                _description.append(", ");
+
+            _description.append(ClassFabUtils.getJavaClassName(parameterTypes[i]));
+
+            _description.append(" $");
+            _description.append(i + 1);
+        }
+
+        _description.append(")");
+
+        count = InternalUtils.size(exceptions);
+        for (int i = 0; i < count; i++)
+        {
+            if (i == 0)
+                _description.append("\n  throws ");
+            else
+                _description.append(", ");
+
+            // Since this can never be an array type, we don't need to use getJavaClassName
+
+            _description.append(exceptions[i].getName());
+        }
+
+        _description.append("\n");
+        _description.append(body);
+    }
 }

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFabImpl.java
------------------------------------------------------------------------------
    cvs2svn:cvs-rev = 1.10

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFabImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFabImpl.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Copied: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFactoryClassLoader.java (from r386879, jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/impl/ClassFactoryClassLoader.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFactoryClassLoader.java?p2=tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFactoryClassLoader.java&p1=jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/impl/ClassFactoryClassLoader.java&r1=386879&r2=423984&rev=423984&view=diff
==============================================================================
--- jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/impl/ClassFactoryClassLoader.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFactoryClassLoader.java Thu Jul 20 09:50:22 2006
@@ -12,20 +12,22 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.hivemind.service.impl;
+package org.apache.tapestry.internal.ioc.services;
+
+import static org.apache.tapestry.util.CollectionFactory.newList;
 
-import java.util.ArrayList;
 import java.util.List;
 
 /**
- * ClassLoader used to properly instantiate newly created classes.
+ * ClassLoader used to properly instantiate newly created classes. Manages a list of delegate class
+ * loaders, which will be searched as needed.
  * 
  * @author Howard Lewis Ship / Essl Christian
- * @see org.apache.hivemind.service.impl.CtClassSource
+ * @see org.apache.tapestry.internal.ioc.services.CtClassSource
  */
 class ClassFactoryClassLoader extends ClassLoader
 {
-    private List _loaders = new ArrayList();
+    private List<ClassLoader> _loaders = newList();
 
     /**
      * Adds a delegate class loader to the list of delegate class loaders.
@@ -62,11 +64,11 @@
             }
             catch (ClassNotFoundException ex)
             {
-                //
+                // Ignore, but try the next ClassLoader.
             }
         }
 
-        // Not found .. through the first exception
+        // Not found .. throw the first exception
 
         throw cnfex;
     }

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFactoryClassLoader.java
------------------------------------------------------------------------------
    cvs2svn:cvs-rev = 1.7

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFactoryClassLoader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFactoryClassLoader.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFactoryClassPool.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFactoryClassPool.java?rev=423984&view=auto
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFactoryClassPool.java (added)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFactoryClassPool.java Thu Jul 20 09:50:22 2006
@@ -0,0 +1,83 @@
+// Copyright 2004, 2005 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.
+
+package org.apache.tapestry.internal.ioc.services;
+
+import static org.apache.tapestry.util.CollectionFactory.newSet;
+
+import java.util.Set;
+
+import org.apache.tapestry.internal.annotations.SuppressNullCheck;
+
+import javassist.CannotCompileException;
+import javassist.ClassPath;
+import javassist.ClassPool;
+import javassist.CtClass;
+import javassist.LoaderClassPath;
+
+/**
+ * Used to ensure that {@link javassist.ClassPool#appendClassPath(javassist.ClassPath)} is invoked
+ * with a synchronized lock. Additionally, wraps around a shared
+ * {@link org.apache.hivemind.service.impl.ClassFactoryClassLoader}.
+ * 
+ * @author Howard Lewis Ship
+ */
+class ClassFactoryClassPool extends ClassPool
+{
+    private ClassFactoryClassLoader _loader = new ClassFactoryClassLoader();
+
+    /**
+     * Used to identify which class loaders have already been integrated into the pool.
+     */
+    private Set<ClassLoader> _loaders = newSet();
+
+    ClassFactoryClassPool()
+    {
+        super(null);
+
+        appendClassLoader(Thread.currentThread().getContextClassLoader());
+    }
+
+    /**
+     * Convienience method for adding to the ClassPath for a particular class loader.
+     * 
+     * @param loader
+     *            the class loader to add (derived from a loaded class, and may be null for some
+     *            system classes)
+     */
+    @SuppressNullCheck
+    public synchronized void appendClassLoader(ClassLoader loader)
+    {
+        if (loader == null || loader == _loader || _loaders.contains(loader))
+            return;
+
+        _loader.addDelegateLoader(loader);
+
+        ClassPath path = new LoaderClassPath(loader);
+
+        appendClassPath(path);
+
+        _loaders.add(loader);
+    }
+
+    /**
+     * Invoked to convert an fabricated class into a real class. The new classes' class loader will
+     * be the delegating ClassFactoryClassLoader, which has visibility to all class loaders for all
+     * modules.
+     */
+    public synchronized Class toClass(CtClass ctClass) throws CannotCompileException
+    {
+        return ctClass.toClass(_loader);
+    }
+}
\ No newline at end of file

Copied: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFactoryImpl.java (from r386879, jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/impl/ClassFactoryImpl.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFactoryImpl.java?p2=tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFactoryImpl.java&p1=jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/impl/ClassFactoryImpl.java&r1=386879&r2=423984&rev=423984&view=diff
==============================================================================
--- jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/impl/ClassFactoryImpl.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFactoryImpl.java Thu Jul 20 09:50:22 2006
@@ -12,17 +12,15 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.hivemind.service.impl;
+package org.apache.tapestry.internal.ioc.services;
 
 import javassist.CtClass;
 
-import org.apache.hivemind.ApplicationRuntimeException;
-import org.apache.hivemind.service.ClassFab;
-import org.apache.hivemind.service.ClassFactory;
-import org.apache.hivemind.service.InterfaceFab;
+import org.apache.tapestry.ioc.services.ClassFab;
+import org.apache.tapestry.ioc.services.ClassFactory;
 
 /**
- * Implementation of {@link org.apache.hivemind.service.ClassFactory}.
+ * Implementation of {@link org.apache.tapestry.ioc.services.ClassFactory}.
  * 
  * @author Howard Lewis Ship
  */
@@ -31,7 +29,7 @@
     /**
      * ClassPool shared by all modules (all CtClassSource instances).
      */
-    private HiveMindClassPool _pool = new HiveMindClassPool();
+    private ClassFactoryClassPool _pool = new ClassFactoryClassPool();
 
     private CtClassSource _classSource = new CtClassSource(_pool);
 
@@ -45,30 +43,12 @@
         }
         catch (Exception ex)
         {
-            throw new ApplicationRuntimeException(ServiceMessages.unableToCreateClass(
-                    name,
-                    superClass,
-                    ex), ex);
+            throw new RuntimeException(ServiceMessages.unableToCreateClass(name, superClass, ex),
+                    ex);
         }
     }
 
     /** @since 1.1 */
-
-    public InterfaceFab newInterface(String name)
-    {
-        try
-        {
-            CtClass ctNewClass = _classSource.newInterface(name);
-
-            return new InterfaceFabImpl(_classSource, ctNewClass);
-        }
-        catch (Exception ex)
-        {
-            throw new ApplicationRuntimeException(
-                    ServiceMessages.unableToCreateInterface(name, ex), ex);
-        }
-
-    }
 
     public int getCreatedClassCount()
     {

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFactoryImpl.java
------------------------------------------------------------------------------
    cvs2svn:cvs-rev = 1.10

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFactoryImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ClassFactoryImpl.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Copied: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/CtClassSource.java (from r386879, jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/impl/CtClassSource.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/CtClassSource.java?p2=tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/CtClassSource.java&p1=jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/impl/CtClassSource.java&r1=386879&r2=423984&rev=423984&view=diff
==============================================================================
--- jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/impl/CtClassSource.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/CtClassSource.java Thu Jul 20 09:50:22 2006
@@ -12,40 +12,36 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.hivemind.service.impl;
+package org.apache.tapestry.internal.ioc.services;
 
 import javassist.CtClass;
 import javassist.NotFoundException;
 
-import org.apache.hivemind.ApplicationRuntimeException;
-import org.apache.hivemind.service.ClassFabUtils;
+import org.apache.tapestry.ioc.services.ClassFabUtils;
 
 /**
  * Wrapper around Javassist's {@link javassist.ClassPool} and our own
- * {@link org.apache.hivemind.service.impl.ClassFactoryClassLoader} that manages the creation of new
- * instance of {@link javassist.CtClass} and converts finished CtClass's into instantiable Classes.
+ * {@link org.apache.tapestry.internal.ioc.services.ClassFactoryClassLoader} that manages the
+ * creation of new instances of {@link javassist.CtClass} and converts finished CtClass's into
+ * instantiable Classes.
  * 
  * @author Howard Lewis Ship
  */
-public class CtClassSource
+class CtClassSource
 {
-    private HiveMindClassPool _pool;
+    private ClassFactoryClassPool _pool;
 
     private int _createdClassCount = 0;
 
     /**
      * Returns the number of classes (and interfaces) created by this source.
-     * 
-     * @see #createClass(CtClass)
-     * @return the count
-     * @since 1.2
      */
     public int getCreatedClassCount()
     {
         return _createdClassCount;
     }
 
-    public CtClassSource(HiveMindClassPool pool)
+    public CtClassSource(ClassFactoryClassPool pool)
     {
         _pool = pool;
     }
@@ -67,32 +63,19 @@
         }
         catch (NotFoundException ex)
         {
-            throw new ApplicationRuntimeException(ServiceMessages.unableToLookupClass(name, ex), ex);
+            throw new RuntimeException(ServiceMessages.unableToLookupClass(name, ex), ex);
         }
     }
 
-    public CtClass newClass(String name, Class superClass)
+    public synchronized CtClass newClass(String name, Class superClass)
     {
         CtClass ctSuperClass = getCtClass(superClass);
 
         return _pool.makeClass(name, ctSuperClass);
     }
 
-    /**
-     * Creates a new, empty interace, with the given name.
-     * 
-     * @since 1.1
-     */
-
-    public CtClass newInterface(String name)
+    public synchronized Class createClass(CtClass ctClass)
     {
-        return _pool.makeInterface(name);
-    }
-
-    public Class createClass(CtClass ctClass)
-    {
-        // String className = ctClass.getName();
-
         try
         {
             Class result = _pool.toClass(ctClass);
@@ -103,8 +86,7 @@
         }
         catch (Throwable ex)
         {
-            throw new ApplicationRuntimeException(ServiceMessages.unableToWriteClass(ctClass, ex),
-                    ex);
+            throw new RuntimeException(ServiceMessages.unableToWriteClass(ctClass, ex), ex);
         }
     }
 }

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/CtClassSource.java
------------------------------------------------------------------------------
    cvs2svn:cvs-rev = 1.8

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/CtClassSource.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/CtClassSource.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ServiceMessages.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ServiceMessages.java?rev=423984&view=auto
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ServiceMessages.java (added)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/ioc/services/ServiceMessages.java Thu Jul 20 09:50:22 2006
@@ -0,0 +1,67 @@
+// 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.
+
+package org.apache.tapestry.internal.ioc.services;
+
+import javassist.CtClass;
+
+import org.apache.hivemind.Messages;
+import org.apache.hivemind.impl.MessageFormatter;
+import org.apache.tapestry.internal.annotations.Utility;
+import org.apache.tapestry.ioc.services.MethodSignature;
+
+/**
+ * @author Howard M. Lewis Ship
+ */
+@Utility
+final class ServiceMessages
+{
+    private final static Messages MESSAGES = new MessageFormatter(ServiceMessages.class);
+
+    static String unableToAddMethod(MethodSignature signature, CtClass ctClass, Throwable cause)
+    {
+        return MESSAGES.format("unable-to-add-method", signature, ctClass.getName(), cause);
+    }
+
+    static String unableToAddConstructor(CtClass ctClass, Throwable cause)
+    {
+        return MESSAGES.format("unable-to-add-constructor", ctClass.getName(), cause);
+    }
+
+    static String unableToAddField(String fieldName, CtClass ctClass, Throwable cause)
+    {
+        return MESSAGES.format("unable-to-add-field", fieldName, ctClass.getName(), cause);
+    }
+
+    static String unableToCreateClass(String className, Class superClass, Throwable cause)
+    {
+        return MESSAGES.format("unable-to-create-class", className, superClass.getName(), cause);
+    }
+
+    static String unableToLookupClass(String className, Throwable cause)
+    {
+        return MESSAGES.format("unable-to-lookup-class", className, cause);
+    }
+
+    static String unableToWriteClass(CtClass ctClass, Throwable cause)
+    {
+        return MESSAGES.format("unable-to-write-class", ctClass.getName(), cause);
+    }
+
+    static String duplicateMethodInClass(MethodSignature ms, ClassFabImpl fab)
+    {
+        return MESSAGES.format("duplicate-method-in-class", ms, fab.getName());
+    }
+
+}

Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/util/InternalUtils.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/util/InternalUtils.java?rev=423984&r1=423983&r2=423984&view=diff
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/util/InternalUtils.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/util/InternalUtils.java Thu Jul 20 09:50:22 2006
@@ -16,6 +16,7 @@
 
 import java.lang.reflect.Method;
 
+import org.apache.tapestry.internal.annotations.SuppressNullCheck;
 import org.apache.tapestry.internal.annotations.Utility;
 
 /**
@@ -51,9 +52,15 @@
             int dotx = name.lastIndexOf('.');
 
             buffer.append(name.substring(dotx + 1));
-
         }
 
         return buffer.append(")").toString();
+    }
+
+    /** Returns the size of an object array, or null if the array is empty. */
+    @SuppressNullCheck
+    public static int size(Object[] array)
+    {
+        return array == null ? 0 : array.length;
     }
 }

Copied: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/ClassFab.java (from r386879, jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/ClassFab.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/ClassFab.java?p2=tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/ClassFab.java&p1=jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/ClassFab.java&r1=386879&r2=423984&rev=423984&view=diff
==============================================================================
--- jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/ClassFab.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/ClassFab.java Thu Jul 20 09:50:22 2006
@@ -12,35 +12,37 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.hivemind.service;
+package org.apache.tapestry.ioc.services;
+
+import org.apache.hivemind.ApplicationRuntimeException;
 
 /**
- * Used when fabricating a new class.  Represents a wrapper around
- * the Javassist library.
- * 
+ * Used when fabricating a new class. Represents a wrapper around the Javassist library.
  * <p>
- * The core concept of Javassist is how method bodies (as well as constructor bodies, etc.)
- * are specified ... as a very Java-like scripting language.  The 
- * {@link org.apache.hivemind.service.BodyBuilder} class is <em>very</em> useful for assembling
- * this method bodies.  Details are available at the
- * <a href="http://jboss.org/products/javassist">Javassist home page</a>.
- * 
+ * The core concept of Javassist is how method bodies (as well as constructor bodies, etc.) are
+ * specified ... as a very Java-like scripting language. Details are available at the <a
+ * href="http://jboss.org/products/javassist">Javassist home page</a>.
  * <p>
- * Method bodies look largely like Java. References to java classes must be fully qualified.
- * Several special variables are used:
+ * Method bodies look largely like Java. References to java classes must be fully qualified. Several
+ * special variables are used:
  * <ul>
  * <li><code>$0</code> first parameter, equivalent to <code>this</code> in Java code (and can't
  * be used when creating a static method)
  * <li><code>$1, $2, ...</code> actual parameters to the method
  * <li><code>$args</code> all the parameters as an <code>Object[]</code>
- * <li><code>$r</code> the return type of the method, typically used as <code>return ($r) ...</code>.
- * <code>$r</code> is valid with method that return <code>void</code>. This also handles conversions
- * between wrapper types and primitive types.
- * <li><code>$w</code> conversion from primitive type to wrapper type, used as <code>($w) foo()</code> where
- * <code>foo()</code> returns a primitive type and a wrapper type is needed
+ * <li><code>$r</code> the return type of the method, typically used as
+ * <code>return ($r) ...</code>. <code>$r</code> is valid with method that return
+ * <code>void</code>. This also handles conversions between wrapper types and primitive types.
+ * <li><code>$w</code> conversion from primitive type to wrapper type, used as
+ * <code>($w) foo()</code> where <code>foo()</code> returns a primitive type and a wrapper type
+ * is needed
  * <li>
  * </ul>
- *
+ * <p>
+ * ClassFab instances are not thread safe.
+ * <p>
+ * ClassFab instances are created by a {@link org.apache.tapestry.ioc.services.ClassFactory}.
+ * 
  * @author Howard Lewis Ship
  */
 public interface ClassFab
@@ -51,53 +53,43 @@
     public void addInterface(Class interfaceClass);
 
     /**
-     * Adds a new field with the given name and type.  The field is
-     * added as a private field.
+     * Adds a new field with the given name and type. The field is added as a private field.
      */
 
     public void addField(String name, Class type);
 
     /**
-     * Convenience method for checking whether the fabricated class already contains
-     * a method.
-     * @param signature the signature
-     * @return whether or not the fabricated class already contains the method
-     */
-    public boolean containsMethod( MethodSignature signature );
-    
-    /**
-     * Adds a method.  The method is a public instance method.
+     * Adds a method. The method is a public instance method.
+     * 
      * @return a method fabricator, used to add catch handlers.
-     * @param modifiers Modifiers for the method (see {@link java.lang.reflect.Modifier}).
-     * @param signature defines the name, return type, parameters and exceptions thrown
-     * @param body The body of the method.
-     * @throws ApplicationRuntimeException if a method with that signature has already
-     * been added, or if there is a Javassist compilation error
+     * @param modifiers
+     *            Modifiers for the method (see {@link java.lang.reflect.Modifier}).
+     * @param signature
+     *            defines the name, return type, parameters and exceptions thrown
+     * @param body
+     *            The body of the method.
+     * @throws ApplicationRuntimeException
+     *             if a method with that signature has already been added, or if there is a
+     *             Javassist compilation error
      */
 
-    public MethodFab addMethod(int modifiers, MethodSignature signature, String body);
+    public void addMethod(int modifiers, MethodSignature signature, String body);
 
     /**
-     * Returns a previous defined method so that it can be further enhanced
-     * (perhaps by adding additional catches, etc.).
+     * Adds a constructor to the class. The constructor will be public.
      * 
-     * @param signature the signature of the method previously added
-     * @return the MethodFab for that method, or null if the method has not been added yet
-     */
-
-    public MethodFab getMethodFab(MethodSignature signature);
-
-    /**
-     * Adds a constructor to the class.  The constructor will be public.
-     * @param parameterTypes the type of each parameter, or null if the constructor takes no parameters.
-     * @param exceptions the type of each exception, or null if the constructor throws no exceptions.
-     * @param body The body of the constructor.
+     * @param parameterTypes
+     *            the type of each parameter, or null if the constructor takes no parameters.
+     * @param exceptions
+     *            the type of each exception, or null if the constructor throws no exceptions.
+     * @param body
+     *            The body of the constructor.
      */
     public void addConstructor(Class[] parameterTypes, Class[] exceptions, String body);
 
     /**
-     * Invoked last to create the class.  This will enforce that
-     * all abstract methods have been implemented in the (concrete) class.
+     * Invoked last to create the class. This will enforce that all abstract methods have been
+     * implemented in the (concrete) class.
      */
     public Class createClass();
 }

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/ClassFab.java
------------------------------------------------------------------------------
    cvs2svn:cvs-rev = 1.5

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/ClassFab.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/ClassFab.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Copied: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/ClassFabUtils.java (from r386879, jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/ClassFabUtils.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/ClassFabUtils.java?p2=tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/ClassFabUtils.java&p1=jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/ClassFabUtils.java&r1=386879&r2=423984&rev=423984&view=diff
==============================================================================
--- jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/ClassFabUtils.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/ClassFabUtils.java Thu Jul 20 09:50:22 2006
@@ -12,17 +12,20 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.hivemind.service;
+package org.apache.tapestry.ioc.services;
 
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
-import java.lang.reflect.Proxy;
+
+import org.apache.tapestry.internal.annotations.Utility;
 
 /**
- * Static class containing utility methods.
+ * Handy method useful when creating new classes using
+ * {@link org.apache.tapestry.ioc.services.ClassFab}.
  * 
  * @author Howard Lewis Ship
  */
+@Utility
 public class ClassFabUtils
 {
     private static long _uid = System.currentTimeMillis();
@@ -45,11 +48,9 @@
     /**
      * Returns a class name derived from the provided interfaceClass. The package part of the
      * interface name is stripped out, and the result passed to {@link #generateClassName(String)}.
-     * 
-     * @since 1.1
      */
 
-    public static synchronized String generateClassName(Class interfaceClass)
+    public static String generateClassName(Class interfaceClass)
     {
         String name = interfaceClass.getName();
 
@@ -107,29 +108,10 @@
     }
 
     /**
-     * Returns the class of an instance. However, if the instance is, in fact, a JDK proxy, returns
-     * the interfaceClass (because JDK proxies do not work with Javassist).
-     * 
-     * @param instance
-     *            the object instance to obtain a class from
-     * @param interfaceClass
-     *            the interface class to return if the instance is a JDK proxy.
-     */
-    public static Class getInstanceClass(Object instance, Class interfaceClass)
-    {
-        Class instanceClass = instance.getClass();
-
-        if (Proxy.isProxyClass(instanceClass))
-            return interfaceClass;
-
-        return instanceClass;
-    }
-
-    /**
      * Adds a method that does nothing. If the method returns a value, it will return null, 0 or
      * false (depending on the type).
-     * 
-     * @since 1.1
+     * <p>
+     * TODO: Move this into ClassFab.
      */
 
     public static void addNoOpMethod(ClassFab cf, MethodSignature m)

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/ClassFabUtils.java
------------------------------------------------------------------------------
    cvs2svn:cvs-rev = 1.7

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/ClassFabUtils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/ClassFabUtils.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Copied: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/ClassFactory.java (from r386879, jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/ClassFactory.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/ClassFactory.java?p2=tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/ClassFactory.java&p1=jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/ClassFactory.java&r1=386879&r2=423984&rev=423984&view=diff
==============================================================================
--- jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/ClassFactory.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/ClassFactory.java Thu Jul 20 09:50:22 2006
@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.hivemind.service;
+package org.apache.tapestry.ioc.services;
 
 /**
  * Service used when dynamically creating new classes.
@@ -23,25 +23,16 @@
 {
     /**
      * Creates a {@link ClassFab} object for the given name; the new class is a subclass of the
-     * indicated class. The new class is public and concrete.
-     * <p>
-     * <b>Incompatible change from 1.0: The module parameter has been removed. </b>
+     * indicated class. The new class is always public and concrete.
      * 
      * @param name
-     *            the full qualified name of the class to create
+     *            the full qualified name of the class to create (note that it is common to place
+     *            created classes in the default package)
      * @param superClass
      *            the parent class, which is often java.lang.Object
      */
 
     ClassFab newClass(String name, Class superClass);
-
-    /**
-     * Creates a new {@link org.apache.hivemind.service.InterfaceFab} object with the given name.
-     * 
-     * @since 1.1
-     */
-
-    InterfaceFab newInterface(String name);
 
     /**
      * Returns the number of classes (and interfaces) actually created.

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/ClassFactory.java
------------------------------------------------------------------------------
    cvs2svn:cvs-rev = 1.8

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/ClassFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/ClassFactory.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Copied: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/MethodFab.java (from r386879, jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/MethodFab.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/MethodFab.java?p2=tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/MethodFab.java&p1=jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/MethodFab.java&r1=386879&r2=423984&rev=423984&view=diff
==============================================================================
--- jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/MethodFab.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/MethodFab.java Thu Jul 20 09:50:22 2006
@@ -12,12 +12,12 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.hivemind.service;
+package org.apache.tapestry.ioc.services;
 
 /**
  * Represents a created method on a class; used to add catch handlers.
  * 
- * @see org.apache.hivemind.service.ClassFab#addMethod(int, MethodSignature, String)
+ * @see org.apache.tapestry.ioc.services.ClassFab#addMethod(int, MethodSignature, String)
  */
 public interface MethodFab
 {

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/MethodFab.java
------------------------------------------------------------------------------
    cvs2svn:cvs-rev = 1.4

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/MethodFab.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/MethodFab.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Copied: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/MethodIterator.java (from r386879, jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/MethodIterator.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/MethodIterator.java?p2=tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/MethodIterator.java&p1=jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/MethodIterator.java&r1=386879&r2=423984&rev=423984&view=diff
==============================================================================
--- jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/MethodIterator.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/MethodIterator.java Thu Jul 20 09:50:22 2006
@@ -12,21 +12,26 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.hivemind.service;
+package org.apache.tapestry.ioc.services;
+
+import static org.apache.tapestry.util.CollectionFactory.newList;
+import static org.apache.tapestry.util.CollectionFactory.newMap;
 
 import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.NoSuchElementException;
 
-import org.apache.hivemind.util.Defense;
+import org.apache.tapestry.util.CollectionFactory;
 
 /**
- * Utility used to iterate over the visible methods of a class.
+ * Utility used to iterate over the publically visible methods of a class or interface. The
+ * MethodIterator understands some complications that can occur when a class inherits the same
+ * method from multiple interfaces and with slightly different signatures (due to the fact that
+ * declared thrown exceptions can vary slightly for the "same" method).
  * 
  * @author Howard Lewis Ship
+ * @see org.apache.tapestry.ioc.services.MethodSignature#isOverridingSignatureOf(MethodSignature)
  */
 public class MethodIterator
 {
@@ -34,36 +39,32 @@
 
     private int _index = 0;
 
-    /** @since 1.1 */
-    private int _count;
+    private final int _count;
 
-    /** @since 1.1 */
-    private List _signatures;
+    private final List<MethodSignature> _signatures;
 
     public MethodIterator(Class subjectClass)
     {
-        Defense.notNull(subjectClass, "subjectClass");
-
         Method[] methods = subjectClass.getMethods();
 
-        Map map = new HashMap();
+        Map<String, MethodSignature> map = newMap();
 
         for (int i = 0; i < methods.length; i++)
             processMethod(methods[i], map);
 
-        _signatures = new ArrayList(map.values());
+        _signatures = newList(map.values());
         _count = _signatures.size();
     }
 
     /** @since 1.1 */
-    private void processMethod(Method m, Map map)
+    private void processMethod(Method m, Map<String, MethodSignature> map)
     {
         _toString |= ClassFabUtils.isToString(m);
 
         MethodSignature sig = new MethodSignature(m);
         String uid = sig.getUniqueId();
 
-        MethodSignature existing = (MethodSignature) map.get(uid);
+        MethodSignature existing = map.get(uid);
 
         if (existing == null || sig.isOverridingSignatureOf(existing))
             map.put(uid, sig);
@@ -88,11 +89,13 @@
         if (_index >= _count)
             throw new NoSuchElementException();
 
-        return (MethodSignature) _signatures.get(_index++);
+        return _signatures.get(_index++);
     }
 
     /**
      * Returns true if the method <code>public String toString()</code> is part of the interface.
+     * This will be known immediately after iterator contruction (it is not necessary to iterate the
+     * methods first).
      */
     public boolean getToString()
     {

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/MethodIterator.java
------------------------------------------------------------------------------
    cvs2svn:cvs-rev = 1.5

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/MethodIterator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/MethodIterator.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Copied: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/MethodSignature.java (from r386879, jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/MethodSignature.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/MethodSignature.java?p2=tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/MethodSignature.java&p1=jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/MethodSignature.java&r1=386879&r2=423984&rev=423984&view=diff
==============================================================================
--- jakarta/hivemind/trunk/framework/src/java/org/apache/hivemind/service/MethodSignature.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/MethodSignature.java Thu Jul 20 09:50:22 2006
@@ -12,10 +12,16 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.hivemind.service;
+package org.apache.tapestry.ioc.services;
+
+import static org.apache.tapestry.internal.util.InternalUtils.size;
+import static org.apache.tapestry.util.Defense.notBlank;
+import static org.apache.tapestry.util.Defense.notNull;
 
 import java.lang.reflect.Method;
 
+import org.apache.tapestry.internal.annotations.SuppressNullCheck;
+
 /**
  * A representation of a {@link java.lang.reflect.Method}, identifying the name, return type,
  * parameter types and exception types. Actual Method objects are tied to a particular class, and
@@ -26,6 +32,13 @@
  * abstract) we don't bother to actually track the modifiers. In addition, at this time,
  * MethodSignature <em>does not distinguish between instance and static
  * methods</em>.
+ * <p>
+ * This version of MethodSignature works with <em>loaded</em> classes, and it usually used in the
+ * context of {@link org.apache.tapestry.ioc.services.ClassFab} to create new classes and
+ * subclasses. Another class with the same name,
+ * {@link org.apache.tapestry.transform.MethodSignature} is similar, but is used <em>before</em>
+ * classes are loaded, to transform the classes as they are loaded (it uses strings for class names,
+ * where this class uses Class instances).
  * 
  * @author Howard Lewis Ship
  */
@@ -41,11 +54,14 @@
 
     private Class[] _exceptionTypes;
 
+    @SuppressNullCheck
     public MethodSignature(Class returnType, String name, Class[] parameterTypes,
             Class[] exceptionTypes)
     {
-        _returnType = returnType;
-        _name = name;
+        _returnType = notNull(returnType, "returnType");
+        _name = notBlank(name, "name");
+
+        // Can be null!
         _parameterTypes = parameterTypes;
         _exceptionTypes = exceptionTypes;
     }
@@ -92,12 +108,12 @@
 
             _hashCode = 31 * _hashCode + _name.hashCode();
 
-            int count = count(_parameterTypes);
+            int count = size(_parameterTypes);
 
             for (int i = 0; i < count; i++)
                 _hashCode = 31 * _hashCode + _parameterTypes[i].hashCode();
 
-            count = count(_exceptionTypes);
+            count = size(_exceptionTypes);
 
             for (int i = 0; i < count; i++)
                 _hashCode = 31 * _hashCode + _exceptionTypes[i].hashCode();
@@ -106,14 +122,11 @@
         return _hashCode;
     }
 
-    private static int count(Object[] array)
-    {
-        return array == null ? 0 : array.length;
-    }
-
     /**
-     * Returns true if the other object is an instance of MethodSignature with identical values for
-     * return type, name, parameter types and exception types.
+     * Returns true if the other object is an instance of MethodSignature with <em>identical</em>
+     * values for return type, name, parameter types and exception types.
+     * 
+     * @see #isOverridingSignatureOf(MethodSignature)
      */
     public boolean equals(Object o)
     {
@@ -136,8 +149,8 @@
 
     private boolean mismatch(Class[] a1, Class[] a2)
     {
-        int a1Count = count(a1);
-        int a2Count = count(a2);
+        int a1Count = size(a1);
+        int a2Count = size(a2);
 
         if (a1Count != a2Count)
             return true;
@@ -163,7 +176,7 @@
         buffer.append(_name);
         buffer.append("(");
 
-        for (int i = 0; i < count(_parameterTypes); i++)
+        for (int i = 0; i < size(_parameterTypes); i++)
         {
             if (i > 0)
                 buffer.append(", ");
@@ -173,7 +186,7 @@
 
         buffer.append(")");
 
-        for (int i = 0; i < count(_exceptionTypes); i++)
+        for (int i = 0; i < size(_exceptionTypes); i++)
         {
             if (i == 0)
                 buffer.append(" throws ");
@@ -190,16 +203,16 @@
      * Returns a string consisting of the name of the method and its parameter values. This is
      * similar to {@link #toString()}, but omits the return type and information about thrown
      * exceptions. A unique id is used by {@link MethodIterator} to identify overlapping methods
-     * (methods with the same name but different thrown exceptions).
+     * (methods with the same name and parameter types but with different thrown exceptions).
      * 
-     * @since 1.1
+     * @see #isOverridingSignatureOf(MethodSignature)
      */
     public String getUniqueId()
     {
         StringBuffer buffer = new StringBuffer(_name);
         buffer.append("(");
 
-        for (int i = 0; i < count(_parameterTypes); i++)
+        for (int i = 0; i < size(_parameterTypes); i++)
         {
             if (i > 0)
                 buffer.append(",");
@@ -214,10 +227,8 @@
 
     /**
      * Returns true if this signature has the same return type, name and parameters types as the
-     * method signature passed in, and this signatures exceptions "trump" (are the same as, or
+     * method signature passed in, and this signature's exceptions "trump" (are the same as, or
      * super-implementations of, all exceptions thrown by the other method signature).
-     * 
-     * @since 1.1
      */
 
     public boolean isOverridingSignatureOf(MethodSignature ms)
@@ -237,14 +248,12 @@
     /**
      * The nuts and bolts of checking that another method signature's exceptions are a subset of
      * this signature's.
-     * 
-     * @since 1.1
      */
 
     private boolean exceptionsEncompass(Class[] otherExceptions)
     {
-        int ourCount = count(_exceptionTypes);
-        int otherCount = count(otherExceptions);
+        int ourCount = size(_exceptionTypes);
+        int otherCount = size(otherExceptions);
 
         // If we have no exceptions, then ours encompass theirs only if they
         // have no exceptions, either.
@@ -260,13 +269,13 @@
             for (int j = 0; j < otherCount; j++)
             {
                 // Ignore exceptions that have already been matched
-                
+
                 if (matched[j])
                     continue;
 
                 // When one of our exceptions is a super-class of one of their exceptions,
                 // then their exceptions is matched.
-                
+
                 if (_exceptionTypes[i].isAssignableFrom(otherExceptions[j]))
                 {
                     matched[j] = true;

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/MethodSignature.java
------------------------------------------------------------------------------
    cvs2svn:cvs-rev = 1.4

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/MethodSignature.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/ioc/services/MethodSignature.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/internal/ioc/services/ServiceStrings.properties
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/internal/ioc/services/ServiceStrings.properties?rev=423984&view=auto
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/internal/ioc/services/ServiceStrings.properties (added)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/internal/ioc/services/ServiceStrings.properties Thu Jul 20 09:50:22 2006
@@ -0,0 +1,20 @@
+# 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.
+
+unable-to-add-method=Unable to add method {0} to class {1}: {2}
+unable-to-add-constructor=Unable to add constructor to class {0}: {1}
+unable-to-create-class=Unable to create class {0} as subclass of {1}: {2}
+unable-to-lookup-class=Unable to lookup class {0}: {1}
+unable-to-write-class=Unable to create class {0}: {1}
+duplicate-method-in-class=Attempt to redefine method {0} of class {1}.

Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/ioc/ModuleImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/ioc/ModuleImplTest.java?rev=423984&r1=423983&r2=423984&view=diff
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/ioc/ModuleImplTest.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/ioc/ModuleImplTest.java Thu Jul 20 09:50:22 2006
@@ -20,12 +20,12 @@
 import java.util.Collection;
 
 import org.apache.commons.logging.Log;
-import org.apache.hivemind.service.ClassFactory;
-import org.apache.hivemind.service.impl.ClassFactoryImpl;
+import org.apache.tapestry.internal.ioc.services.ClassFactoryImpl;
 import org.apache.tapestry.internal.test.InternalBaseTestCase;
 import org.apache.tapestry.ioc.Registry;
 import org.apache.tapestry.ioc.RegistryBuilder;
 import org.apache.tapestry.ioc.def.ModuleDef;
+import org.apache.tapestry.ioc.services.ClassFactory;
 import org.testng.annotations.Test;
 
 /**

Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/ioc/TapestryIOCModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/ioc/TapestryIOCModule.java?rev=423984&r1=423983&r2=423984&view=diff
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/ioc/TapestryIOCModule.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/ioc/TapestryIOCModule.java Thu Jul 20 09:50:22 2006
@@ -14,10 +14,10 @@
 
 package org.apache.tapestry.internal.ioc;
 
-import org.apache.hivemind.service.ClassFactory;
-import org.apache.hivemind.service.impl.ClassFactoryImpl;
+import org.apache.tapestry.internal.ioc.services.ClassFactoryImpl;
 import org.apache.tapestry.ioc.annotations.Id;
 import org.apache.tapestry.ioc.annotations.Lifecycle;
+import org.apache.tapestry.ioc.services.ClassFactory;
 
 @Id("tapestry.ioc")
 public class TapestryIOCModule

Copied: tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/ioc/services/AbstractIntWrapper.java (from r386879, jakarta/hivemind/trunk/framework/src/test/hivemind/test/services/AbstractIntWrapper.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/ioc/services/AbstractIntWrapper.java?p2=tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/ioc/services/AbstractIntWrapper.java&p1=jakarta/hivemind/trunk/framework/src/test/hivemind/test/services/AbstractIntWrapper.java&r1=386879&r2=423984&rev=423984&view=diff
==============================================================================
--- jakarta/hivemind/trunk/framework/src/test/hivemind/test/services/AbstractIntWrapper.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/ioc/services/AbstractIntWrapper.java Thu Jul 20 09:50:22 2006
@@ -12,17 +12,16 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package hivemind.test.services;
+package org.apache.tapestry.internal.ioc.services;
 
 import org.apache.hivemind.impl.BaseLocatable;
 
-
 /**
- * Part of the {@link hivemind.test.services.TestClassFab} test case.
- *
+ * Used by {@link org.apache.tapestry.internal.ioc.services.ClassFabImplTest}.
+ * 
  * @author Howard Lewis Ship
  */
 public abstract class AbstractIntWrapper extends BaseLocatable
 {
-	public abstract int getIntValue();
+    public abstract int getIntValue();
 }

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/ioc/services/AbstractIntWrapper.java
------------------------------------------------------------------------------
    cvs2svn:cvs-rev = 1.2

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/ioc/services/AbstractIntWrapper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/ioc/services/AbstractIntWrapper.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision