示例#1
0
  /**
   * Executes example.
   *
   * @param args Command line arguments, none required.
   * @throws GridException If example execution failed.
   */
  public static void main(String[] args) throws Exception {
    try (Grid grid = GridGain.start("examples/config/example-cache.xml")) {
      System.out.println();
      System.out.println(">>> Events API example started.");

      // Listen to events happening on local node.
      localListen();

      // Listen to events happening on all grid nodes.
      remoteListen();

      // Wait for a while while callback is notified about remaining puts.
      Thread.sleep(1000);
    }
  }