Ejemplo n.º 1
0
        public static void Run(string[] args)
        {
            var clientConfig = new Configuration();

            clientConfig.NetworkConfig.AddAddress("127.0.0.1");
            //clientConfig.NetworkConfig.AddAddress("10.0.0.2:5702");

            var sc = new SerializerConfig()
                     .SetImplementation(new CustomSerializer())
                     .SetTypeClass(typeof(Person));

            //Custom Serialization setup up for Person Class.
            clientConfig.SerializationConfig.SerializerConfigs.Add(sc);


            IHazelcastInstance client = HazelcastClient.NewHazelcastClient(clientConfig);
            //All cluster operations that you can do with ordinary HazelcastInstance
            IMap <string, Person> mapCustomers = client.GetMap <string, Person>("persons");

            mapCustomers.Put("1", new Person("Joe", "Smith"));
            mapCustomers.Put("2", new Person("Ali", "Selam"));
            mapCustomers.Put("3", new Person("Avi", "Noyan"));

            ICollection <Person> persons = mapCustomers.Values();

            foreach (var person in persons)
            {
                Console.WriteLine(person.ToString());
            }

            HazelcastClient.ShutdownAll();
            Console.ReadKey();
        }
 public void TearDown()
 {
     HazelcastClient.ShutdownAll();
     StopCluster(_remoteController, _cluster);
     StopRemoteController(_remoteController);
 }
Ejemplo n.º 3
0
 public void ShutdownAllClients()
 {
     HazelcastClient.ShutdownAll();
 }
Ejemplo n.º 4
0
 public void ShutdownRemoteController()
 {
     HazelcastClient.ShutdownAll();
     StopRemoteController(RemoteController);
 }
Ejemplo n.º 5
0
 public virtual void ShutdownRemoteController()
 {
     HazelcastClient.ShutdownAll();
     StopRemoteController(RemoteController);
     MemberList.Clear();
 }