db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neeme Praks <ne...@apache.org>
Subject wrapping OJB as an avalon component
Date Wed, 23 Apr 2003 13:37:08 GMT

I trying to wrap OJB as an Avalon component for use as persistence 
engine inside avalon containers. Due to the fact that in OJB quite a bit 
of code is dealing with component management and lifecycle and Avalon 
containers can take care of those issues on behalf of OJB, I would like 
to implement this component in an Avalon friendly way: by using Avalon 
component management and lifecycle, instead of OJBs. So, here are some 
implementation questions I have come up with...

The main changes would be:
* convert PersistenceBrokerFactory into an Avalon component (no evil 
static stuff :-))
* use Avalon configuration interfaces to load OJB properties (wrapper 
around OJB configuration interfaces).
* when getting a PersistenceBroker from factory, the requesting 
component would have to supply the relevant repository.xml (as 
inputstream, for example) and it would get back a broker that would be 
properly configured for this particular component.

The interface that I would like this PersistenceBrokerFactory component 
to have is:
package org.apache.ojb.avalon;

import java.io.InputStream;

public interface PersistenceBrokerFactory {

    PersistenceBroker defaultPersistenceBroker();
    PersistenceBroker createPersistenceBroker(InputStream repository);


When implementing this, I should check out the import 
org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl, right?
Then just replace some stuff like pooling with Avalon services and it 
should work, right?

Any comments and pointers are helpful!

View raw message