Peter Wieland wrote:
Hello once again,
I posted the question below a few days ago but didn't get any answer. So one more time my question: Is there a way to tell the persistence broker factory to register a specific lifcycle listener with any newly created persistence broker?
You can implement your own PBF implementation. Or you can implement your own PersistenceBroker by subclassing PersistenceBrokerImpl and do
class PersistenceBrokerMyOwnImpl extends PersistenceBrokerImpl
{
public PersistenceBrokerMyOwnImpl(PBKey key, PersistenceBrokerFactoryIF pbf)
{
super(key, pbf);
listener = getTheListener
this.this.addListener(listener, true);
}
}
regards, Armin
Thanks for your help,
Peter
--- HIER BEGINNT DIE WEITERGELEITETE NACHRICHT ------------------------------ Von: [EMAIL PROTECTED] (Peter Wieland) Datum: 19.01.2004, 14:49:25 Betreff: PBLifecycleListener on any PersistanceBroker instance
Hi there,
I've got the following problem: I implemented a PBLifecycleListener to do some initialization after objects were looked up. Everything works well as long as I use the persistence broker I created myself and I registered the listener with. But it does not work with proxies. When OJB materializes my list proxies, it uses another broker instance and I have no chance to register a lifecycle listener with this new instance. Hence, objects that are loaded via proxies are never passed to my lifecycle listener and have no chance to be properly initialized.
Any suggestions?
Thanx,
Peter
--- ENDE DER WEITERGELEITETEN NACHRICHT--------------------------------------
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
