Skip to content

Instantly share code, notes, and snippets.

@koert
Last active March 11, 2016 10:35
Show Gist options
  • Select an option

  • Save koert/580cc128534459810204 to your computer and use it in GitHub Desktop.

Select an option

Save koert/580cc128534459810204 to your computer and use it in GitHub Desktop.
Factory for Hazelcast instance
package zencode.hazelcast;
import com.hazelcast.core.Hazelcast;
import com.hazelcast.core.HazelcastInstance;
import javax.annotation.PostConstruct;
import javax.inject.Singleton;
/**
* Factory for Hazelcast instance.
* @author Koert Zeilstra
*/
@Singleton
public class HazelcastFactory {
private HazelcastInstance instance;
/**
* Initialiseer factory.
*/
@PostConstruct
public void init() {
instance = Hazelcast.newHazelcastInstance();
}
/**
* @return Singleton instance.
*/
public HazelcastInstance getInstance() {
return instance;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment