This is an automated email from the ASF dual-hosted git repository.
jianglongtao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new ce8e3bfa338 Add @SingletonSPI (#27869)
ce8e3bfa338 is described below
commit ce8e3bfa338fd64679467df55b234333c873e0a9
Author: Liang Zhang <[email protected]>
AuthorDate: Wed Aug 2 23:05:02 2023 +0800
Add @SingletonSPI (#27869)
* Add @SingletonSPI
* Rename DatabasePermittedAuthorityRegistryProviderTest
---
.../apache/shardingsphere/example/generator/core/ExampleGenerator.java | 2 ++
.../shardingsphere/example/generator/scenario/ExampleScenario.java | 2 ++
...derTest.java => DatabasePermittedAuthorityRegistryProviderTest.java} | 2 +-
.../java/org/apache/shardingsphere/sql/parser/spi/SQLParserFacade.java | 2 ++
.../shardingsphere/proxy/backend/lock/spi/ClusterLockStrategy.java | 2 ++
.../it/sql/parser/external/result/SQLParseResultReporterCreator.java | 2 ++
6 files changed, 11 insertions(+), 1 deletion(-)
diff --git
a/examples/shardingsphere-example-generator/src/main/java/org/apache/shardingsphere/example/generator/core/ExampleGenerator.java
b/examples/shardingsphere-example-generator/src/main/java/org/apache/shardingsphere/example/generator/core/ExampleGenerator.java
index c935637ca3a..89466849d1c 100644
---
a/examples/shardingsphere-example-generator/src/main/java/org/apache/shardingsphere/example/generator/core/ExampleGenerator.java
+++
b/examples/shardingsphere-example-generator/src/main/java/org/apache/shardingsphere/example/generator/core/ExampleGenerator.java
@@ -22,6 +22,7 @@ import freemarker.template.Configuration;
import freemarker.template.TemplateException;
import
org.apache.shardingsphere.example.generator.core.yaml.config.YamlExampleConfiguration;
import org.apache.shardingsphere.infra.autogen.version.ShardingSphereVersion;
+import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI;
import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI;
import java.io.IOException;
@@ -32,6 +33,7 @@ import java.util.Properties;
/**
* Example generator.
*/
+@SingletonSPI
public interface ExampleGenerator extends TypedSPI {
String DEFAULT_OUTPUT =
"./examples/shardingsphere-example-generator/target/generated-sources/";
diff --git
a/examples/shardingsphere-example-generator/src/main/java/org/apache/shardingsphere/example/generator/scenario/ExampleScenario.java
b/examples/shardingsphere-example-generator/src/main/java/org/apache/shardingsphere/example/generator/scenario/ExampleScenario.java
index 974312cb1ff..e3c6750c31f 100644
---
a/examples/shardingsphere-example-generator/src/main/java/org/apache/shardingsphere/example/generator/scenario/ExampleScenario.java
+++
b/examples/shardingsphere-example-generator/src/main/java/org/apache/shardingsphere/example/generator/scenario/ExampleScenario.java
@@ -17,6 +17,7 @@
package org.apache.shardingsphere.example.generator.scenario;
+import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI;
import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI;
import java.util.Collection;
@@ -25,6 +26,7 @@ import java.util.Map;
/**
* Example scenario.
*/
+@SingletonSPI
public interface ExampleScenario extends TypedSPI {
/**
diff --git
a/kernel/authority/core/src/test/java/org/apache/shardingsphere/authority/provider/schema/DatabasePermittedPrivilegesProviderTest.java
b/kernel/authority/core/src/test/java/org/apache/shardingsphere/authority/provider/schema/DatabasePermittedAuthorityRegistryProviderTest.java
similarity index 97%
rename from
kernel/authority/core/src/test/java/org/apache/shardingsphere/authority/provider/schema/DatabasePermittedPrivilegesProviderTest.java
rename to
kernel/authority/core/src/test/java/org/apache/shardingsphere/authority/provider/schema/DatabasePermittedAuthorityRegistryProviderTest.java
index 30be983d616..bbd41bbb5d6 100644
---
a/kernel/authority/core/src/test/java/org/apache/shardingsphere/authority/provider/schema/DatabasePermittedPrivilegesProviderTest.java
+++
b/kernel/authority/core/src/test/java/org/apache/shardingsphere/authority/provider/schema/DatabasePermittedAuthorityRegistryProviderTest.java
@@ -34,7 +34,7 @@ import java.util.Properties;
import static org.junit.jupiter.api.Assertions.assertTrue;
-class DatabasePermittedPrivilegesProviderTest {
+class DatabasePermittedAuthorityRegistryProviderTest {
@Test
void assertBuildAuthorityRegistry() {
diff --git
a/parser/sql/spi/src/main/java/org/apache/shardingsphere/sql/parser/spi/SQLParserFacade.java
b/parser/sql/spi/src/main/java/org/apache/shardingsphere/sql/parser/spi/SQLParserFacade.java
index 6b0cd03e0fa..a352f7c6b7f 100644
---
a/parser/sql/spi/src/main/java/org/apache/shardingsphere/sql/parser/spi/SQLParserFacade.java
+++
b/parser/sql/spi/src/main/java/org/apache/shardingsphere/sql/parser/spi/SQLParserFacade.java
@@ -17,6 +17,7 @@
package org.apache.shardingsphere.sql.parser.spi;
+import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI;
import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI;
import org.apache.shardingsphere.sql.parser.api.parser.SQLLexer;
import org.apache.shardingsphere.sql.parser.api.parser.SQLParser;
@@ -24,6 +25,7 @@ import
org.apache.shardingsphere.sql.parser.api.parser.SQLParser;
/**
* SQL parser facade.
*/
+@SingletonSPI
public interface SQLParserFacade extends TypedSPI {
/**
diff --git
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/lock/spi/ClusterLockStrategy.java
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/lock/spi/ClusterLockStrategy.java
index 1f6ea1a07f8..5cd8ca05c0d 100644
---
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/lock/spi/ClusterLockStrategy.java
+++
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/lock/spi/ClusterLockStrategy.java
@@ -17,11 +17,13 @@
package org.apache.shardingsphere.proxy.backend.lock.spi;
+import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI;
import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI;
/**
* Cluster lock strategy.
*/
+@SingletonSPI
public interface ClusterLockStrategy extends TypedSPI {
/**
diff --git
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/external/result/SQLParseResultReporterCreator.java
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/external/result/SQLParseResultReporterCreator.java
index f78f1babb35..a2e511c50ff 100644
---
a/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/external/result/SQLParseResultReporterCreator.java
+++
b/test/it/parser/src/main/java/org/apache/shardingsphere/test/it/sql/parser/external/result/SQLParseResultReporterCreator.java
@@ -17,11 +17,13 @@
package org.apache.shardingsphere.test.it.sql.parser.external.result;
+import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI;
import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI;
/**
* SQL parse result reporter creator.
*/
+@SingletonSPI
public interface SQLParseResultReporterCreator extends TypedSPI {
/**