Created
March 11, 2016 10:37
-
-
Save koert/e46501afcfe13d1417a5 to your computer and use it in GitHub Desktop.
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.IMap; | |
| import javax.inject.Inject; | |
| /** | |
| * Factory for clustered replicated data. | |
| * @author Koert Zeilstra | |
| */ | |
| public class ClusteredDataFactory { | |
| @Inject private HazelcastFactory hazelcastFactory; | |
| /** | |
| * Retrieve (or create) map. | |
| * @param name Map name | |
| * @param <KeyType> Key type. | |
| * @param <ValueType> Value type. | |
| * @return Clustered map. | |
| */ | |
| public <KeyType, ValueType> ClusteredMap<KeyType, ValueType> getMap(String name) { | |
| IMap<KeyType, ValueType> map = hazelcastFactory.getInstance().getMap(name); | |
| return new ClusteredMap<>(map); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment