Package com.hazelcast.client

Examples of com.hazelcast.client.HazelcastClient


  protected HazelcastClient getHazelcastClient(String ip) {

    ClientConfig clientConfig = new ClientConfig();

    clientConfig.addAddress(ip + ":" + E3Constant.HAZELCAST_PORT);
    HazelcastClient client = HazelcastClient.newHazelcastClient(clientConfig);

    return client;
  }
View Full Code Here


    // Connect a client to the cluster
    ClientConfig clientConfig = new ClientConfig() ;
    InetSocketAddress localMemberAddress = h1.getCluster().getLocalMember().getInetSocketAddress();
    clientConfig.addInetSocketAddress(localMemberAddress);
    HazelcastClient client = HazelcastClient.newHazelcastClient(clientConfig);

    // Add a key/value in the cluster using the client
    String mapName = "123";
    IMap<String, String> mapClient = client.getMap(mapName);
    mapClient.put("key1", "value1");

    // Check that the key/value was actually added in the cluster
    IMap<String, String> mapH1 = h1.getMap(mapName);
    mapH1.keySet();
View Full Code Here

  @Test
  public void testHazelcastJavaClient() throws UnknownHostException {
    // Connect a client to the cluster
    ClientConfig clientConfig = new ClientConfig() ;
    clientConfig.addInetSocketAddress(instance.getCluster().getLocalMember().getInetSocketAddress());
    HazelcastClient client = HazelcastClient.newHazelcastClient(clientConfig);

    // Check that the entry is not in the cache before the client add it
    assertNull(authCache.get("key1"));

    // Add a key/value in the cluster using the client
    IMap<String, String> mapClient = client.getMap(AUTH_MAP_NAME);
    mapClient.put("key1", "value1");

    // Check that the key/value was actually added in the cluster
    assertEquals("value1", authCache.get("key1"));
  }
View Full Code Here

    File bundleFile = new File (bundleFilePath);

    // Connect a client to the cluster
    ClientConfig clientConfig = new ClientConfig() ;
    clientConfig.addInetSocketAddress(instance.getCluster().getLocalMember().getInetSocketAddress());
    HazelcastClient client = HazelcastClient.newHazelcastClient(clientConfig);

    // Get a reference on the remote routes
    IQueue<ProvisionRouteTask> provisionRouteQueue = client.getQueue("bundles-to-deploy");
    assertEquals(0, provisionRouteQueue.size());

    IQueue<ProvisionRouteResult> provisionRouteResultQueue = client.getQueue("deployment-result");
    assertEquals(0, provisionRouteResultQueue.size());

    // Send the bundle to be deployed to the Gateway/s
    long provisionRouteTaskId = System.nanoTime();
    byte[] serializedBundle = BundleTools.file2ByteArray(bundleFile);
View Full Code Here

TOP

Related Classes of com.hazelcast.client.HazelcastClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.