提交 7a024d61 authored 作者: mysinmyc's avatar mysinmyc

Singleton

上级 5765e4e6
...@@ -11,6 +11,6 @@ package org.h2.security.auth; ...@@ -11,6 +11,6 @@ package org.h2.security.auth;
public class AuthenticatorFactory { public class AuthenticatorFactory {
public static Authenticator createAuthenticator() { public static Authenticator createAuthenticator() {
return new DefaultAuthenticator(); return DefaultAuthenticator.getInstance();
} }
} }
...@@ -66,6 +66,12 @@ public class DefaultAuthenticator implements Authenticator { ...@@ -66,6 +66,12 @@ public class DefaultAuthenticator implements Authenticator {
boolean initialized; boolean initialized;
private static final DefaultAuthenticator INSTANCE = new DefaultAuthenticator();
protected static final DefaultAuthenticator getInstance() {
return INSTANCE;
}
/** /**
* Create the Authenticator with default configurations * Create the Authenticator with default configurations
*/ */
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论