ColdSpring 2.0 - Narwhal

coldspring.aop.framework
Class ProxyFactoryBean

WEB-INF.cftags.component
        extended by coldspring.aop.framework.ProxyFactoryBean
All Implemented Interfaces:
BeanFactoryAware , FactoryBean
Direct Known Subclasses:
RemoteFactoryBean

public class ProxyFactoryBean
extends WEB-INF.cftags.component

FactoryBean implementation that builds an AOP proxy based on beans in ColdSpring BeanFactory.


Constructor Summary
init()
          Constructor
 
Method Summary
 void buildInterceptors()
          add all the interceptor named Advice/Advisor to the ProxyFactory
private BeanFactory getBeanFactory()
 array getInterceptorNames()
 any getObject()
          Return a proxy
 string getObjectType()
           Return the type of the proxy
private ProxyFactory getProxyFactory()
private any getProxySingleton()
 any getTarget()
 string getTargetName()
 boolean hasBeanFactory()
          whether this object has a beanFactory
 boolean hasInterceptorNames()
          whether this object has interceptor names set against it (also returns false on an empty array)
private boolean hasProxySingleton()
          whether this object has a proxy Singleton
 boolean hasTarget()
          whether this object has a target
 boolean hasTargetName()
          whether this object has a target name
private boolean isInterceptorsBuilt()
 boolean isSingleton()
           Is the object managed by this factory a singleton? That is, will getObject() always return the same object (a reference that can be cached)?
NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory
 void setBeanFactory(BeanFactory beanFactory)
          Callback that supplies the owning factory to a bean instance
 void setInterceptorNames(any interceptorNames)
          Set the list of Advice/Advisor bean names
private void setInterceptorsBuilt(boolean interceptorsBuilt)
private void setProxyFactory(ProxyFactory proxyFactory)
private void setProxySingleton(any proxySingleton)
 void setSingleton(boolean isSingleton)
          Set the value of the singleton property
 void setTarget(any target)
 void setTargetName(string targetName)
 
Methods inherited from class WEB-INF.cftags.component
 

Constructor Detail

init

public init()
Constructor

Method Detail

buildInterceptors

public void buildInterceptors()
add all the interceptor named Advice/Advisor to the ProxyFactory


getBeanFactory

private BeanFactory getBeanFactory()


getInterceptorNames

public array getInterceptorNames()


getObject

public any getObject()
Return a proxy. Invoked when clients obtain beans from this factory bean. Create an instance of the AOP proxy to be returned by this factory. The instance will be cached for a singleton, and create on each call to getObject() for a proxy.

Specified by:
getObject in interface FactoryBean

getObjectType

public string getObjectType()
Return the type of the proxy. Will check the singleton instance if already created, else fall back to the proxy interface (in case of just a single one), the target bean type, or the TargetSource's target class.

Specified by:
getObjectType in interface FactoryBean

getProxyFactory

private ProxyFactory getProxyFactory()


getProxySingleton

private any getProxySingleton()


getTarget

public any getTarget()


getTargetName

public string getTargetName()


hasBeanFactory

public boolean hasBeanFactory()
whether this object has a beanFactory


hasInterceptorNames

public boolean hasInterceptorNames()
whether this object has interceptor names set against it (also returns false on an empty array)


hasProxySingleton

private boolean hasProxySingleton()
whether this object has a proxy Singleton


hasTarget

public boolean hasTarget()
whether this object has a target


hasTargetName

public boolean hasTargetName()
whether this object has a target name


isInterceptorsBuilt

private boolean isInterceptorsBuilt()


isSingleton

public boolean isSingleton()
Is the object managed by this factory a singleton? That is, will getObject() always return the same object (a reference that can be cached)?
NOTE: If a FactoryBean indicates to hold a singleton object, the object returned from getObject() might get cached by the owning BeanFactory. Hence, do not return true unless the FactoryBean always exposes the same reference.
The singleton status of the FactoryBean itself will generally be provided by the owning BeanFactory; usually, it has to be defined as singleton there.

Specified by:
isSingleton in interface FactoryBean

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance. Invoked after the population of normal bean properties but before an initialization callback such as a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory -

setInterceptorNames

public void setInterceptorNames(any interceptorNames)
Set the list of Advice/Advisor bean names. This can be set, as either a string list, or as an array, must always be set to use this factory bean in a bean factory.
The referenced beans should be of type Advisor or Advice.

Parameters:
interceptorNames -

setInterceptorsBuilt

private void setInterceptorsBuilt(boolean interceptorsBuilt)

Parameters:
interceptorsBuilt -

setProxyFactory

private void setProxyFactory(ProxyFactory proxyFactory)

Parameters:
proxyFactory -

setProxySingleton

private void setProxySingleton(any proxySingleton)

Parameters:
proxySingleton -

setSingleton

public void setSingleton(boolean isSingleton)
Set the value of the singleton property. Governs whether this factory should always return the same proxy instance (which implies the same target) or whether it should return a new prototype instance, which implies that the target and interceptors may be new instances also, if they are obtained from prototype bean definitions. This allows for fine control of independence/uniqueness in the object graph.

Parameters:
isSingleton -

setTarget

public void setTarget(any target)

Parameters:
target -

setTargetName

public void setTargetName(string targetName)

Parameters:
targetName -

ColdSpring 2.0 - Narwhal