public interface Aspect
The Wake project contains a full-featured implementation of this API that may serve as a useful example.
Modifier and Type | Method and Description |
---|---|
Aspect |
createChildAspect()
This method creates a child aspect, and returns it.
|
<T> T |
inject(ConstructorDef<T> def,
Constructor<T> constructor,
Object[] args)
Inject an object of type T.
|
<T> void |
injectionFutureInstantiated(InjectionFuture<T> f,
T t)
TANG calls this the first time get() is called on an injection future.
|
<T> T inject(ConstructorDef<T> def, Constructor<T> constructor, Object[] args) throws InvocationTargetException, IllegalAccessException, IllegalArgumentException, InstantiationException
Note that it is never OK to return an instance of ExternalConstructor. Typical implementations check to see if they are about to return an instance of ExternalConstructor. If so, they return ret.newInstance() instead. It throws a number of exceptions which are passed-through from the wrapped call to newInstance().
def
- information about the constructor to be invoked. This is
mostly useful because it contains references to any relevant named
parameters, and to the class to be injected.constructor
- The java constructor to be injected. Tang automatically
chooses the appropriate constructor and ensures that we have permission
to invoke it.args
- The parameters to be passed into constructor.newInstance(), in the correct order.InvocationTargetException
IllegalAccessException
IllegalArgumentException
InstantiationException
<T> void injectionFutureInstantiated(InjectionFuture<T> f, T t)
f
- An InjectionFuture that was passed to the args[] array of inject at some point in the past.t
- An object instance that was returned by inject().Aspect createChildAspect()
Copyright © 2017 The Apache Software Foundation. All rights reserved.