com.zfabrik.springframework
Class ComponentFactoryBean

java.lang.Object
  extended by com.zfabrik.springframework.ComponentFactoryBean
All Implemented Interfaces:
org.springframework.beans.factory.FactoryBean<Object>, org.springframework.context.ApplicationContextAware

public class ComponentFactoryBean
extends Object
implements org.springframework.beans.factory.FactoryBean<Object>, org.springframework.context.ApplicationContextAware

A factory bean that provides z2 components. Use like this

 <bean id="...bean..." class="com.zfabrik.spring.web.WebAppComponentFactoryBean">
   <property name="componentName" value="... z2 component ..."/>
   <property name="className" value="... z2 component facet type as in IResourceHandle.as(Class) ..."/>
   <property name="dependant" value="... z2 component to be made dependent on the providing component ..."/>
 </bean>
 
The "dependant" property is optional. It defaults to the java component of the context.


Field Summary
protected  String className
           
protected  Class<?> clz
           
protected  String componentName
           
protected  org.springframework.context.ApplicationContext ctxt
           
protected  String dependant
           
protected  Object instance
           
protected  IResourceHandle rh
           
 
Constructor Summary
ComponentFactoryBean()
           
 
Method Summary
 Object getObject()
           
 Class<?> getObjectType()
           
 boolean isSingleton()
           
 void setApplicationContext(org.springframework.context.ApplicationContext applicationcontext)
           
 void setClassName(String className)
           
 void setComponentName(String componentName)
           
 void setDependant(String dependant)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

componentName

protected String componentName

className

protected String className

dependant

protected String dependant

instance

protected Object instance

rh

protected IResourceHandle rh

clz

protected Class<?> clz

ctxt

protected org.springframework.context.ApplicationContext ctxt
Constructor Detail

ComponentFactoryBean

public ComponentFactoryBean()
Method Detail

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationcontext)
                           throws org.springframework.beans.BeansException
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Throws:
org.springframework.beans.BeansException

setComponentName

public void setComponentName(String componentName)

setClassName

public void setClassName(String className)

setDependant

public void setDependant(String dependant)

getObject

public Object getObject()
                 throws Exception
Specified by:
getObject in interface org.springframework.beans.factory.FactoryBean<Object>
Throws:
Exception

getObjectType

public Class<?> getObjectType()
Specified by:
getObjectType in interface org.springframework.beans.factory.FactoryBean<Object>

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface org.springframework.beans.factory.FactoryBean<Object>

toString

public String toString()
Overrides:
toString in class Object