class ContextsManager {

    public Object executeQueryForMetadata(UUID uuid, final Object query) {
        jrsBeanValidator.validate(query);
        final ContextDataPair contextDataPair = contextDataStorage.get(uuid);
        final Object context = contextDataPair.getContext();
        final ContextQueryExecutor<Object, Object> queryExecutor = getQueryExecutor(query, context);
        return callAndGet(uuid, new Callable<Object>() {
            @Override
            public Object call() throws Exception {
                if(log.isDebugEnabled())log.debug("Starting of query execution for metadata. Context " + context.toString());
                final Object result = queryExecutor.executeQueryForMetadata(query, context, contextDataPair.getData());
                if(log.isDebugEnabled())log.debug("Query execution for metadata is completed. Context " + context.toString());
                return result;
            }
        });
    }

}