[z3-five] [Fwd: [Zope-dev] [Warning] Zope 3 component architecture (CA) not reliably usable for registrations from Python]

Philipp von Weitershausen philipp at weitershausen.de
Wed Jan 10 18:18:20 CET 2007


Chris Withers wrote:
> Does this belong on this list or zope3-dev?

If at all, it should've been on zope3-dev.


> Subject:
> [Zope-dev] [Warning] Zope 3 component architecture (CA) not reliably 
> usable for registrations from Python
> From:
> "Dieter Maurer" <dieter at handshake.de>
> Date:
> Wed, 10 Jan 2007 10:01:23 +0100
> To:
> zope at zope.org, zope-dev at zope.org
> 
> To:
> zope at zope.org, zope-dev at zope.org
> CC:
> 
> 
> I tried to use Zope3 events to get informed when requests start and end.
> 
> One of our modules (the interface module to "jpype") requires such
> a notification for reliable work. Therefore, it tried to register
> the corresponding subscriptions on import of this module.
> Unfortunately, this works very unreliably -- for the following reasons:
> 
> 
>   The CA performs by itself only extremely minimal initialization.
>   Especially, it does not register the "Adapters" service, necessary
>   for the registration of event subscriptions.
> 
>   The full CA initialization is only performed quite late, in the call
>   to "Products.Five.initialize".
>   Event notification registration attempts before this time will fail
>   (with a "ComponentLookupError: 'Adapters'"), 
>   those performed after this time will succeed.
> 
> The "Five" initialization is stupid enough that it will fail
> when the service registration for 'Adapters' has already been performed.
> 
> 
> At the current state, event notifications can reliably only be defined 
> via ZCML. This is unfortunate for our use case where the registration
> should be bound to the import of a given module.
> 
> 
> 


-- 
http://worldcookery.com -- Professional Zope documentation and training
2nd edition of Web Component Development with Zope 3 is now shipping!



More information about the z3-five mailing list