Skip to content

Commit

Permalink
org.enso.std.aws provides DataLinkSPI.
Browse files Browse the repository at this point in the history
And DataLinkSPI is implemented with Lookup instead of ServiceLoader.
  • Loading branch information
Akirathan committed Oct 7, 2024
1 parent 2bd96d4 commit cf605cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions std-bits/aws/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import org.enso.aws.database.RedshiftConnectionDetailsSPI;
import org.enso.aws.file_system.S3FileSystemSPI;
import org.enso.base.enso_cloud.DataLinkSPI;
import org.enso.base.file_system.FileSystemSPI;
import org.enso.database.DatabaseConnectionDetailsSPI;

Expand All @@ -14,6 +15,8 @@

provides FileSystemSPI with
S3FileSystemSPI;
provides DataLinkSPI with
org.enso.aws.file_system.S3DataLinkSPI;
provides DatabaseConnectionDetailsSPI with
RedshiftConnectionDetailsSPI;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.ServiceLoader;
import java.util.stream.Collectors;
import org.enso.base.lookup.Lookup;
import org.enso.base.polyglot.EnsoMeta;
import org.graalvm.polyglot.Value;

Expand All @@ -11,8 +12,8 @@
* type should return a configured datalink instance that can later be `read`.
*/
public abstract class DataLinkSPI {
private static final ServiceLoader<DataLinkSPI> loader =
ServiceLoader.load(DataLinkSPI.class, DataLinkSPI.class.getClassLoader());
private static final Lookup<DataLinkSPI> loader =
Lookup.lookup((layer) -> ServiceLoader.load(layer, DataLinkSPI.class));

public void reload() {
loader.reload();
Expand Down

0 comments on commit cf605cd

Please sign in to comment.