コード例 #1
0
  /** {@inheritDoc} */
  @Override
  public void start() throws GridException {
    super.start();

    GridCacheIoManager<K, V> io = ctx.io();

    io.addHandler(
        GridDistributedLockRequest.class,
        new CI2<UUID, GridDistributedLockRequest<K, V>>() {
          @Override
          public void apply(UUID nodeId, GridDistributedLockRequest<K, V> req) {
            processLockRequest(nodeId, req);
          }
        });

    io.addHandler(
        GridDistributedLockResponse.class,
        new CI2<UUID, GridDistributedLockResponse<K, V>>() {
          @Override
          public void apply(UUID nodeId, GridDistributedLockResponse<K, V> res) {
            processLockResponse(nodeId, res);
          }
        });

    io.addHandler(
        GridDistributedTxFinishRequest.class,
        new CI2<UUID, GridDistributedTxFinishRequest<K, V>>() {
          @Override
          public void apply(UUID nodeId, GridDistributedTxFinishRequest<K, V> req) {
            processFinishRequest(nodeId, req);
          }
        });

    io.addHandler(
        GridDistributedTxFinishResponse.class,
        new CI2<UUID, GridDistributedTxFinishResponse<K, V>>() {
          @Override
          public void apply(UUID nodeId, GridDistributedTxFinishResponse<K, V> res) {
            processFinishResponse(nodeId, res);
          }
        });

    io.addHandler(
        GridDistributedTxPrepareRequest.class,
        new CI2<UUID, GridDistributedTxPrepareRequest<K, V>>() {
          @Override
          public void apply(UUID nodeId, GridDistributedTxPrepareRequest<K, V> req) {
            processPrepareRequest(nodeId, req);
          }
        });

    io.addHandler(
        GridDistributedTxPrepareResponse.class,
        new CI2<UUID, GridDistributedTxPrepareResponse<K, V>>() {
          @Override
          public void apply(UUID nodeId, GridDistributedTxPrepareResponse<K, V> res) {
            processPrepareResponse(nodeId, res);
          }
        });

    io.addHandler(
        GridDistributedUnlockRequest.class,
        new CI2<UUID, GridDistributedUnlockRequest<K, V>>() {
          @Override
          public void apply(UUID nodeId, GridDistributedUnlockRequest<K, V> req) {
            processUnlockRequest(nodeId, req);
          }
        });

    preldr = new GridReplicatedPreloader<K, V>(ctx);

    preldr.start();
  }
コード例 #2
0
  /** {@inheritDoc} */
  @Override
  public void onKernalStart() throws GridException {
    super.onKernalStart();

    if (preldr != null) preldr.onKernalStart();
  }
コード例 #3
0
  /** {@inheritDoc} */
  @Override
  public void onKernalStop() {
    super.onKernalStop();

    if (preldr != null) preldr.onKernalStop();
  }
コード例 #4
0
  /** {@inheritDoc} */
  @Override
  public void stop() {
    super.stop();

    if (preldr != null) preldr.stop();
  }