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 2011/02/09 22:18:13 UTC

svn commit: r1069114 [2/2] - in /tapestry/tapestry5/trunk: ./ quickstart/src/main/resources/archetype-resources/src/main/java/services/ tapestry-annotations/ tapestry-core/ tapestry-core/src/main/java/org/apache/tapestry5/ tapestry-core/src/main/java/o...

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ViewRegistration.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ViewRegistration.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ViewRegistration.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ViewRegistration.java Wed Feb  9 21:18:11 2011
@@ -1,10 +1,10 @@
-// Copyright 2007 The Apache Software Foundation
+// Copyright 2007, 2011 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
+// 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,
@@ -14,12 +14,12 @@
 
 package org.apache.tapestry5.integration.app1.pages;
 
-import org.apache.tapestry5.annotations.ApplicationState;
+import org.apache.tapestry5.annotations.SessionState;
 import org.apache.tapestry5.integration.app1.data.RegistrationData;
 
 public class ViewRegistration
 {
-    @ApplicationState
+    @SessionState
     private RegistrationData data;
 
     public RegistrationData getRegistrationData()

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/nested/ZoneDemo.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/nested/ZoneDemo.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/nested/ZoneDemo.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/nested/ZoneDemo.java Wed Feb  9 21:18:11 2011
@@ -1,4 +1,4 @@
-// Copyright 2007, 2008, 2009, 2010 The Apache Software Foundation
+// Copyright 2007, 2008, 2009, 2010, 2011 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.
@@ -14,12 +14,21 @@
 
 package org.apache.tapestry5.integration.app1.pages.nested;
 
+import java.util.Date;
+
 import org.apache.tapestry5.Block;
 import org.apache.tapestry5.QueryParameterConstants;
 import org.apache.tapestry5.RenderSupport;
 import org.apache.tapestry5.ValueEncoder;
 import org.apache.tapestry5.ajax.MultiZoneUpdate;
-import org.apache.tapestry5.annotations.*;
+import org.apache.tapestry5.annotations.Component;
+import org.apache.tapestry5.annotations.Environmental;
+import org.apache.tapestry5.annotations.InjectComponent;
+import org.apache.tapestry5.annotations.InjectPage;
+import org.apache.tapestry5.annotations.Log;
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.annotations.RequestParameter;
+import org.apache.tapestry5.annotations.SessionState;
 import org.apache.tapestry5.corelib.components.BeanEditForm;
 import org.apache.tapestry5.corelib.components.Zone;
 import org.apache.tapestry5.integration.app1.data.RegistrationData;
@@ -28,8 +37,6 @@ import org.apache.tapestry5.internal.ser
 import org.apache.tapestry5.ioc.annotations.Inject;
 import org.apache.tapestry5.json.JSONObject;
 
-import java.util.Date;
-
 public class ZoneDemo
 {
     @Component(id = "registrationForm")
@@ -37,7 +44,7 @@ public class ZoneDemo
 
     private String name;
 
-    @ApplicationState
+    @SessionState
     private RegistrationData registration;
 
     private static final String[] NAMES =

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/services/AppModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/services/AppModule.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/services/AppModule.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/services/AppModule.java Wed Feb  9 21:18:11 2011
@@ -28,6 +28,7 @@ import java.util.Map;
 
 import org.apache.tapestry5.SymbolConstants;
 import org.apache.tapestry5.ValueEncoder;
+import org.apache.tapestry5.integration.app1.data.DateHolder;
 import org.apache.tapestry5.integration.app1.data.ToDoItem;
 import org.apache.tapestry5.integration.app1.data.Track;
 import org.apache.tapestry5.internal.services.GenericValueEncoderFactory;

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app2/pages/TestPageForASO.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app2/pages/TestPageForASO.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app2/pages/TestPageForASO.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app2/pages/TestPageForASO.java Wed Feb  9 21:18:11 2011
@@ -1,10 +1,10 @@
-// Copyright 2007 The Apache Software Foundation
+// Copyright 2007, 2011 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
+// 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,
@@ -14,12 +14,12 @@
 
 package org.apache.tapestry5.integration.app2.pages;
 
-import org.apache.tapestry5.annotations.ApplicationState;
+import org.apache.tapestry5.annotations.SessionState;
 import org.apache.tapestry5.integration.app2.SimpleASO;
 
 public class TestPageForASO
 {
-    @ApplicationState
+    @SessionState
     private SimpleASO aso;
 
     public String getFooString()

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/PersistentLocaleImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/PersistentLocaleImplTest.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/PersistentLocaleImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/PersistentLocaleImplTest.java Wed Feb  9 21:18:11 2011
@@ -1,10 +1,10 @@
-// Copyright 2009 The Apache Software Foundation
+// Copyright 2009, 2011 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
+// 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,
@@ -14,6 +14,7 @@
 
 package org.apache.tapestry5.internal.services;
 
+import org.apache.tapestry5.ioc.internal.services.PerthreadManagerImpl;
 import org.apache.tapestry5.ioc.test.TestBase;
 import org.apache.tapestry5.services.PersistentLocale;
 import org.testng.annotations.Test;
@@ -28,7 +29,7 @@ public class PersistentLocaleImplTest ex
     @Test
     public void set_to_unsupported_locale()
     {
-        PersistentLocale pl = new PersistentLocaleImpl(null, "en,fr");
+        PersistentLocale pl = new PersistentLocaleImpl(new PerthreadManagerImpl(null), "en,fr");
 
         try
         {
@@ -37,8 +38,9 @@ public class PersistentLocaleImplTest ex
         }
         catch (IllegalArgumentException ex)
         {
-            assertEquals(ex.getMessage(),
-                         "Locale 'zh' is not supported by this application. Supported locales are 'en,fr'; this is configured via the tapestry.supported-locales symbol.");
+            assertEquals(
+                    ex.getMessage(),
+                    "Locale 'zh' is not supported by this application. Supported locales are 'en,fr'; this is configured via the tapestry.supported-locales symbol.");
         }
 
     }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/transform/pages/MaybeStateHolder.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/transform/pages/MaybeStateHolder.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/transform/pages/MaybeStateHolder.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/transform/pages/MaybeStateHolder.java Wed Feb  9 21:18:11 2011
@@ -1,10 +1,10 @@
-// Copyright 2008 The Apache Software Foundation
+// Copyright 2008, 2011 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
+// 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,
@@ -14,15 +14,14 @@
 
 package org.apache.tapestry5.internal.transform.pages;
 
-import org.apache.tapestry5.annotations.ApplicationState;
+import org.apache.tapestry5.annotations.SessionState;
 import org.apache.tapestry5.internal.services.SimpleASO;
 
 public class MaybeStateHolder
 {
-    @ApplicationState(create = false)
+    @SessionState(create = false)
     private SimpleASO bean;
 
-
     public SimpleASO getBean()
     {
         return bean;

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/transform/pages/StateHolder.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/transform/pages/StateHolder.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/transform/pages/StateHolder.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/transform/pages/StateHolder.java Wed Feb  9 21:18:11 2011
@@ -1,10 +1,10 @@
-// Copyright 2007, 2008 The Apache Software Foundation
+// Copyright 2007, 2008, 2011 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
+// 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,
@@ -14,12 +14,12 @@
 
 package org.apache.tapestry5.internal.transform.pages;
 
-import org.apache.tapestry5.annotations.ApplicationState;
+import org.apache.tapestry5.annotations.SessionState;
 import org.apache.tapestry5.internal.services.SimpleASO;
 
 public class StateHolder
 {
-    @ApplicationState
+    @SessionState
     private SimpleASO bean;
 
     private boolean beanExists;

Added: tapestry/tapestry5/trunk/tapestry-func/build.gradle
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-func/build.gradle?rev=1069114&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-func/build.gradle (added)
+++ tapestry/tapestry5/trunk/tapestry-func/build.gradle Wed Feb  9 21:18:11 2011
@@ -0,0 +1,6 @@
+description = "Light-weight functional programming for Flows of values"
+
+dependencies {
+  testCompile   "org.testng:testng:$testngVersion"
+  testCompile   "commons-lang:commons-lang:2.6"
+}
\ No newline at end of file

Added: tapestry/tapestry5/trunk/tapestry-ioc/build.gradle
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/build.gradle?rev=1069114&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/build.gradle (added)
+++ tapestry/tapestry5/trunk/tapestry-ioc/build.gradle Wed Feb  9 21:18:11 2011
@@ -0,0 +1,20 @@
+description = "A code-centric, high-performance, simple Inversion of Control container"
+
+dependencies {
+  compile project(':tapestry-func')
+  compile project(':tapestry-annotations')
+  
+  testCompile project(':tapestry-test')
+
+  compile "javassist:javassist:3.12.1.GA"
+
+  compile "javax.inject:javax.inject:1"
+  
+  compile "org.slf4j:slf4j-api:1.6.1"
+  compile "log4j:log4j:1.2.14"
+  compile "org.slf4j:slf4j-log4j12:1.6.1"
+  
+  compile "org.easymock:easymock:$easymockVersion"
+  
+  compile "org.testng:testng:$testngVersion", { transitive = false }
+}
\ No newline at end of file

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/IOCConstants.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/IOCConstants.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/IOCConstants.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/IOCConstants.java Wed Feb  9 21:18:11 2011
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2008, 2010 The Apache Software Foundation
+// Copyright 2006, 2007, 2008, 2010, 2011 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.
@@ -16,18 +16,6 @@ package org.apache.tapestry5.ioc;
 
 public class IOCConstants
 {
-    /**
-     * @deprecated Use {@link org.apache.tapestry5.ioc.ScopeConstants#DEFAULT} instead. To be removed after Tapestry
-     *             5.2.
-     */
-    public static final String DEFAULT_SCOPE = ScopeConstants.DEFAULT;
-
-    /**
-     * @deprecated Use {@link org.apache.tapestry5.ioc.ScopeConstants#PERTHREAD} instead. To be removed after Tapestry
-     *             5.2.
-     */
-    public static final String PERTHREAD_SCOPE = ScopeConstants.PERTHREAD;
-
     public static final String MODULE_BUILDER_MANIFEST_ENTRY_NAME = "Tapestry-Module-Classes";
 
     public static final String MASTER_OBJECT_PROVIDER_SERVICE_ID = "MasterObjectProvider";

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/PerthreadManagerImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/PerthreadManagerImpl.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/PerthreadManagerImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/PerthreadManagerImpl.java Wed Feb  9 21:18:11 2011
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2008, 2010 The Apache Software Foundation
+// Copyright 2006, 2007, 2008, 2010, 2011 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.
@@ -32,10 +32,10 @@ import org.slf4j.Logger;
 @SuppressWarnings("all")
 public class PerthreadManagerImpl implements PerthreadManager
 {
-    private static final String LISTENERS_KEY = "PerthreadManager.listenerList";
-
     private final Lock lock;
 
+    private final PerThreadValue<List<ThreadCleanupListener>> listenersValue;
+
     private static class MapHolder extends ThreadLocal<Map>
     {
         @Override
@@ -59,6 +59,8 @@ public class PerthreadManagerImpl implem
         this.logger = logger;
 
         lock = useSynchronization ? new ReentrantLock() : new DummyLock();
+
+        listenersValue = createValue();
     }
 
     private Map getPerthreadMap()
@@ -77,12 +79,12 @@ public class PerthreadManagerImpl implem
 
     private List<ThreadCleanupListener> getListeners()
     {
-        List<ThreadCleanupListener> result = (List<ThreadCleanupListener>) get(LISTENERS_KEY);
+        List<ThreadCleanupListener> result = listenersValue.get();
 
         if (result == null)
         {
             result = CollectionFactory.newList();
-            put(LISTENERS_KEY, result);
+            listenersValue.set(result);
         }
 
         return result;
@@ -101,7 +103,7 @@ public class PerthreadManagerImpl implem
     {
         List<ThreadCleanupListener> listeners = getListeners();
 
-        put(LISTENERS_KEY, null);
+        listenersValue.set(null);
 
         for (ThreadCleanupListener listener : listeners)
         {
@@ -116,14 +118,16 @@ public class PerthreadManagerImpl implem
         }
 
         // Listeners should not re-add themselves or store any per-thread state
-        // here,
-        // it will be lost.
+        // here, it will be lost.
 
         try
         {
             lock.lock();
 
-            // Discard the per-thread map of values.
+            // Discard the per-thread map of values, including the key that stores
+            // the listeners. This means that if a listener attempts to register
+            // new listeners, the new listeners will not be triggered and will be
+            // released to the GC.
 
             holder.remove();
         }
@@ -133,16 +137,6 @@ public class PerthreadManagerImpl implem
         }
     }
 
-    public void put(Object key, Object value)
-    {
-        getPerthreadMap().put(key, value);
-    }
-
-    public Object get(Object key)
-    {
-        return getPerthreadMap().get(key);
-    }
-
     private static Object NULL_VALUE = new Object();
 
     <T> PerThreadValue<T> createValue(final Object key)
@@ -173,7 +167,7 @@ public class PerthreadManagerImpl implem
 
             public T set(T newValue)
             {
-                put(key, newValue == null ? NULL_VALUE : newValue);
+                getPerthreadMap().put(key, newValue == null ? NULL_VALUE : newValue);
 
                 return newValue;
             }

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/ClassFabUtils.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/ClassFabUtils.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/ClassFabUtils.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/ClassFabUtils.java Wed Feb  9 21:18:11 2011
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2008, 2010 The Apache Software Foundation
+// Copyright 2006, 2007, 2008, 2010, 2011 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.
@@ -14,18 +14,14 @@
 
 package org.apache.tapestry5.ioc.services;
 
-import static java.lang.String.format;
-import static org.apache.tapestry5.ioc.internal.util.CollectionFactory.newMap;
-
 import java.io.File;
 import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicLong;
 
-import org.apache.tapestry5.ioc.ObjectCreator;
+import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
 
 /**
  * Handy method useful when creating new classes using {@link org.apache.tapestry5.ioc.services.ClassFab}.
@@ -109,8 +105,8 @@ public final class ClassFabUtils
         }
     }
 
-    private static final Map<String, PrimitiveInfo> PRIMITIVE_TYPE_NAME_TO_PRIMITIVE_INFO = newMap();
-    private static final Map<Class, PrimitiveInfo> WRAPPER_TYPE_TO_PRIMITIVE_INFO = newMap();
+    private static final Map<String, PrimitiveInfo> PRIMITIVE_TYPE_NAME_TO_PRIMITIVE_INFO = CollectionFactory.newMap();
+    private static final Map<Class, PrimitiveInfo> WRAPPER_TYPE_TO_PRIMITIVE_INFO = CollectionFactory.newMap();
 
     static
     {
@@ -251,54 +247,6 @@ public final class ClassFabUtils
     }
 
     /**
-     * Creates a proxy for a given service interface around an {@link org.apache.tapestry5.ioc.ObjectCreator} that can
-     * provide (on demand) an object (implementing the service interface) to delegate to. The ObjectCreator will be
-     * invoked on every method invocation (if it is caching, that should be internal to its implementation).
-     * 
-     * @param <T>
-     * @param classFab
-     *            used to create the new class
-     * @param serviceInterface
-     *            the interface the proxy will implement
-     * @param creator
-     *            the createor which will provide an instance of the interface
-     * @param description
-     *            description to be returned from the proxy's toString() method
-     * @return the instantiated proxy object
-     * @deprecated Use {@link ClassFactory#createProxy(Class, ObjectCreator, String)} instead
-     */
-    public static <T> T createObjectCreatorProxy(ClassFab classFab, Class<T> serviceInterface, ObjectCreator creator,
-            String description)
-    {
-        classFab.addField("_creator", Modifier.PRIVATE | Modifier.FINAL, ObjectCreator.class);
-
-        classFab.addConstructor(new Class[]
-        { ObjectCreator.class }, null, "_creator = $1;");
-
-        String body = format("return (%s) _creator.createObject();", serviceInterface.getName());
-
-        MethodSignature sig = new MethodSignature(serviceInterface, "_delegate", null, null);
-
-        classFab.addMethod(Modifier.PRIVATE, sig, body);
-
-        classFab.proxyMethodsToDelegate(serviceInterface, "_delegate()", description);
-        Class proxyClass = classFab.createClass();
-
-        try
-        {
-            Object proxy = proxyClass.getConstructors()[0].newInstance(creator);
-
-            return serviceInterface.cast(proxy);
-        }
-        catch (Exception ex)
-        {
-            // This should never happen, so we won't go to a lot of trouble
-            // reporting it.
-            throw new RuntimeException(ex.getMessage(), ex);
-        }
-    }
-
-    /**
      * Given a Class instance, convert the name into a path that can be used to locate
      * the underlying class file on the classpath.
      * 

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/PerthreadManager.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/PerthreadManager.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/PerthreadManager.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/PerthreadManager.java Wed Feb  9 21:18:11 2011
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2008, 2010 The Apache Software Foundation
+// Copyright 2006, 2007, 2008, 2010, 2011 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.
@@ -42,24 +42,6 @@ public interface PerthreadManager
     void cleanup();
 
     /**
-     * Returns an object stored in the per-thread map. When the object is a string, the expected name is <em>service
-     * id</em>.<em>subkey</em>. Unlike most of Tapestry, such keys <em>will</em> be case sensitive.
-     * 
-     * @param key
-     *            key used to retrieve object
-     * @return corresponding per-thread object, or null
-     * @deprecated use {@link PerthreadManager#createValue()} instead
-     */
-    Object get(Object key);
-
-    /**
-     * Stores a value into the per-thread map.
-     * 
-     * @deprecated use {@link PerthreadManager#createValue()} instead
-     */
-    void put(Object key, Object value);
-
-    /**
      * Creates a value using a unique internal key.
      * 
      * @since 5.2.0

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/test/IOCTestCase.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/test/IOCTestCase.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/test/IOCTestCase.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/test/IOCTestCase.java Wed Feb  9 21:18:11 2011
@@ -419,11 +419,6 @@ public class IOCTestCase extends TestBas
         expect(locator.autobuild(beanClass)).andReturn(instance);
     }
 
-    protected final void train_get(PerthreadManager manager, String key, Object object)
-    {
-        expect(manager.get(key)).andReturn(object);
-    }
-
     protected final PerthreadManager mockPerthreadManager()
     {
         return newMock(PerthreadManager.class);

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/PerthreadManagerImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/PerthreadManagerImplTest.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/PerthreadManagerImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/PerthreadManagerImplTest.java Wed Feb  9 21:18:11 2011
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2008, 2010 The Apache Software Foundation
+// Copyright 2006, 2007, 2008, 2010, 2011 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.
@@ -131,13 +131,11 @@ public class PerthreadManagerImplTest ex
         PerThreadValue<Object> v = m.createValue(key);
 
         assertFalse(v.exists());
-        assertNull(m.get(key));
         assertNull(v.get());
 
         v.set(value);
 
         assertTrue(v.exists());
-        assertSame(m.get(key), value);
         assertSame(v.get(), value);
     }
 
@@ -182,15 +180,17 @@ public class PerthreadManagerImplTest ex
     {
         final PerthreadManagerImpl m = new PerthreadManagerImpl(null);
 
+        final PerThreadValue<String> v = m.createValue();
+
         m.run(new Runnable()
         {
             public void run()
             {
-                m.put("foo", "bar");
+                v.set("bar");
             }
         });
 
-        assertNull(m.get("foo"));
+        assertNull(v.get());
     }
 
     @Test
@@ -198,11 +198,13 @@ public class PerthreadManagerImplTest ex
     {
         final PerthreadManagerImpl m = new PerthreadManagerImpl(null);
 
+        final PerThreadValue<String> v = m.createValue();
+
         String actual = m.invoke(new Invokable<String>()
         {
             public String invoke()
             {
-                m.put("foo", "bar");
+                v.set("bar");
 
                 return "baz";
             }
@@ -210,7 +212,7 @@ public class PerthreadManagerImplTest ex
 
         assertEquals(actual, "baz");
 
-        assertNull(m.get("foo"));
+        assertNull(v.get());
 
     }
 }

Added: tapestry/tapestry5/trunk/tapestry-json/build.gradle
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-json/build.gradle?rev=1069114&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-json/build.gradle (added)
+++ tapestry/tapestry5/trunk/tapestry-json/build.gradle Wed Feb  9 21:18:11 2011
@@ -0,0 +1,8 @@
+description = "Repackaged, improved (and tested) version of code originally from json.org"
+
+dependencies {
+
+  testCompile project(':tapestry-test')
+  testCompile project(':tapestry-ioc')
+
+}
\ No newline at end of file

Added: tapestry/tapestry5/trunk/tapestry-test/build.gradle
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-test/build.gradle?rev=1069114&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-test/build.gradle (added)
+++ tapestry/tapestry5/trunk/tapestry-test/build.gradle Wed Feb  9 21:18:11 2011
@@ -0,0 +1,17 @@
+description = "Utilities for unit and integration testing of Tapestry applications"
+
+dependencies {
+  compile "org.seleniumhq.selenium.server:selenium-server:1.0.3:standalone@jar"
+  compile "jetty:org.mortbay.jetty:5.1.12"
+    
+  compile "org.testng:testng:$testngVersion"
+    
+  compile "org.eclipse.jetty:jetty-server:$jettyVersion"
+  compile "org.eclipse.jetty:jetty-jndi:$jettyVersion"
+  compile "org.eclipse.jetty:jetty-plus:$jettyVersion"
+  compile "org.eclipse.jetty:jetty-webapp:$jettyVersion"
+  
+  compile "org.apache.tomcat:catalina:$tomcatVersion"
+  compile "org.apache.tomcat:coyote:$tomcatVersion"
+  
+}
\ No newline at end of file