cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Quinn <>
Subject component lifecycles
Date Mon, 28 Jun 2004 11:17:05 GMT
Hi All

I am making a (non-SiteMap) Avalon Component that allows you to manage 
LDAP Entries from FlowScript. (LDAPEntryManager).

I am loading the Component in FlowScript using it's Interface:

	var users = cocoon.getComponent (EntryManager.ROLE);

and disposing it using:

	cocoon.releaseComponent (users);

The Component implements the following lifecycle Interfaces:

	Configurable, Serviceable, Initializable, Disposable, ThreadSafe

Configurable works as expected, the configuration in cocoon.xconf is 
correctly read when Cocoon starts up.
I am not sure I need Serviceable as I do not need to lookup other 

  Initializable, Disposable are not triggering when expected.

My assumption was that 'initialize' would be called at the time of 
cocoon.getComponent and 'dispose' would be called at the time of 
cocoon.releaseComponent, but this is not happening.

'initialize' is being called at Cocoon startup, and 'dispose' is being 
called at Cocoon shutdown.

The Component is managing a Naming Context on behalf of the FlowScript. 
The Naming Context cannot be shared by multiple Threads AFAIU.

I am sorry, I am sure these basic lifecycle questions bore the bejesus 
out of you, but, what Interfaces should I implement to have my methods 
called by cocoon.getComponent and cocoon.releaseComponent ?

So, experimenting ..... I removed ThreadSafe and Serviceable.

What happens now is that the Component is Configured, Initialised and 
Disposed for every use, which is safer, but I do not need it Configured 
for every usage, this only needs to be done once.

How can I get it Configured only once, but Initialised and Disposed for 
every cocoon.getComponent/cocoon.releaseComponent pair?

Thanks for any suggestions.

regards Jeremy


                   If email from this address is not signed
                                 IT IS NOT FROM ME

                         Always check the label, folks !!!!!

View raw message