Last active
March 11, 2016 10:35
-
-
Save koert/580cc128534459810204 to your computer and use it in GitHub Desktop.
Factory for Hazelcast instance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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