class RemoteYangTextSourceProviderImpl implements RemoteYangTextSourceProvider {

    @Override
    public Future<YangTextSchemaSourceSerializationProxy> getYangTextSchemaSource(final SourceIdentifier identifier) {
        LOG.trace("Sending yang schema source for {}", identifier);

        final Promise<YangTextSchemaSourceSerializationProxy> promise = akka.dispatch.Futures.promise();
        ListenableFuture<YangTextSchemaSource> future =
                repository.getSchemaSource(identifier, YangTextSchemaSource.class);

        Futures.addCallback(future, new FutureCallback<YangTextSchemaSource>() {
            @Override
            public void onSuccess(final YangTextSchemaSource result) {
                try {
                    promise.success(new YangTextSchemaSourceSerializationProxy(result));
                } catch (IOException e) {
                    LOG.warn("Unable to read schema source for {}", result.getIdentifier(), e);
                    promise.failure(e);
                }
            }

            @Override
            public void onFailure(final Throwable failure) {
                LOG.warn("Unable to retrieve schema source from provider", failure);
                promise.failure(failure);
            }
        }, MoreExecutors.directExecutor());

        return promise.future();
    }

    public  RemoteYangTextSourceProviderImpl(final SchemaRepository repository,
            final Set<SourceIdentifier> providedSources);

}