Skip to content

Commit

Permalink
for-CONJ-742-and-CONJ-807, add Driver.class.getClassLoader() can solv…
Browse files Browse the repository at this point in the history
…e squirrel problem. But static introduce access denied
  • Loading branch information
GuuBu committed Aug 11, 2020
1 parent a5c414d commit e762851
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@

public class AuthenticationPluginLoader {

private static ServiceLoader<AuthenticationPlugin> loader =
ServiceLoader.load(AuthenticationPlugin.class, Driver.class.getClassLoader());

/**
* Get authentication plugin from type String. Customs authentication plugin can be added
* implementing AuthenticationPlugin and registering new type in resources services.
Expand All @@ -44,6 +41,9 @@ public static AuthenticationPlugin get(String type) throws SQLException {
return null;
}

ServiceLoader<AuthenticationPlugin> loader =
ServiceLoader.load(AuthenticationPlugin.class, Driver.class.getClassLoader());

for (AuthenticationPlugin implClass : loader) {
if (type.equals(implClass.type())) {
return implClass;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@
*/
public class CredentialPluginLoader {

private static ServiceLoader<CredentialPlugin> loader =
ServiceLoader.load(CredentialPlugin.class, Driver.class.getClassLoader());

/**
* Get current Identity plugin according to option `identityType`.
*
Expand All @@ -46,6 +43,9 @@ public static CredentialPlugin get(String type) throws SQLException {
return null;
}

ServiceLoader<CredentialPlugin> loader =
ServiceLoader.load(CredentialPlugin.class, Driver.class.getClassLoader());

for (CredentialPlugin implClass : loader) {
if (type.equals(implClass.type())) {
return implClass;
Expand Down

0 comments on commit e762851

Please sign in to comment.