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/11/02 00:08:55 UTC
svn commit: r1196357 [2/2] - in /tapestry/tapestry5/trunk:
tapestry-core/src/main/java/org/apache/tapestry5/internal/services/
tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/
tapestry-core/src/main/java/org/apache/tapestry5/interna...
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/ServiceMessages.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/ServiceMessages.java?rev=1196357&r1=1196356&r2=1196357&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/ServiceMessages.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/ServiceMessages.java Tue Nov 1 23:08:53 2011
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007 The Apache Software Foundation
+// Copyright 2006, 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.
@@ -17,10 +17,10 @@ package org.apache.tapestry5.ioc.interna
import javassist.CtClass;
import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.internal.util.MessagesImpl;
-import org.apache.tapestry5.ioc.services.ClassFabUtils;
import org.apache.tapestry5.ioc.services.Coercion;
import org.apache.tapestry5.ioc.services.MethodSignature;
import org.apache.tapestry5.ioc.services.ThreadCleanupListener;
+import org.apache.tapestry5.plastic.PlasticUtils;
public class ServiceMessages
{
@@ -30,45 +30,9 @@ public class ServiceMessages
{
}
- public static String unableToAddMethod(MethodSignature signature, CtClass ctClass, Throwable cause)
- {
- return MESSAGES.format("unable-to-add-method", signature, ctClass.getName(), cause);
- }
-
- public static String unableToAddConstructor(CtClass ctClass, Throwable cause)
- {
- return MESSAGES.format("unable-to-add-constructor", ctClass.getName(), cause);
- }
-
- public static String unableToAddField(String fieldName, CtClass ctClass, Throwable cause)
- {
- return MESSAGES.format("unable-to-add-field", fieldName, ctClass.getName(), cause);
- }
-
- public static String unableToCreateClass(String className, Class superClass, Throwable cause)
- {
- return MESSAGES.format("unable-to-create-class", className, superClass.getName(), cause);
- }
-
- public static String unableToLookupClass(String className, Throwable cause)
- {
- return MESSAGES.format("unable-to-lookup-class", className, cause);
- }
- public static String unableToWriteClass(CtClass ctClass, Throwable cause)
- {
- return MESSAGES.format("unable-to-write-class", ctClass.getName(), cause);
- }
- public static String duplicateMethodInClass(MethodSignature ms, ClassFabImpl fab)
- {
- return MESSAGES.format("duplicate-method-in-class", ms, fab.getName());
- }
- public static String loggingInterceptor(String serviceId, Class serviceInterface)
- {
- return MESSAGES.format("logging-interceptor", serviceId, serviceInterface.getName());
- }
public static String threadCleanupError(ThreadCleanupListener listener, Throwable cause)
{
@@ -117,21 +81,11 @@ public class ServiceMessages
return MESSAGES.format("unmatched-service-method", sig, filterInterface.getName());
}
- public static String unknownObjectProvider(String prefix, String reference)
- {
- return MESSAGES.format("unknown-object-provider", prefix, reference);
- }
-
public static String shutdownListenerError(Object listener, Throwable cause)
{
return MESSAGES.format("shutdown-listener-error", listener, cause);
}
- public static String noCoercionFound(Class sourceType, Class targetType, String coercions)
- {
- return MESSAGES.format("no-coercion-found", sourceType.getName(), targetType.getName(), coercions);
- }
-
public static String recursiveSymbol(String symbolName, String path)
{
return MESSAGES.format("recursive-symbol", symbolName, path);
@@ -159,7 +113,7 @@ public class ServiceMessages
public static String failedCoercion(Object input, Class targetType, Coercion coercion, Throwable cause)
{
- return MESSAGES.format("failed-coercion", String.valueOf(input), ClassFabUtils.toJavaClassName(targetType),
+ return MESSAGES.format("failed-coercion", String.valueOf(input), PlasticUtils.toTypeName(targetType),
coercion, cause);
}
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/ThunkCreatorImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/ThunkCreatorImpl.java?rev=1196357&r1=1196356&r2=1196357&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/ThunkCreatorImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/ThunkCreatorImpl.java Tue Nov 1 23:08:53 2011
@@ -21,7 +21,6 @@ import org.apache.tapestry5.ioc.ObjectCr
import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
import org.apache.tapestry5.ioc.internal.util.InternalUtils;
import org.apache.tapestry5.ioc.services.Builtin;
-import org.apache.tapestry5.ioc.services.ClassFabUtils;
import org.apache.tapestry5.ioc.services.PlasticProxyFactory;
import org.apache.tapestry5.ioc.services.ThunkCreator;
import org.apache.tapestry5.plastic.ClassInstantiator;
@@ -57,7 +56,7 @@ public class ThunkCreatorImpl implements
if (!proxyType.isInterface())
throw new IllegalArgumentException(String.format(
"Thunks may only be created for interfaces; %s is a class.",
- ClassFabUtils.toJavaClassName(proxyType)));
+ PlasticUtils.toTypeName(proxyType)));
return getInstantiator(proxyType).with(ObjectCreator.class, objectCreator).with(String.class, description)
.newInstance();
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/util/InternalUtils.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/util/InternalUtils.java?rev=1196357&r1=1196356&r2=1196357&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/util/InternalUtils.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/util/InternalUtils.java Tue Nov 1 23:08:53 2011
@@ -1329,104 +1329,6 @@ public class InternalUtils
return null;
}
- /**
- * Converts old-style Tapestry IoC {@link org.apache.tapestry5.ioc.MethodAdvice} to modern
- * Plastic {@link MethodAdvice}.
- *
- * @param iocMethodAdvice old style advice
- * @return new style advice
- */
- public static MethodAdvice toPlasticMethodAdvice(final org.apache.tapestry5.ioc.MethodAdvice iocMethodAdvice,
- final AnnotationProvider methodAnnotationProvider)
- {
- assert iocMethodAdvice != null;
-
- return new MethodAdvice()
- {
- public void advise(final MethodInvocation invocation)
- {
- org.apache.tapestry5.ioc.Invocation iocInvocation = new org.apache.tapestry5.ioc.Invocation()
- {
- public void rethrow()
- {
- invocation.rethrow();
- }
-
- public void proceed()
- {
- invocation.proceed();
- }
-
- public void overrideThrown(Exception thrown)
- {
- invocation.setCheckedException(thrown);
- }
-
- public void overrideResult(Object newResult)
- {
- invocation.setReturnValue(newResult);
- }
-
- public void override(int index, Object newParameter)
- {
- invocation.setParameter(index, newParameter);
- }
-
- public boolean isFail()
- {
- return invocation.didThrowCheckedException();
- }
-
- public <T extends Throwable> T getThrown(Class<T> throwableClass)
- {
- return invocation.getCheckedException(throwableClass);
- }
-
- public Object getParameter(int index)
- {
- return invocation.getParameter(index);
- }
-
- public Object getResult()
- {
- return invocation.getReturnValue();
- }
-
- public Class getResultType()
- {
- return method().getReturnType();
- }
-
- private Method method()
- {
- return invocation.getMethod();
- }
-
- public Class getParameterType(int index)
- {
- return method().getParameterTypes()[index];
- }
-
- public int getParameterCount()
- {
- return method().getParameterTypes().length;
- }
-
- public String getMethodName()
- {
- return method().getName();
- }
-
- public <T extends Annotation> T getMethodAnnotation(Class<T> annotationClass)
- {
- return methodAnnotationProvider.getAnnotation(annotationClass);
- }
- };
-
- iocMethodAdvice.advise(iocInvocation);
- }
- };
- }
public static AnnotationProvider toAnnotationProvider(final Method element)
{
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/AspectDecorator.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/AspectDecorator.java?rev=1196357&r1=1196356&r2=1196357&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/AspectDecorator.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/AspectDecorator.java Tue Nov 1 23:08:53 2011
@@ -15,45 +15,23 @@
package org.apache.tapestry5.ioc.services;
import org.apache.tapestry5.ioc.AnnotationAccess;
-import org.apache.tapestry5.ioc.MethodAdvice;
/**
* A decorator used to create an interceptor that delegates each method's invocation to an
- * {@link org.apache.tapestry5.ioc.MethodAdvice} for advice. Advice can inspect or change method parameters, inspect or
- * change
- * the method's return value, and inspect and change thrown exceptions (checked and unchecked).
+ * {@link org.apache.tapestry5.plastic.MethodAdvice} for advice. Advice can inspect or change method parameters, inspect or
+ * change the method's return value, and inspect and change thrown exceptions (checked and unchecked).
*/
public interface AspectDecorator
{
/**
- * Intercepts method invocations on the delegate and passes them through the provided aspect. Note that the advice
- * <em>must</em> be thread-safe.
- *
- * @param serviceInterface
- * defines the interface of the interceptor and delegate
- * @param delegate
- * the object on which methods will be invoked
- * @param advice
- * intercepts the method invocations on the delegate
- * @param description
- * used as the toString() of the returned interceptor, unless toString() is part of the
- * service interface
- * @return the interceptor, wrapping the delegate with all the advice
- */
- <T> T build(Class<T> serviceInterface, T delegate, MethodAdvice advice, String description);
-
- /**
* Creates a builder that can be used to create the interceptor. This is used when only some of the methods need to
* be advised, or when different methods need to receive different advice, or when multiple advice is to be
* applied.
- *
- * @param serviceInterface
- * defines the interface of the interceptor and the delegate
- * @param delegate
- * the object on which methods will be invokes
- * @param description
- * used as the toString() of the interceptor unless toString() is part of the service
- * interface
+ *
+ * @param serviceInterface defines the interface of the interceptor and the delegate
+ * @param delegate the object on which methods will be invokes
+ * @param description used as the toString() of the interceptor unless toString() is part of the service
+ * interface
* @return a builder that can be used to generate the final interceptor
*/
<T> AspectInterceptorBuilder<T> createBuilder(Class<T> serviceInterface, T delegate, String description);
@@ -62,19 +40,15 @@ public interface AspectDecorator
* Creates a builder that can be used to create the interceptor. This is used when only some of the methods need to
* be advised, or when different methods need to receive different advice, or when multiple advice is to be
* applied.
- *
- * @param serviceInterface
- * defines the interface of the interceptor and the delegate
- * @param delegate
- * the object on which methods will be invokes
- * @param annotationAccess
- * provides access to combined annotations of the underlying service
- * and service interface
- * @param description
- * used as the toString() of the interceptor unless toString() is part of the service
- * interface
+ *
+ * @param serviceInterface defines the interface of the interceptor and the delegate
+ * @param delegate the object on which methods will be invokes
+ * @param annotationAccess provides access to combined annotations of the underlying service
+ * and service interface
+ * @param description used as the toString() of the interceptor unless toString() is part of the service
+ * interface
* @return a builder that can be used to generate the final interceptor
*/
<T> AspectInterceptorBuilder<T> createBuilder(Class<T> serviceInterface, T delegate,
- AnnotationAccess annotationAccess, String description);
+ AnnotationAccess annotationAccess, String description);
}
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=1196357&r1=1196356&r2=1196357&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 Tue Nov 1 23:08:53 2011
@@ -22,6 +22,7 @@ import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;
import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
+import org.apache.tapestry5.plastic.PlasticUtils;
/**
* Handy method useful when creating new classes using {@link org.apache.tapestry5.ioc.services.ClassFab}.
@@ -56,19 +57,6 @@ public final class ClassFabUtils
}
/**
- * Javassist needs the class name to be as it appears in source code, even for arrays. Invoking getName() on a Class
- * instance representing an array returns the internal format (i.e, "[...;" or something). This returns it as it
- * would appear in Java code.
- */
- public static String toJavaClassName(Class inputClass)
- {
- if (inputClass.isArray())
- return toJavaClassName(inputClass.getComponentType()) + "[]";
-
- return inputClass.getName();
- }
-
- /**
* Returns true if the method is the standard toString() method. Very few interfaces will ever include this method
* as part of the interface, but we have to be sure.
*/
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/CoercionTuple.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/CoercionTuple.java?rev=1196357&r1=1196356&r2=1196357&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/CoercionTuple.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/CoercionTuple.java Tue Nov 1 23:08:53 2011
@@ -14,6 +14,8 @@
package org.apache.tapestry5.ioc.services;
+import org.apache.tapestry5.plastic.PlasticUtils;
+
/**
* An immutable object that represents a mapping from one type to another. This is also the contribution type when
* building the {@link org.apache.tapestry5.ioc.services.TypeCoercer} service. Wraps a
@@ -64,7 +66,7 @@ public final class CoercionTuple<S, T>
if (void.class.equals(type))
return "null";
- String name = ClassFabUtils.toJavaClassName(type);
+ String name = PlasticUtils.toTypeName(type);
int dotx = name.lastIndexOf('.');
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/MethodSignature.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/MethodSignature.java?rev=1196357&r1=1196356&r2=1196357&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/MethodSignature.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/MethodSignature.java Tue Nov 1 23:08:53 2011
@@ -18,6 +18,7 @@ import java.lang.reflect.Method;
import java.util.Arrays;
import org.apache.tapestry5.ioc.internal.util.InternalUtils;
+import org.apache.tapestry5.plastic.PlasticUtils;
/**
* A representation of a {@link java.lang.reflect.Method}, identifying the name, return type, parameter types and
@@ -182,7 +183,7 @@ public class MethodSignature
{
StringBuilder buffer = new StringBuilder();
- buffer.append(ClassFabUtils.toJavaClassName(returnType));
+ buffer.append(PlasticUtils.toTypeName(returnType));
buffer.append(" ");
buffer.append(name);
buffer.append("(");
@@ -192,7 +193,7 @@ public class MethodSignature
if (i > 0)
buffer.append(", ");
- buffer.append(ClassFabUtils.toJavaClassName(parameterTypes[i]));
+ buffer.append(PlasticUtils.toTypeName(parameterTypes[i]));
}
buffer.append(")");
@@ -237,7 +238,7 @@ public class MethodSignature
if (i > 0)
buffer.append(",");
- buffer.append(ClassFabUtils.toJavaClassName(parameterTypes[i]));
+ buffer.append(PlasticUtils.toTypeName(parameterTypes[i]));
}
buffer.append(")");
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/resources/org/apache/tapestry5/ioc/internal/services/ServiceStrings.properties
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/resources/org/apache/tapestry5/ioc/internal/services/ServiceStrings.properties?rev=1196357&r1=1196356&r2=1196357&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/resources/org/apache/tapestry5/ioc/internal/services/ServiceStrings.properties (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/resources/org/apache/tapestry5/ioc/internal/services/ServiceStrings.properties Tue Nov 1 23:08:53 2011
@@ -1,4 +1,4 @@
-# Copyright 2006, 2007, 2008 The Apache Software Foundation
+# Copyright 2006, 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.
@@ -12,14 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-unable-to-add-method=Unable to add method %s to class %s: %s
-unable-to-add-field=Unable to add field %s to class %s: %s
-unable-to-add-constructor=Unable to add constructor to class %s: %s
-unable-to-create-class=Unable to create class %s as subclass of %s: %s
-unable-to-lookup-class=Unable to lookup class %s: %s
-unable-to-write-class=Unable to create class %s: %s
-duplicate-method-in-class=Attempt to redefine method %s of class %s.
-logging-interceptor=<Logging interceptor for %s(%s)>
thread-cleanup-error=Error invoking listener %s: %s
no-such-property=Class %s does not contain a property named '%s'.
read-not-supported=Class %s does not provide an accessor ('getter') method for property '%s'.
@@ -29,7 +21,6 @@ write-failure=Error updating property '%
property-type-mismatch=Property '%s' of class %s is of type %s, which is not assignable to type %s.
extra-filter-method=Method %s of filter interface %s does not have a matching method in %s.
unmatched-service-method=Method %s has no match in filter interface %s.
-unknown-object-proxyProvider=Object proxyProvider '%s' does not exist (in object reference '%s').
shutdown-listener-error=Error notifying %s of registry shutdown: %s
recursive-symbol=Symbol '%s' is defined in terms of itself (%s).
symbol-undefined=Symbol '%s' is not defined.
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/AdviceDemoModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/AdviceDemoModule.java?rev=1196357&r1=1196356&r2=1196357&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/AdviceDemoModule.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/AdviceDemoModule.java Tue Nov 1 23:08:53 2011
@@ -1,4 +1,4 @@
-// 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.
@@ -17,6 +17,8 @@ package org.apache.tapestry5.ioc;
import org.apache.tapestry5.ioc.annotations.Match;
import org.apache.tapestry5.ioc.annotations.Order;
import org.apache.tapestry5.ioc.services.LoggingAdvisor;
+import org.apache.tapestry5.plastic.MethodAdvice;
+import org.apache.tapestry5.plastic.MethodInvocation;
import org.slf4j.Logger;
import java.lang.reflect.Method;
@@ -45,14 +47,14 @@ public class AdviceDemoModule
{
MethodAdvice advice = new MethodAdvice()
{
- public void advise(Invocation invocation)
+ public void advise(MethodInvocation invocation)
{
invocation.proceed();
- String result = (String) invocation.getResult();
+ String result = (String) invocation.getReturnValue();
if (result != null)
- invocation.overrideResult(result.toUpperCase());
+ invocation.setReturnValue(result.toUpperCase());
}
};
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/RegistryBuilderTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/RegistryBuilderTest.java?rev=1196357&r1=1196356&r2=1196357&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/RegistryBuilderTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/RegistryBuilderTest.java Tue Nov 1 23:08:53 2011
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007 The Apache Software Foundation
+// Copyright 2006, 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.
@@ -15,18 +15,16 @@
package org.apache.tapestry5.ioc;
-import java.util.Arrays;
-import java.util.List;
-
import org.apache.tapestry5.ioc.def.ModuleDef;
import org.apache.tapestry5.ioc.internal.DefaultModuleDefImpl;
-import org.apache.tapestry5.ioc.internal.services.ClassFactoryImpl;
-import org.apache.tapestry5.ioc.services.ClassFactory;
import org.apache.tapestry5.ioc.test.IOCTestCase;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.Test;
+import java.util.Arrays;
+import java.util.List;
+
public class RegistryBuilderTest extends IOCTestCase
{
@Test
@@ -73,12 +71,12 @@ public class RegistryBuilderTest extends
registry.shutdown();
}
-
+
@Test
public void build_and_startup_registry_from_modules()
{
Registry r = RegistryBuilder.buildAndStartupRegistry(MasterModule.class);
-
+
NameListHolder service = r.getService("UnorderedNames", NameListHolder.class);
List<String> names = service.getNames();
@@ -87,25 +85,24 @@ public class RegistryBuilderTest extends
r.shutdown();
}
-
+
@Test
public void build_and_startup_registry_from_moduledef_and_modules()
{
Logger logger = LoggerFactory.getLogger(getClass());
- ClassFactory classFactory = new ClassFactoryImpl();
ModuleDef module = new DefaultModuleDefImpl(ServiceBuilderModule.class, logger, null);
-
+
Registry r = RegistryBuilder.buildAndStartupRegistry(module, MasterModule.class);
-
+
NameListHolder nameListHolder = r.getService("UnorderedNames", NameListHolder.class);
List<String> names = nameListHolder.getNames();
assertEquals(names, Arrays.asList("Beta", "Gamma", "UnorderedNames"));
-
+
Greeter gretter = r.getService("Greeter", Greeter.class);
-
+
assertEquals(gretter.getGreeting(), "Greetings from service Greeter.");
r.shutdown();
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/AdviseByMarkerModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/AdviseByMarkerModule.java?rev=1196357&r1=1196356&r2=1196357&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/AdviseByMarkerModule.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/AdviseByMarkerModule.java Tue Nov 1 23:08:53 2011
@@ -1,4 +1,4 @@
-// Copyright 2010 The Apache Software Foundation
+// Copyright 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.
@@ -15,66 +15,66 @@ package org.apache.tapestry5.ioc.interna
import org.apache.tapestry5.ioc.GreenMarker;
import org.apache.tapestry5.ioc.Greeter;
-import org.apache.tapestry5.ioc.Invocation;
-import org.apache.tapestry5.ioc.MethodAdvice;
import org.apache.tapestry5.ioc.MethodAdviceReceiver;
import org.apache.tapestry5.ioc.RedMarker;
import org.apache.tapestry5.ioc.annotations.Advise;
import org.apache.tapestry5.ioc.annotations.Local;
import org.apache.tapestry5.ioc.annotations.Marker;
import org.apache.tapestry5.ioc.annotations.Order;
+import org.apache.tapestry5.plastic.MethodAdvice;
+import org.apache.tapestry5.plastic.MethodInvocation;
public class AdviseByMarkerModule
{
-
- @Advise(serviceInterface=Greeter.class, id="foo")
+
+ @Advise(serviceInterface = Greeter.class, id = "foo")
@GreenMarker
@Order("before:Greeter")
public static void doAdviseOneMoreTime(MethodAdviceReceiver receiver)
{
doAdvise(receiver, "gamma");
}
-
- @Advise(serviceInterface=Greeter.class, id="bar")
+
+ @Advise(serviceInterface = Greeter.class, id = "bar")
@GreenMarker
@Order({"after:foo", "before:Greeter"})
public static void doAdviseAgain(MethodAdviceReceiver receiver)
{
doAdvise(receiver, "beta");
}
-
- @Advise(serviceInterface=Greeter.class)
+
+ @Advise(serviceInterface = Greeter.class)
@GreenMarker
public static void doAdvise(MethodAdviceReceiver receiver)
{
doAdvise(receiver, "alpha");
}
-
+
private static void doAdvise(MethodAdviceReceiver receiver, final String id)
{
receiver.adviseAllMethods(new MethodAdvice()
{
-
- public void advise(Invocation invocation)
+
+ public void advise(MethodInvocation invocation)
{
invocation.proceed();
-
- Object result = invocation.getResult();
-
- invocation.overrideResult(String.format("%s[%s]", id, result));
-
+
+ Object result = invocation.getReturnValue();
+
+ invocation.setReturnValue(String.format("%s[%s]", id, result));
+
}
});
}
-
- @Advise(serviceInterface=Greeter.class, id="barney")
+
+ @Advise(serviceInterface = Greeter.class, id = "barney")
@Local
public static void localAdvise(MethodAdviceReceiver receiver)
{
doAdvise(receiver, "delta");
}
-
+
@Marker(RedMarker.class)
public Greeter buildRedGreeter()
{
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/AdviseByMarkerModule2.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/AdviseByMarkerModule2.java?rev=1196357&r1=1196356&r2=1196357&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/AdviseByMarkerModule2.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/AdviseByMarkerModule2.java Tue Nov 1 23:08:53 2011
@@ -1,4 +1,4 @@
-// Copyright 2010 The Apache Software Foundation
+// Copyright 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.
@@ -13,13 +13,16 @@
// limitations under the License.
package org.apache.tapestry5.ioc.internal;
-import org.apache.tapestry5.ioc.*;
+import org.apache.tapestry5.ioc.Greeter;
+import org.apache.tapestry5.ioc.MethodAdviceReceiver;
+import org.apache.tapestry5.ioc.RedMarker;
import org.apache.tapestry5.ioc.annotations.Advise;
import org.apache.tapestry5.ioc.annotations.Marker;
import org.apache.tapestry5.ioc.annotations.Match;
import org.apache.tapestry5.ioc.annotations.Order;
+import org.apache.tapestry5.plastic.MethodAdvice;
+import org.apache.tapestry5.plastic.MethodInvocation;
import org.testng.Assert;
-import org.testng.TestNG;
public class AdviseByMarkerModule2
@@ -29,26 +32,26 @@ public class AdviseByMarkerModule2
receiver.adviseAllMethods(new MethodAdvice()
{
- public void advise(Invocation invocation)
+ public void advise(MethodInvocation invocation)
{
invocation.proceed();
- Object result = invocation.getResult();
+ Object result = invocation.getReturnValue();
- invocation.overrideResult(String.format("%s[%s]", id, result));
+ invocation.setReturnValue(String.format("%s[%s]", id, result));
}
});
}
@Advise
- @Match ("RedGreeter")
+ @Match("RedGreeter")
public static void byMatchAnnotation(MethodAdviceReceiver receiver)
{
doAdvise(receiver, "alpha");
}
- @Advise(id="withMarker")
+ @Advise(id = "withMarker")
@RedMarker
@Order("before:*")
public static void byMarkerAnnotation(MethodAdviceReceiver receiver)
@@ -56,12 +59,12 @@ public class AdviseByMarkerModule2
doAdvise(receiver, "beta");
}
- @Advise(id="doesNotMatchAnyService")
+ @Advise(id = "doesNotMatchAnyService")
public static void doesNotMatchAnyService(MethodAdviceReceiver receiver)
{
Assert.fail("Unexpected invocation");
}
-
+
@Marker(RedMarker.class)
public Greeter buildRedGreeter()
{
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/DecorateByMarkerModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/DecorateByMarkerModule.java?rev=1196357&r1=1196356&r2=1196357&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/DecorateByMarkerModule.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/DecorateByMarkerModule.java Tue Nov 1 23:08:53 2011
@@ -1,4 +1,4 @@
-// Copyright 2010 The Apache Software Foundation
+// Copyright 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.
@@ -15,8 +15,6 @@ package org.apache.tapestry5.ioc.interna
import org.apache.tapestry5.ioc.GreenMarker;
import org.apache.tapestry5.ioc.Greeter;
-import org.apache.tapestry5.ioc.Invocation;
-import org.apache.tapestry5.ioc.MethodAdvice;
import org.apache.tapestry5.ioc.RedMarker;
import org.apache.tapestry5.ioc.ServiceResources;
import org.apache.tapestry5.ioc.annotations.Decorate;
@@ -25,65 +23,67 @@ import org.apache.tapestry5.ioc.annotati
import org.apache.tapestry5.ioc.annotations.Order;
import org.apache.tapestry5.ioc.services.AspectDecorator;
import org.apache.tapestry5.ioc.services.AspectInterceptorBuilder;
+import org.apache.tapestry5.plastic.MethodAdvice;
+import org.apache.tapestry5.plastic.MethodInvocation;
public class DecorateByMarkerModule
{
-
- @Decorate(serviceInterface=Greeter.class)
+
+ @Decorate(serviceInterface = Greeter.class)
@GreenMarker
public static <T> T greeter(ServiceResources resources, T delegate, AspectDecorator aspectDecorator)
{
return doDecorate("foo", resources, delegate, aspectDecorator);
}
-
- @Decorate(serviceInterface=Greeter.class, id="bar")
+
+ @Decorate(serviceInterface = Greeter.class, id = "bar")
@GreenMarker
@Order("after:Greeter")
public static <T> T greeter2(ServiceResources resources, T delegate, AspectDecorator aspectDecorator)
{
return doDecorate("bar", resources, delegate, aspectDecorator);
}
-
- @Decorate(serviceInterface=Greeter.class, id="baz")
+
+ @Decorate(serviceInterface = Greeter.class, id = "baz")
@GreenMarker
@Order({"after:Greeter", "before:bar"})
public static <T> T greeter3(ServiceResources resources, T delegate, AspectDecorator aspectDecorator)
{
return doDecorate("baz", resources, delegate, aspectDecorator);
}
-
- @Decorate(serviceInterface=Greeter.class, id="barney")
+
+ @Decorate(serviceInterface = Greeter.class, id = "barney")
@Local
public static <T> T localAdvise(ServiceResources resources, T delegate, AspectDecorator aspectDecorator)
{
return doDecorate("barney", resources, delegate, aspectDecorator);
}
-
+
private static <T> T doDecorate(final String decoratorId, ServiceResources resources, T delegate, AspectDecorator aspectDecorator)
{
Class<T> serviceInterface = resources.getServiceInterface();
-
+
AspectInterceptorBuilder<T> builder = aspectDecorator.createBuilder(serviceInterface, delegate, String.format(
"<Interceptor for %s(%s)>", resources.getServiceId(), serviceInterface.getName()));
builder.adviseAllMethods(new MethodAdvice()
{
-
- public void advise(Invocation invocation)
+
+ public void advise(MethodInvocation invocation)
{
invocation.proceed();
-
- Object result = invocation.getResult();
-
- invocation.overrideResult(String.format("Decorated by %s[%s]", decoratorId, result));
-
+
+ Object result = invocation.getReturnValue();
+
+ invocation.setReturnValue(String.format("Decorated by %s[%s]", decoratorId, result));
+
}
});
return builder.build();
}
-
+
@Marker(RedMarker.class)
public Greeter buildRedGreeter()
{
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/DecorateByMarkerModule2.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/DecorateByMarkerModule2.java?rev=1196357&r1=1196356&r2=1196357&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/DecorateByMarkerModule2.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/DecorateByMarkerModule2.java Tue Nov 1 23:08:53 2011
@@ -13,24 +13,31 @@
// limitations under the License.
package org.apache.tapestry5.ioc.internal;
-import org.apache.tapestry5.ioc.*;
-import org.apache.tapestry5.ioc.annotations.*;
+import org.apache.tapestry5.ioc.Greeter;
+import org.apache.tapestry5.ioc.RedMarker;
+import org.apache.tapestry5.ioc.ServiceResources;
+import org.apache.tapestry5.ioc.annotations.Decorate;
+import org.apache.tapestry5.ioc.annotations.Marker;
+import org.apache.tapestry5.ioc.annotations.Match;
+import org.apache.tapestry5.ioc.annotations.Order;
import org.apache.tapestry5.ioc.services.AspectDecorator;
import org.apache.tapestry5.ioc.services.AspectInterceptorBuilder;
+import org.apache.tapestry5.plastic.MethodAdvice;
+import org.apache.tapestry5.plastic.MethodInvocation;
import org.testng.Assert;
public class DecorateByMarkerModule2
{
-
+
@Decorate
@Match("RedGreeter")
public static <T> T byMatchAnnotation(ServiceResources resources, T delegate, AspectDecorator aspectDecorator)
{
return doDecorate("alpha", resources, delegate, aspectDecorator);
}
-
- @Decorate(id="withMarker")
+
+ @Decorate(id = "withMarker")
@RedMarker
@Order("before:*")
public static <T> T byMarkerAnnotation(ServiceResources resources, T delegate, AspectDecorator aspectDecorator)
@@ -38,38 +45,38 @@ public class DecorateByMarkerModule2
return doDecorate("beta", resources, delegate, aspectDecorator);
}
- @Decorate(id="doesNotMatchAnyService")
+ @Decorate(id = "doesNotMatchAnyService")
public static <T> T doesNotMatchAnyService(ServiceResources resources, T delegate, AspectDecorator aspectDecorator)
{
Assert.fail("Unexpected invocation");
return delegate;
}
-
+
private static <T> T doDecorate(final String decoratorId, ServiceResources resources, T delegate, AspectDecorator aspectDecorator)
{
Class<T> serviceInterface = resources.getServiceInterface();
-
+
AspectInterceptorBuilder<T> builder = aspectDecorator.createBuilder(serviceInterface, delegate, String.format(
"<Interceptor for %s(%s)>", resources.getServiceId(), serviceInterface.getName()));
builder.adviseAllMethods(new MethodAdvice()
{
-
- public void advise(Invocation invocation)
+
+ public void advise(MethodInvocation invocation)
{
invocation.proceed();
-
- Object result = invocation.getResult();
-
- invocation.overrideResult(String.format("Decorated by %s[%s]", decoratorId, result));
-
+
+ Object result = invocation.getReturnValue();
+
+ invocation.setReturnValue(String.format("Decorated by %s[%s]", decoratorId, result));
+
}
});
return builder.build();
}
-
+
@Marker(RedMarker.class)
public Greeter buildRedGreeter()
{
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/DefaultModuleDefImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/DefaultModuleDefImplTest.java?rev=1196357&r1=1196356&r2=1196357&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/DefaultModuleDefImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/DefaultModuleDefImplTest.java Tue Nov 1 23:08:53 2011
@@ -15,18 +15,15 @@
package org.apache.tapestry5.ioc.internal;
import javassist.bytecode.AccessFlag;
+import org.apache.tapestry5.internal.plastic.asm.ClassWriter;
import org.apache.tapestry5.ioc.*;
import org.apache.tapestry5.ioc.def.ContributionDef;
import org.apache.tapestry5.ioc.def.DecoratorDef;
import org.apache.tapestry5.ioc.def.ModuleDef;
import org.apache.tapestry5.ioc.def.ServiceDef;
-import org.apache.tapestry5.ioc.internal.services.ClassFactoryImpl;
import org.apache.tapestry5.ioc.internal.services.PlasticProxyFactoryImpl;
import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
import org.apache.tapestry5.ioc.internal.util.InternalUtils;
-import org.apache.tapestry5.ioc.services.ClassFab;
-import org.apache.tapestry5.ioc.services.ClassFactory;
-import org.apache.tapestry5.ioc.services.MethodSignature;
import org.apache.tapestry5.ioc.services.PlasticProxyFactory;
import org.apache.tapestry5.ioc.test.IOCTestCase;
import org.slf4j.Logger;
@@ -43,8 +40,6 @@ import static org.easymock.EasyMock.cont
public class DefaultModuleDefImplTest extends IOCTestCase
{
- private ClassFactory classFactory;
-
private PlasticProxyFactory proxyFactory;
private final OperationTracker tracker = new QuietOperationTracker();
@@ -52,14 +47,12 @@ public class DefaultModuleDefImplTest ex
@BeforeClass
public void setup()
{
- classFactory = new ClassFactoryImpl();
proxyFactory = new PlasticProxyFactoryImpl(Thread.currentThread().getContextClassLoader(), null);
}
@AfterClass
public void cleanup()
{
- classFactory = null;
proxyFactory = null;
}
@@ -656,6 +649,7 @@ public class DefaultModuleDefImplTest ex
private Class createSyntheticMethodModuleClass() throws NoSuchMethodException
{
+ /*
ClassFab fab = classFactory.newClass("EnhancedSyntheticMethodModule", SyntheticMethodModule.class);
int modifiers = Modifier.PUBLIC | AccessFlag.SYNTHETIC;
@@ -672,7 +666,9 @@ public class DefaultModuleDefImplTest ex
assertTrue(moduleClass.getMethod("size").isSynthetic());
- return moduleClass;
+ return moduleClass; */
+
+ return null;
}
// TODO: We're short on tests that ensure that marker annotation are additive (i.e., module
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/ModuleImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/ModuleImplTest.java?rev=1196357&r1=1196356&r2=1196357&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/ModuleImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/ModuleImplTest.java Tue Nov 1 23:08:53 2011
@@ -28,11 +28,6 @@ import java.util.Set;
public class ModuleImplTest extends IOCInternalTestCase
{
- protected final void train_newClass(InternalRegistry registry, ClassFactory factory, Class serviceInterface)
- {
- expect(registry.newClass(serviceInterface)).andReturn(factory.newClass(serviceInterface));
- }
-
@Test
public void find_service_ids_for_interface()
{
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/AspectInterceptorBuilderImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/AspectInterceptorBuilderImplTest.java?rev=1196357&r1=1196356&r2=1196357&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/AspectInterceptorBuilderImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/AspectInterceptorBuilderImplTest.java Tue Nov 1 23:08:53 2011
@@ -1,4 +1,4 @@
-// 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.
@@ -14,11 +14,11 @@
package org.apache.tapestry5.ioc.internal.services;
-import org.apache.tapestry5.ioc.Invocation;
-import org.apache.tapestry5.ioc.MethodAdvice;
import org.apache.tapestry5.ioc.internal.IOCInternalTestCase;
import org.apache.tapestry5.ioc.services.AspectDecorator;
import org.apache.tapestry5.ioc.services.AspectInterceptorBuilder;
+import org.apache.tapestry5.plastic.MethodAdvice;
+import org.apache.tapestry5.plastic.MethodInvocation;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@@ -51,9 +51,9 @@ public class AspectInterceptorBuilderImp
MethodAdvice advice = new MethodAdvice()
{
- public void advise(Invocation invocation)
+ public void advise(MethodInvocation invocation)
{
- assertEquals(invocation.getMethodName(), "advised");
+ assertEquals(invocation.getMethod().getName(), "advised");
invocation.proceed();
}
@@ -94,11 +94,10 @@ public class AspectInterceptorBuilderImp
builder.adviseMethod(Runnable.class.getMethod("run"), advice);
unreachable();
- }
- catch (IllegalArgumentException ex)
+ } catch (IllegalArgumentException ex)
{
assertEquals(ex.getMessage(),
- "Method public abstract void java.lang.Runnable.run() is not defined for interface interface org.apache.tapestry5.ioc.internal.services.AspectInterceptorBuilderImplTest$Subject.");
+ "Method public abstract void java.lang.Runnable.run() is not defined for interface interface org.apache.tapestry5.ioc.internal.services.AspectInterceptorBuilderImplTest$Subject.");
}
@@ -118,11 +117,11 @@ public class AspectInterceptorBuilderImp
MethodAdvice stripFirstLetter = new MethodAdvice()
{
- public void advise(Invocation invocation)
+ public void advise(MethodInvocation invocation)
{
String param = (String) invocation.getParameter(0);
- invocation.override(0, param.substring(1));
+ invocation.setParameter(0, param.substring(1));
invocation.proceed();
}
@@ -130,7 +129,7 @@ public class AspectInterceptorBuilderImp
MethodAdvice reverse = new MethodAdvice()
{
- public void advise(Invocation invocation)
+ public void advise(MethodInvocation invocation)
{
String param = (String) invocation.getParameter(0);
@@ -142,14 +141,14 @@ public class AspectInterceptorBuilderImp
for (int i = 0; i < count; i++)
output[count - i - 1] = input[i];
- invocation.override(0, new String(output));
+ invocation.setParameter(0, new String(output));
invocation.proceed();
}
};
AspectInterceptorBuilder<TextTransformer> builder = decorator.createBuilder(TextTransformer.class, delegate,
- "<TextTransformer>");
+ "<TextTransformer>");
Method method = TextTransformer.class.getMethod("transform", String.class);
builder.adviseMethod(method, stripFirstLetter);
@@ -168,7 +167,7 @@ public class AspectInterceptorBuilderImp
MethodAdvice advice = new MethodAdvice()
{
- public void advise(Invocation invocation)
+ public void advise(MethodInvocation invocation)
{
String[] param = (String[]) invocation.getParameter(0);
@@ -179,7 +178,7 @@ public class AspectInterceptorBuilderImp
invocation.proceed();
- String[] result = (String[]) invocation.getResult();
+ String[] result = (String[]) invocation.getReturnValue();
for (int i = 0; i < result.length; i++)
{
@@ -188,7 +187,11 @@ public class AspectInterceptorBuilderImp
}
};
- ArraysSubject advised = decorator.build(ArraysSubject.class, delegate, advice, "whatever");
+ AspectInterceptorBuilder<ArraysSubject> builder = decorator.createBuilder(ArraysSubject.class, delegate, "whatever");
+
+ builder.adviseAllMethods(advice);
+
+ ArraysSubject advised = builder.build();
String[] inputs = {"Fred", "Barney"};
Modified: tapestry/tapestry5/trunk/tapestry-spring/src/main/java/org/apache/tapestry5/internal/spring/SpringModuleDef.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-spring/src/main/java/org/apache/tapestry5/internal/spring/SpringModuleDef.java?rev=1196357&r1=1196356&r2=1196357&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-spring/src/main/java/org/apache/tapestry5/internal/spring/SpringModuleDef.java (original)
+++ tapestry/tapestry5/trunk/tapestry-spring/src/main/java/org/apache/tapestry5/internal/spring/SpringModuleDef.java Tue Nov 1 23:08:53 2011
@@ -23,8 +23,8 @@ import org.apache.tapestry5.ioc.def.Modu
import org.apache.tapestry5.ioc.def.ServiceDef;
import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
import org.apache.tapestry5.ioc.internal.util.InternalUtils;
-import org.apache.tapestry5.ioc.services.ClassFabUtils;
import org.apache.tapestry5.ioc.services.RegistryShutdownHub;
+import org.apache.tapestry5.plastic.PlasticUtils;
import org.apache.tapestry5.spring.ApplicationContextCustomizer;
import org.apache.tapestry5.spring.SpringConstants;
import org.springframework.beans.factory.BeanFactoryUtils;
@@ -271,8 +271,7 @@ public class SpringModuleDef implements
String message = String
.format(
"Spring context contains %d beans assignable to type %s: %s.",
- beanMap.size(), ClassFabUtils
- .toJavaClassName(objectType), InternalUtils
+ beanMap.size(), PlasticUtils.toTypeName(objectType), InternalUtils
.joinSorted(beanMap.keySet()));
throw new IllegalArgumentException(message);