Remove deprecated controller.sal.core.api interfaces
[controller.git] / opendaylight / md-sal / sal-schema-service / src / main / java / org / opendaylight / controller / sal / schema / service / impl / GlobalBundleScanningSchemaServiceImpl.java
index 4a4ae3b82acf9fbe5fbcf21b207f8e2ba6435c62..7a91cdf7be628944663bc1188f6b43a32afb5a80 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.controller.sal.schema.service.impl;
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
 import java.util.HashSet;
 import java.util.Set;
 import javax.annotation.concurrent.GuardedBy;
@@ -28,6 +29,7 @@ import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceException;
 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
 import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
 
+@Deprecated
 public final class GlobalBundleScanningSchemaServiceImpl implements SchemaContextProvider, SchemaService,
         YangTextSourceProvider, AutoCloseable {
 
@@ -114,6 +116,7 @@ public final class GlobalBundleScanningSchemaServiceImpl implements SchemaContex
                 "Source provider is not available", sourceIdentifier));
         }
 
-        return (CheckedFuture<YangTextSchemaSource, SchemaSourceException>) yangProvider.getSource(sourceIdentifier);
+        return Futures.makeChecked((ListenableFuture<YangTextSchemaSource>) yangProvider.getSource(sourceIdentifier),
+            e -> new SchemaSourceException("Error retrieving source", e));
     }
 }