org.apache.tapestry5.ioc.internal.services
Class AspectDecoratorImpl

java.lang.Object
  extended by org.apache.tapestry5.ioc.internal.services.AspectDecoratorImpl
All Implemented Interfaces:
AspectDecorator

@PreventServiceDecoration
public class AspectDecoratorImpl
extends java.lang.Object
implements AspectDecorator


Constructor Summary
AspectDecoratorImpl(ClassFactory classFactory)
           
 
Method Summary
<T> T
build(java.lang.Class<T> serviceInterface, T delegate, MethodAdvice advice, java.lang.String description)
          Intercepts method invocations on the delegate and passes them through the provided aspect.
<T> AspectInterceptorBuilder<T>
createBuilder(java.lang.Class<T> serviceInterface, T delegate, java.lang.String description)
          Creates a builder that can be used to create the interceptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AspectDecoratorImpl

public AspectDecoratorImpl(@Builtin
                           ClassFactory classFactory)
Method Detail

build

public <T> T build(java.lang.Class<T> serviceInterface,
                   T delegate,
                   MethodAdvice advice,
                   java.lang.String description)
Description copied from interface: AspectDecorator
Intercepts method invocations on the delegate and passes them through the provided aspect. Note that the advice must be thread-safe.

Specified by:
build in interface AspectDecorator
Parameters:
serviceInterface - defines the interface of the interceptor and delegate
delegate - the object on which methods will be invoked
advice - intercepts the method invocations on the delegate
description - used as the toString() of the returned interceptor, unless toString() is part of the service interface
Returns:
the interceptor, wrapping the delegate with all the advice

createBuilder

public <T> AspectInterceptorBuilder<T> createBuilder(java.lang.Class<T> serviceInterface,
                                                     T delegate,
                                                     java.lang.String description)
Description copied from 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 recieve different advice, or when multiple advice is to be applied.

Specified by:
createBuilder in interface AspectDecorator
Parameters:
serviceInterface - defines the interface of the interceptor and the delegate
delegate - the object on which methods will be invokes
description - used as the toString() of the interceptor unless toString() is part of the service interface
Returns:
a builder that can be used to generate the final interceptor


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.