on 1/30/01 11:42 PM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Jon,
>
> A possibility to customize the TurbineServices instance would be useful in
> integration to different environments than a typical servlet engine.
>
> Something like this:
>
> public class TurbineServices extends BaseServiceBroker
> {
> protected static ServiceBroker instance;
>
> public static ServiceBroker getInstance()
> {
> if (instance == null)
> {
> synchronized(TurbineServices.class)
> {
> if (instance == null)
> instance = new TurbineServices();
> }
> }
> return instance;
> }
>
> protected TurbineServices()
> {
> }
> }
>
> Would allow subclasses to assign their own service broker implementation to
> the static instance member before getInstance() is called.
>
> -- Ilkka
However, if you read the Double Checked Locking email that I just sent
around, you would see that that is NOT safe to do in a JVM at this date and
time.
@see
<http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html>
Think of another solution please.
-jon
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]