cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph Goers <>
Subject Re: components not as factory or pooled
Date Fri, 18 Nov 2005 16:17:00 GMT
Iacturus wrote:

>> That's the mechanism currently used to flag whether a component is to 
>> be treated as a singleton.  Why wouldn't it be possible?
> The problem is, that i need to have exclusive access on object 
> (component) level.
> Using the Threadsafe interface will cause the need of java 
> synchronization:

> synchronized (myComponent) {
>     myComponent.doSomething1();
>     myComponent.doSomething2();
> }
> This is in any case a bottleneck, but i intended to delegate this to 
> the component manager.
> My component is not thread safe and it is not possible to make it 
> thread safe.
> Thx, Robert

You have me totally confused.  Singletons, by their nature, must be 
thread safe as there is only one instance of the object acting on behalf 
of everyone.  So if you want a singleton then you have to synchronize if 
necessary.  The alternative is to create multiple objects to handle each 

I don't see how delegating the non-thread-safe activity to a component 
manager solves the problem.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message