Question about a cluster environment on a Weblogic server

I am using a Weblogic 10g clustered environment to deploy my application. In my application, I used the class Cache.javato load some properties from the database lazily. Here's how it works. Cache.javais a singleton class with instance variables as cache objects. For example, one of the instance variables List<String> STORES_IN_CITY. This cache is zero when clusters start. Actual values ​​are shown in the database. The implementation of the class is given below:

public class Cache
{
    private List<String> STORES_IN_CITY;

    private static final Cache cache=new Cache();

    public static Cache getCache()
    {
        return cache;
    {

    private Cache()
    {
        // private constructor to have singleton class
    }

    public List<String> getStoresInCity()
    {
        if(null==STORES_IN_CITY || STORES_IN_CITY.size()==0){
             STORES_IN_CITY=getStoresFromDatabase();
        }
        return STORES_IN_CITY;
    }
}

, STORES_IN_CITY. , , JVM . , , , . . ?

, . - , .

,

+5
1

(...) , , JVM .

.

. ?

weblogic.cluster.singleton.SingletonService ( singleton - , , ).

+4

All Articles