提交 a8803f49 编写于 作者: C cherrylzhao

using implement scenario to declaration.

上级 6509b600
......@@ -19,7 +19,6 @@ package io.shardingsphere.example.jdbc.nodep;
import io.shardingsphere.example.jdbc.nodep.factory.CommonServiceFactory;
import io.shardingsphere.example.repository.api.senario.CommonServiceScenario;
import io.shardingsphere.example.repository.api.senario.Scenario;
import io.shardingsphere.example.type.ShardingType;
import java.sql.SQLException;
......@@ -36,7 +35,7 @@ public class JavaConfigurationExample {
// private static ShardingType type = ShardingType.SHARDING_MASTER_SLAVE;
public static void main(final String[] args) throws SQLException {
Scenario scenario = new CommonServiceScenario(CommonServiceFactory.newInstance(type));
CommonServiceScenario scenario = new CommonServiceScenario(CommonServiceFactory.newInstance(type));
scenario.executeShardingCRUDSuccess();
}
}
......@@ -20,6 +20,7 @@ package io.shardingsphere.example.jdbc.nodep;
import io.shardingsphere.example.jdbc.nodep.factory.CommonTransactionServiceFactory;
import io.shardingsphere.example.repository.api.senario.Scenario;
import io.shardingsphere.example.repository.api.senario.TransactionServiceScenario;
import io.shardingsphere.example.repository.api.service.TransactionService;
import io.shardingsphere.example.type.ShardingType;
import java.sql.SQLException;
......@@ -38,7 +39,7 @@ public class JavaConfigurationTransactionExample {
// private static boolean isRangeSharding = true;
public static void main(final String[] args) throws SQLException {
Scenario scenario = new TransactionServiceScenario(CommonTransactionServiceFactory.newInstance(type));
TransactionServiceScenario scenario = new TransactionServiceScenario(CommonTransactionServiceFactory.newInstance(type));
scenario.executeShardingCRUDSuccess();
scenario.executeShardingCRUDFailure();
}
......
......@@ -37,7 +37,7 @@ public class YamlConfigurationExample {
// private static ShardingType type = ShardingType.SHARDING_MASTER_SLAVE;
public static void main(final String[] args) throws SQLException, IOException {
Scenario scenario = new CommonServiceScenario(YamlCommonServiceFactory.newInstance(type));
CommonServiceScenario scenario = new CommonServiceScenario(YamlCommonServiceFactory.newInstance(type));
scenario.executeShardingCRUDSuccess();
}
}
......@@ -37,7 +37,7 @@ public class YamlConfigurationTransactionExample {
// private static ShardingType type = ShardingType.SHARDING_MASTER_SLAVE;
public static void main(final String[] args) throws SQLException, IOException {
Scenario scenario = new TransactionServiceScenario(YamlCommonTransactionServiceFactory.newInstance(type));
TransactionServiceScenario scenario = new TransactionServiceScenario(YamlCommonTransactionServiceFactory.newInstance(type));
scenario.executeShardingCRUDSuccess();
scenario.executeShardingCRUDFailure();
}
......
......@@ -20,6 +20,7 @@ package io.shardingsphere.example.jdbc.orche;
import io.shardingsphere.example.jdbc.orche.factory.CommonTransactionServiceFactory;
import io.shardingsphere.example.repository.api.senario.Scenario;
import io.shardingsphere.example.repository.api.senario.TransactionServiceScenario;
import io.shardingsphere.example.repository.api.service.TransactionService;
import io.shardingsphere.example.type.RegistryCenterType;
import io.shardingsphere.example.type.ShardingType;
......@@ -43,7 +44,8 @@ public class JavaConfigurationTransactionExample {
// private static boolean loadConfigFromRegCenter = true;
public static void main(final String[] args) throws Exception {
Scenario scenario = new TransactionServiceScenario(CommonTransactionServiceFactory.newInstance(shardingType, registryCenterType, loadConfigFromRegCenter));
TransactionService transactionService = CommonTransactionServiceFactory.newInstance(shardingType, registryCenterType, loadConfigFromRegCenter);
TransactionServiceScenario scenario = new TransactionServiceScenario(transactionService);
scenario.executeShardingCRUDSuccess();
scenario.executeShardingCRUDFailure();
}
......
......@@ -18,8 +18,8 @@
package io.shardingsphere.example.jdbc.orche;
import io.shardingsphere.example.jdbc.orche.factory.YamlCommonTransactionServiceFactory;
import io.shardingsphere.example.repository.api.senario.Scenario;
import io.shardingsphere.example.repository.api.senario.TransactionServiceScenario;
import io.shardingsphere.example.repository.api.service.TransactionService;
import io.shardingsphere.example.type.RegistryCenterType;
import io.shardingsphere.example.type.ShardingType;
......@@ -43,7 +43,8 @@ public class YamlConfigurationTransactionExample {
// private static boolean loadConfigFromRegCenter = true;
public static void main(final String[] args) throws Exception {
Scenario scenario = new TransactionServiceScenario(YamlCommonTransactionServiceFactory.newInstance(shardingType, registryCenterType, loadConfigFromRegCenter));
TransactionService transactionService = YamlCommonTransactionServiceFactory.newInstance(shardingType, registryCenterType, loadConfigFromRegCenter);
TransactionServiceScenario scenario = new TransactionServiceScenario(transactionService);
scenario.executeShardingCRUDSuccess();
scenario.executeShardingCRUDFailure();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册