com.interface21.orm.jdo
Class LocalPersistenceManagerFactoryBean

java.lang.Object
  |
  +--com.interface21.orm.jdo.LocalPersistenceManagerFactoryBean
All Implemented Interfaces:
FactoryBean, InitializingBean

public class LocalPersistenceManagerFactoryBean
extends java.lang.Object
implements FactoryBean, InitializingBean

FactoryBean that creates local JDO PersistenceManager instances. Behaves like a PersistenceManagerFactory instance when used as bean reference, e.g. for JdoTemplate's persistenceManagerFactory property. Note that switching to JndiObjectFactoryBean is just a matter of configuration!

The typical usage will be to register this as singleton factory (for a certain underlying data source) in an application context, and give bean references to application services that need it.

This PersistenceManager handling strategy is most appropriate for applications that solely use JDO for data access. In this case, JdoTransactionManager is required for transaction demarcation, as JTA support isn't possible if JDO isn't installed as JCA connector.

Since:
03.06.2003
Author:
Juergen Hoeller

Constructor Summary
LocalPersistenceManagerFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
          Initialize the PersistenceManagerFactory for the given location.
 java.lang.Object getObject()
          Return the singleton PersistenceManagerFactory.
 PropertyValues getPropertyValues()
          Property values to pass to new bean instances created by this factory.
 boolean isSingleton()
          Is the bean managed by this factory a singleton or a prototype?
 void setLocation(java.lang.String location)
          Set the location of the JDO properties config file, as URL or classpath resource location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalPersistenceManagerFactoryBean

public LocalPersistenceManagerFactoryBean()
Method Detail

setLocation

public void setLocation(java.lang.String location)
Set the location of the JDO properties config file, as URL or classpath resource location.

afterPropertiesSet

public void afterPropertiesSet()
                        throws DataAccessResourceFailureException
Initialize the PersistenceManagerFactory for the given location.
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
DataAccessResourceFailureException - in case of initialization errors

getObject

public java.lang.Object getObject()
Return the singleton PersistenceManagerFactory.
Specified by:
getObject in interface FactoryBean
Following copied from interface: com.interface21.beans.factory.FactoryBean
Returns:
an instance of the bean

isSingleton

public boolean isSingleton()
Description copied from interface: FactoryBean
Is the bean managed by this factory a singleton or a prototype? That is, will getBean() always return the same object?
The singleton status of a FactoryBean will generally be provided by the owning BeanFactory.
Specified by:
isSingleton in interface FactoryBean
Following copied from interface: com.interface21.beans.factory.FactoryBean
Returns:
is this bean a singleton

getPropertyValues

public PropertyValues getPropertyValues()
Description copied from interface: FactoryBean
Property values to pass to new bean instances created by this factory. Mapped directly onto the bean instance using reflection. This occurs after any configuration of the instance performed by the factory itself, and is an optional step within the control of the owning BeanFactory.
Specified by:
getPropertyValues in interface FactoryBean
Following copied from interface: com.interface21.beans.factory.FactoryBean
Returns:
PropertyValues to pass to each new instance, or null (the default) if there are no properties to pass to the instance.


Rod Johnson and Spring contributors 2001-2003.