package org.j2server.j2cache.cache.hazelcast;

import com.hazelcast.config.ClasspathXmlConfig;
import com.hazelcast.config.Config;
import com.hazelcast.core.Hazelcast;
import com.hazelcast.core.HazelcastInstance;


public class HazelcastLocal {
	private static HazelcastLocal _instance = new HazelcastLocal();
	private HazelcastInstance hazelcast = null;
	
	private HazelcastLocal() {
		
	}
	
	public synchronized static HazelcastLocal getInstance() {
		return _instance;
	}
	
	public synchronized HazelcastInstance getHazelcast() {
		if (hazelcast == null) {			
	        Config config = new ClasspathXmlConfig("org/j2server/j2cache/cache/hazelcast/hazelcast-cache-config.xml");
	        config.setInstanceName("j2cache");
			hazelcast = Hazelcast.getOrCreateHazelcastInstance(config);			
		}
		
		return hazelcast;
	}
	
}

@@ -214,18 +214,16 @@
 nce;%0D%0A%0D%0A
-%0D%0A
 public c
@@ -351,15 +351,8 @@
 cast
- = null
 ;%0D%0A%09
@@ -380,23 +380,16 @@
 ocal() %7B
-%0D%0A%09%09%0D%0A%09
 %7D%0D%0A%09%0D%0A%09p
@@ -394,29 +394,16 @@
 %09public 
-synchronized 
 static H
@@ -548,22 +548,13 @@
 l) %7B
+%0D%0A
 %09%09%09
-%0D%0A%09        
 Conf
@@ -657,17 +657,20 @@
 xml%22);%0D%0A
-%09
+    
         
@@ -705,19 +705,28 @@
 che%22);%0D%0A
-%09%09%09
+            
 hazelcas
@@ -743,19 +743,11 @@
 ast.
-getOrCreate
+new
 Haze
@@ -768,19 +768,16 @@
 config);
-%09%09%09
 %0D%0A%09%09%7D%0D%0A%09

add hazelcastLocal