public CASResponse cas(String key, Object value, int ttlSec, long cas, long timeoutMiliSec) 
			throws TimeoutException, com.quickserverlab.quickcached.client.MemcachedException{
		try{
			Future <net.spy.memcached.CASResponse> f =  getCache().
				asyncCAS(key, cas, ttlSec, value, getCache().getTranscoder());
			try {
				net.spy.memcached.CASResponse cv = (net.spy.memcached.CASResponse) f.get(timeoutMiliSec, TimeUnit.MILLISECONDS);
				if(cv != null){
					if(cv.equals(net.spy.memcached.CASResponse.OK)){
						return CASResponse.OK;
					}else if(cv.equals(net.spy.memcached.CASResponse.EXISTS)){
						return CASResponse.EXISTS;
					}else if(cv.equals(net.spy.memcached.CASResponse.NOT_FOUND)){
						return CASResponse.NOT_FOUND;
					} else {
						return CASResponse.ERROR;
					}			
				}else{
					return CASResponse.ERROR;
				}
			}catch(CancellationException ce){
				throw new com.quickserverlab.quickcached.client.MemcachedException("CancellationException "+ ce);
			}catch(ExecutionException ee){
				throw new com.quickserverlab.quickcached.client.MemcachedException("ExecutionException "+ ee);
			}catch(InterruptedException ie){
				throw new com.quickserverlab.quickcached.client.MemcachedException("InterruptedException " + ie);
			}catch(java.util.concurrent.TimeoutException te){
				throw new TimeoutException("Timeout "+te);
			}finally{
				f.cancel(false);
			}
		}catch(IllegalStateException ise){
			throw new com.quickserverlab.quickcached.client.MemcachedException("IllegalStateException "+ ise);
		}
	}