org.codehaus.nanning
Class Aspects

java.lang.Object
  extended byorg.codehaus.nanning.Aspects

public class Aspects
extends java.lang.Object

Utility for accessing and modifying aspected object.

Version:
$Revision: 1.3 $
Author:
$Author: tirsen $

Constructor Summary
Aspects()
           
 
Method Summary
static AspectInstance getAspectInstance(java.lang.Object proxy)
          Gets the AspectInstance of the given aspected object.
static AspectFactory getCurrentAspectFactory()
           
static java.util.Collection getInterceptors(java.lang.Object proxy)
          Gets the interceptors that belongs to the proxy.
static java.lang.Class getRealClass(java.lang.Class proxyClass)
          Given a proxy-class returns the first real interface it implements.
static java.lang.Object getTarget(java.lang.Object proxy, java.lang.Class interfaceClass)
          What is the target-object for the given interface.
static java.lang.Object[] getTargets(java.lang.Object object)
           
static java.lang.Object getThis()
          Gets the currently executing aspected object, aspected objects should use this method instead of this.
static boolean isAspectObject(java.lang.Object o)
           
static void setContextAspectFactory(AspectFactory factory)
           
static void setTarget(java.lang.Object proxy, java.lang.Class interfaceClass, java.lang.Object target)
          Sets the target of the mixin with the specified interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Aspects

public Aspects()
Method Detail

getInterceptors

public static java.util.Collection getInterceptors(java.lang.Object proxy)
Gets the interceptors that belongs to the proxy.

Parameters:
proxy -
Returns:
the interceptors.

getTarget

public static java.lang.Object getTarget(java.lang.Object proxy,
                                         java.lang.Class interfaceClass)
What is the target-object for the given interface.

Parameters:
proxy -
interfaceClass -
Returns:
the target-object.

getAspectInstance

public static AspectInstance getAspectInstance(java.lang.Object proxy)
Gets the AspectInstance of the given aspected object.

Parameters:
proxy -
Returns:

setTarget

public static void setTarget(java.lang.Object proxy,
                             java.lang.Class interfaceClass,
                             java.lang.Object target)
Sets the target of the mixin with the specified interface.

Parameters:
proxy -
interfaceClass -
target -

isAspectObject

public static boolean isAspectObject(java.lang.Object o)

getTargets

public static java.lang.Object[] getTargets(java.lang.Object object)

getCurrentAspectFactory

public static AspectFactory getCurrentAspectFactory()

setContextAspectFactory

public static void setContextAspectFactory(AspectFactory factory)

getRealClass

public static java.lang.Class getRealClass(java.lang.Class proxyClass)
Given a proxy-class returns the first real interface it implements.

Parameters:
proxyClass - proxyClass to inspect.
Returns:
first real interface implemented by proxyClass.

getThis

public static java.lang.Object getThis()
Gets the currently executing aspected object, aspected objects should use this method instead of this.

Returns:


Copyright © Jon Tirsen. All Rights Reserved.