@Override
    public <T> void get(String cacheKey, final Class<T> type, final IAsyncResultHandler<T> handler) {
        try {
            GetResponse response = getClient().get(new GetRequest(getFullIndexName()).id(cacheKey), RequestOptions.DEFAULT);
            if (response.isExists()) {
                String sourceAsString = response.getSourceAsString();
                CacheEntry cacheEntry = JSON_MAPPER.readValue(sourceAsString, CacheEntry.class);
                try {
                    T rval = (T) JSON_MAPPER.reader(type).readValue(cacheEntry.getHead());
                    handler.handle(AsyncResultImpl.create(rval));
                } catch (IOException e) {
                    // TODO log this error.
                    handler.handle(AsyncResultImpl.create((T) null));
                }
            } else {
                handler.handle(AsyncResultImpl.create((T) null));
            }
        } catch (Throwable e) {
            handler.handle(AsyncResultImpl.create(e, type));
        }
    }
@see io.apiman.gateway.engine.components.ICacheStoreComponent#get(java.lang.String, java.lang.Class, io.apiman.gateway.engine.async.IAsyncResultHandler)
gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/EsCacheStoreComponent.java