The Spring Framework

org.springframework.aop.aspectj.annotation
Class AspectJProxyFactory

java.lang.Object
  extended by org.springframework.aop.framework.ProxyConfig
      extended by org.springframework.aop.framework.AdvisedSupport
          extended by org.springframework.aop.aspectj.annotation.AspectJProxyFactory
All Implemented Interfaces:
Serializable, Advised

public class AspectJProxyFactory
extends AdvisedSupport

Since:
2.0
Author:
Rob Harrop
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.springframework.aop.framework.AdvisedSupport
EMPTY_TARGET_SOURCE
 
Fields inherited from class org.springframework.aop.framework.ProxyConfig
exposeProxy, logger
 
Constructor Summary
AspectJProxyFactory()
          Create a new AspectJProxyFactory.
AspectJProxyFactory(Class[] interfaces)
          Create a new AspectJProxyFactory.
AspectJProxyFactory(Object target)
          Create a new AspectJProxyFactory.
 
Method Summary
 void addAspect(Class aspectType)
          Adds an aspect of the supplied type to the end of the advice chain.
 void addAspect(Object aspect)
          Adds the supplied aspect instance to the chain.
<T> T
getProxy()
          Create a new proxy according to the settings in this factory.
<T> T
getProxy(ClassLoader classLoader)
          Create a new proxy according to the settings in this factory.
 
Methods inherited from class org.springframework.aop.framework.AdvisedSupport
addAdvice, addAdvice, addAdvisor, addAdvisor, addAdvisor, addAllAdvisors, addInterface, addListener, adviceChanged, adviceIncluded, copyConfigurationFrom, copyConfigurationFrom, countAdvicesOfType, createAopProxy, getAdvisorChainFactory, getAdvisors, getAdvisorsInternal, getProxiedInterfaces, getTargetSource, indexOf, indexOf, isActive, isInterfaceProxied, removeAdvice, removeAdvisor, removeAdvisor, removeInterface, removeListener, replaceAdvisor, setAdvisorChainFactory, setInterfaces, setTarget, setTargetSource, toProxyConfigString, toString, updateAdvisorArray, writeReplace
 
Methods inherited from class org.springframework.aop.framework.ProxyConfig
copyFrom, getAopProxyFactory, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setAopProxyFactory, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.aop.framework.Advised
isExposeProxy, isFrozen, isProxyTargetClass, setExposeProxy
 

Constructor Detail

AspectJProxyFactory

public AspectJProxyFactory()
Create a new AspectJProxyFactory.


AspectJProxyFactory

public AspectJProxyFactory(Object target)
                    throws AopConfigException
Create a new AspectJProxyFactory. Proxy all interfaces of the given target.

Throws:
AopConfigException

AspectJProxyFactory

public AspectJProxyFactory(Class[] interfaces)
Create a new AspectJProxyFactory. No target, only interfaces. Must add interceptors.

Method Detail

getProxy

public <T> T getProxy()
Create a new proxy according to the settings in this factory. Can be called repeatedly. Effect will vary if we've added or removed interfaces. Can add and remove interceptors.

Uses a default class loader: Usually, the thread context class loader (if necessary for proxy creation).

Returns:
the new proxy

getProxy

public <T> T getProxy(ClassLoader classLoader)
Create a new proxy according to the settings in this factory. Can be called repeatedly. Effect will vary if we've added or removed interfaces. Can add and remove interceptors.

Uses the given class loader (if necessary for proxy creation).

Parameters:
classLoader - the class loader to create the proxy with
Returns:
the new proxy

addAspect

public void addAspect(Object aspect)
Adds the supplied aspect instance to the chain. The type of the aspect instance supplied must be a singleton aspect. True singleton lifecycle is not honoured when using this method - the caller is responsible for managing the lifecycle of any aspects added in this way.


addAspect

public void addAspect(Class aspectType)
Adds an aspect of the supplied type to the end of the advice chain.


The Spring Framework

Copyright © 2002-2006 The Spring Framework.