com.zfabrik.springframework
Class ComponentFactoryBean
java.lang.Object
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.
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
ComponentFactoryBean
public ComponentFactoryBean()
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