KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jfun > yan > factory > GlobalScope


1 /*****************************************************************************
2  * Copyright (C) Zephyr Business Solution. All rights reserved. *
3  * ------------------------------------------------------------------------- *
4  * The software in this package is published under the terms of the BSD *
5  * style license a copy of which has been included with this distribution in *
6  * the LICENSE.txt file. *
7  *****************************************************************************/

8
9 /*
10  * Created on Jun 8, 2005
11  *
12  * Author Ben Yu
13  * ZBS
14  */

15 package jfun.yan.factory;
16
17 /**
18  * Represents a pooling strategy that pools the data
19  * in a variable that's global to all threads.
20  * <br>
21  * This implementation is thread-safe.
22  * <p>
23  * Zephyr Business Solution
24  *
25  * @author Ben Yu
26  *
27  */

28 public class GlobalScope<T> extends CachingPool<T> {
29   public synchronized T getInstance(Factory<T> factory) {
30     return super.getInstance(factory);
31   }
32   public synchronized T getPooledInstance(T def) {
33     return super.getPooledInstance(def);
34   }
35   public synchronized boolean isPooled(){
36     return super.isPooled();
37   }
38 }
39
Popular Tags