org.springframework.orm.ojb.support
Class LocalOjbConfigurer

java.lang.Object
  extended byorg.springframework.orm.ojb.support.LocalOjbConfigurer
All Implemented Interfaces:
BeanFactoryAware

public class LocalOjbConfigurer
extends Object
implements BeanFactoryAware

This configurer needs to be defined as Spring bean when using LocalDataSourceConnectionFactory, to expose the Spring BeanFactory to the corresponding static field of the connection factory. See LocalDataSourceConnectionFactory's javadoc for usage details.

It is clearly not ideal to use a static field here, but unfortunately OJB creates an instance of the configured ConnectionFactory at broker creation time. OJB 1.0 does not have an explicit instance-based configuration model, therefore we have to resort to such workarounds.

Since:
1.1
Author:
Juergen Hoeller
See Also:
LocalDataSourceConnectionFactory

Constructor Summary
LocalOjbConfigurer()
           
 
Method Summary
 void setBeanFactory(BeanFactory beanFactory)
          Callback that supplies the owning factory to a bean instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalOjbConfigurer

public LocalOjbConfigurer()
Method Detail

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Description copied from interface: BeanFactoryAware
Callback that supplies the owning factory to a bean instance.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method.

Specified by:
setBeanFactory in interface BeanFactoryAware
Parameters:
beanFactory - owning BeanFactory (may not be null). The bean can immediately call methods on the factory.
See Also:
BeanInitializationException


Copyright (C) 2003-2004 The Spring Framework Project.