All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.spy.memcached.internal.GetConfigFuture Maven / Gradle / Ivy

Go to download

Amazon ElastiCache Cluster Client is an enhanced Java library to connect to ElastiCache clusters. This client library has been built upon Spymemcached and is released under the Amazon Software License.

The newest version!
/**
 * Copyright (C) 2012-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. 
 *
 * SPDX-License-Identifier: Apache-2.0
 */
package net.spy.memcached.internal;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

import net.spy.memcached.ops.ConfigurationType;
import net.spy.memcached.ops.Operation;
import net.spy.memcached.ops.OperationStatus;

/**
 * Future returned for GetConfig operation.
 *
 * Not intended for general use.
 *
 * @param  Type of object returned from the getconfig
 */
public class GetConfigFuture implements Future {

  private final OperationFuture> rv;

  public GetConfigFuture(CountDownLatch l, long opTimeout, ConfigurationType type,
		  ExecutorService service) {
    this.rv = new OperationFuture>(type.getValue(), l, opTimeout, service);
  }

  public boolean cancel(boolean ign) {
    return rv.cancel(ign);
  }

  public T get() throws InterruptedException, ExecutionException {
    Future v = rv.get();
    return v == null ? null : v.get();
  }

  public T get(long duration, TimeUnit units) throws InterruptedException,
      TimeoutException, ExecutionException {
    Future v = rv.get(duration, units);
    return v == null ? null : v.get();
  }

  public OperationStatus getStatus() {
    return rv.getStatus();
  }

  public void set(Future d, OperationStatus s) {
    rv.set(d, s);
  }

  public void setOperation(Operation to) {
    rv.setOperation(to);
  }

  public boolean isCancelled() {
    return rv.isCancelled();
  }

  public boolean isDone() {
    return rv.isDone();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy