You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2011/04/07 23:16:58 UTC
svn commit: r1090019 -
/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/ModuleImpl.java
Author: hlship
Date: Thu Apr 7 21:16:56 2011
New Revision: 1090019
URL: http://svn.apache.org/viewvc?rev=1090019&view=rev
Log:
TAP5-853: Copy annotations from implementation class (if known) to proxy class
Modified:
tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/ModuleImpl.java
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/ModuleImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/ModuleImpl.java?rev=1090019&r1=1090018&r2=1090019&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/ModuleImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/ModuleImpl.java Thu Apr 7 21:16:56 2011
@@ -103,6 +103,11 @@ public class ModuleImpl implements Modul
*/
private final static ConcurrentBarrier BARRIER = new ConcurrentBarrier();
+ /** "Magic" method related to Externalizable that allows the Proxy object to replace itself with the token. */
+ private static final MethodDescription WRITE_REPLACE = new MethodDescription(Modifier.PRIVATE, "java.lang.Object",
+ "writeReplace", null, new String[]
+ { ObjectStreamException.class.getName() });
+
public ModuleImpl(InternalRegistry registry, ServiceActivityTracker tracker, ModuleDef moduleDef,
ClassFactory classFactory, PlasticProxyFactory proxyFactory, Logger logger)
{
@@ -488,13 +493,8 @@ public class ModuleImpl implements Modul
return createProxyInstance(creator, token, serviceInterface, resources.getImplementationClass(), toString);
}
- /** "Magic" method related to Externalizable that allows the Proxy object to replace itself with the token. */
- private static final MethodDescription WRITE_REPLACE = new MethodDescription(Modifier.PRIVATE, "java.lang.Object",
- "writeReplace", null, new String[]
- { ObjectStreamException.class.getName() });
-
private Object createProxyInstance(final ObjectCreator creator, final ServiceProxyToken token,
- final Class serviceInterface, Class serviceImplementation, final String description)
+ final Class serviceInterface, final Class serviceImplementation, final String description)
{
ClassInstantiator instantiator = proxyFactory.createProxy(serviceInterface, new PlasticClassTransformer()
{
@@ -540,16 +540,10 @@ public class ModuleImpl implements Modul
}
});
- /*
- * TODO:
- * if (serviceImplementation != null)
- * {
- * classFab.copyClassAnnotationsFromDelegate(serviceImplementation);
- * classFab.copyMethodAnnotationsFromDelegate(serviceInterface, serviceImplementation);
- * }
- */
-
plasticClass.addToString(description);
+
+ if (serviceImplementation != null)
+ plasticClass.copyAnnotations(serviceImplementation);
}
});