|
[Deprecated API] | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | CURRENT API | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.interface21.jdbc.core.support.JdbcBeanFactory
ListableBeanFactory implementation that reads values from a database table. Expects columns for bean name, property name and value as string. Formats for each are identical to the properties format recognized by ListableBeanFactoryImpl.
| Constructor Summary | |
JdbcBeanFactory(javax.sql.DataSource ds,
java.lang.String sql)
Create a new JdbcBeanFactory |
|
| Method Summary | |
java.lang.String[] |
getAliases(java.lang.String name)
Return the aliases for the given bean name, if defined. |
java.lang.Object |
getBean(java.lang.String name)
Return an instance (possibly shared or independent) of the given bean name. |
java.lang.Object |
getBean(java.lang.String name,
java.lang.Class requiredType)
Return an instance (possibly shared or independent) of the given bean name. |
int |
getBeanDefinitionCount()
Return the number of beans defined in the factory |
java.lang.String[] |
getBeanDefinitionNames()
Return the names of all beans defined in this factory |
java.lang.String[] |
getBeanDefinitionNames(java.lang.Class type)
Return the names of beans matching the given object type (including subclasses). |
boolean |
isSingleton(java.lang.String name)
Is this bean a singleton? |
void |
refresh()
Refresh the factory. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public JdbcBeanFactory(javax.sql.DataSource ds,
java.lang.String sql)
ds - datasource to use to obtain connections. The datasource
will be cached during the life of this bean factory.sql - the first three columns must be bean name, property name and value. Any join
and any other columns are permitted: e.g.
SELECT BEAN_NAME, PROPERTY, VALUE FROM CONFIG WHERE CONFIG.APP_ID = 1
It's also possible to perform a join. Column names are not significant--only
the ordering of these first three columns.| Method Detail |
public void refresh()
public java.lang.Object getBean(java.lang.String name)
BeanFactorygetBean in interface BeanFactorycom.interface21.beans.factory.BeanFactoryname - name of the bean to returnNoSuchBeanDefinitionException - if there's no such bean definition
public java.lang.Object getBean(java.lang.String name,
java.lang.Class requiredType)
throws BeansException
BeanFactorygetBean in interface BeanFactorycom.interface21.beans.factory.BeanFactoryname - name of the bean to returnrequiredType - type the bean may match. Can be an interface or superclass
of the actual class. For example, if the value is Object.class, this method will
succeed whatever the class of the returned instance.BeanNotOfRequiredTypeException - if the bean is not of the required typeNoSuchBeanDefinitionException - if there's no such bean definitionpublic int getBeanDefinitionCount()
ListableBeanFactorygetBeanDefinitionCount in interface ListableBeanFactorycom.interface21.beans.factory.ListableBeanFactorypublic java.lang.String[] getBeanDefinitionNames()
ListableBeanFactorygetBeanDefinitionNames in interface ListableBeanFactorycom.interface21.beans.factory.ListableBeanFactorypublic java.lang.String[] getBeanDefinitionNames(java.lang.Class type)
ListableBeanFactorygetBeanDefinitionNames in interface ListableBeanFactorycom.interface21.beans.factory.ListableBeanFactorytype - class or interface to match
public boolean isSingleton(java.lang.String name)
throws NoSuchBeanDefinitionException
BeanFactoryisSingleton in interface BeanFactorycom.interface21.beans.factory.BeanFactoryname - name of the bean to queryNoSuchBeanDefinitionException - if there is no bean with the given namepublic java.lang.String[] getAliases(java.lang.String name)
BeanFactorygetAliases in interface BeanFactorycom.interface21.beans.factory.BeanFactoryname - the bean name to check for aliases
|
[Deprecated API] | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | CURRENT API | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||