db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leandro Rodrigo Saad Cruz <lean...@ibnetwork.com.br>
Subject Re: ObjectFactory problem - Pico caching
Date Tue, 16 Nov 2004 15:46:41 GMT
On Tue, 2004-11-16 at 15:48 +0100, Thomas Dudziak wrote:
 
> >
> I didn't touch the PersistenceBrokerFactory stuff yet, but I will so in 
> the next days - which will ultimatively result in the removal of the PBF 
> - so perhaps you should migrate to direct usage of the OJB class:
> 
> OJB ojb = new OJB();
> 
> ojb.getConfiguration().registerCreator(...);
> broker = ojb.lookupBroker(key);
> 
> Also, the creator registration probably doesn't work the way that you 
> think. If you want to register one creator instance that handles *all* 
> your classes, you should inherit from the ObjectFactoryDefaultImpl and 
> register your instance like this:
> 
> OJB ojb = new OJB();
> 
> ojb.getComponentContainer().setSingletonInstance(ObjectFactory.class, 
> myFactory);
> broker = ojb.lookupBroker(key);
> 
> but note that you have to do so before the configuration object is 
> created (i.e. before using this key).
> 
> Btw, the use-factory flag in the class descriptor is no longer 
> necessary, I just haven't removed it yet.

Ok.. thanks. I changed (will not commit) ObjectFactoryDefaultImpl to
handle the case on my example (using '*' as a type name). So. if you
call registerCreator(creator,"*"); this creator instance is considered
the default way to create objects

-- 
Leandro Rodrigo Saad Cruz
InterBusiness Tecnologia e Servi├žos
IB    - www.ibnetwork.com.br
DB    - www.digitalbrand.com.br
OJB   - db.apache.org/ojb
XINGU - xingu.sf.net


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message