SourceForge.net Logo

de.mindmatters.faces.spring.factory
Class AbstractCglibSubclassCreator

java.lang.Object
  extended byde.mindmatters.faces.spring.factory.AbstractCglibSubclassCreator

public abstract class AbstractCglibSubclassCreator
extends java.lang.Object

Abstract base class for generating and instantiating subclasses of beans. This beans are usually defined in a jsf-spring bean container.

This class should be used for generating proxies. The main domain of this creator is building subclasses/proxies for special InstantiationStrategys or InstantiationProcessors.

Author:
Andreas Kuhrwahl
See Also:
InstantiationProcessor.processBeforeInstantiation(Class, String, Constructor, Object[]), ConfigurableInstantiationStrategy

Nested Class Summary
 class AbstractCglibSubclassCreator.CglibIdentitySupport
          Class providing hashCode and equals methods required by CGLIB to ensure that CGLIB doesn't generate a distinct class per bean.
 
Field Summary
protected  org.apache.commons.logging.Log logger
          For logging.
 
Constructor Summary
AbstractCglibSubclassCreator(java.lang.Class superClass, java.lang.String beanName)
          Constructs a cglib creator for subclassing beans of type superClass with name beanName.
 
Method Summary
protected abstract  net.sf.cglib.proxy.CallbackFilter createCallbackFilter()
          Creates the needed cglib callbackFilter.
protected abstract  net.sf.cglib.proxy.Callback[] createCallbacks()
          Create the needed cglib callbacks.
 java.lang.Object instantiate(java.lang.Class[] superInterfaces, java.lang.reflect.Constructor ctor, java.lang.Object[] args)
          Create a new instance of a dynamically generated subclass.
 java.lang.Object instantiate(java.lang.reflect.Constructor ctor, java.lang.Object[] args)
          Create a new instance of a dynamically generated subclass.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
For logging.

Constructor Detail

AbstractCglibSubclassCreator

public AbstractCglibSubclassCreator(java.lang.Class superClass,
                                    java.lang.String beanName)
Constructs a cglib creator for subclassing beans of type superClass with name beanName.

Parameters:
superClass - the type of the bean to subclass
beanName - the name of the bean to subclass
Method Detail

instantiate

public final java.lang.Object instantiate(java.lang.reflect.Constructor ctor,
                                          java.lang.Object[] args)
Create a new instance of a dynamically generated subclass.

Parameters:
ctor - constructor to use. If this is null, use the no-arg constructor (no parameterization or setter injection)
args - arguments to use for the constructor. Ignored if the ctor parameter is null.
Returns:
new instance of the dynamically generated class

instantiate

public final java.lang.Object instantiate(java.lang.Class[] superInterfaces,
                                          java.lang.reflect.Constructor ctor,
                                          java.lang.Object[] args)
Create a new instance of a dynamically generated subclass.

Parameters:
superInterfaces - super interfaces to be implemented by the generated subclass
ctor - constructor to use. If this is null, use the no-arg constructor (no parameterization or setter injection)
args - arguments to use for the constructor. Ignored if the ctor parameter is null.
Returns:
new instance of the dynamically generated class

createCallbacks

protected abstract net.sf.cglib.proxy.Callback[] createCallbacks()
Create the needed cglib callbacks.

Returns:
the callbacks to invoke on filtered methods

createCallbackFilter

protected abstract net.sf.cglib.proxy.CallbackFilter createCallbackFilter()
Creates the needed cglib callbackFilter.

Returns:
the callback filter filtering the matching methods to override/implement

SourceForge.net Logo

Copyright © 2002 mindmatters GmbH & Co. KG