优化命名
This commit is contained in:
@@ -31,7 +31,7 @@ import org.redkale.mq.*;
|
||||
import org.redkale.net.*;
|
||||
import org.redkale.net.http.*;
|
||||
import org.redkale.net.sncp.*;
|
||||
import org.redkale.scheduling.ScheduledFactory;
|
||||
import org.redkale.scheduling.ScheduleFactory;
|
||||
import org.redkale.service.Service;
|
||||
import org.redkale.source.*;
|
||||
import org.redkale.util.*;
|
||||
@@ -209,7 +209,7 @@ public final class Application {
|
||||
final ResourceFactory resourceFactory = ResourceFactory.create();
|
||||
|
||||
//全局ScheduledFactory
|
||||
private final ScheduledFactory scheduledFactory;
|
||||
private final ScheduleFactory scheduledFactory;
|
||||
|
||||
//服务配置项
|
||||
final AnyValue config;
|
||||
@@ -626,7 +626,7 @@ public final class Application {
|
||||
}
|
||||
|
||||
{ //设置ScheduledFactory
|
||||
this.scheduledFactory = ScheduledFactory.create(this::getPropertyValue).disable(isCompileMode());
|
||||
this.scheduledFactory = ScheduleFactory.create(this::getPropertyValue).disable(isCompileMode());
|
||||
}
|
||||
|
||||
{ //加载原生sql解析器
|
||||
|
||||
@@ -11,17 +11,17 @@ import org.redkale.source.CacheSource;
|
||||
*
|
||||
* @author zhangjx
|
||||
*/
|
||||
public class CachedFactory {
|
||||
public class CacheFactory {
|
||||
|
||||
protected CacheSource localSource = new CacheMemorySource("cacheing");
|
||||
protected CacheSource localSource = new CacheMemorySource("caching");
|
||||
|
||||
protected CacheSource remoteSource;
|
||||
|
||||
protected CachedFactory(CacheSource remoteSource) {
|
||||
protected CacheFactory(CacheSource remoteSource) {
|
||||
this.remoteSource = remoteSource;
|
||||
}
|
||||
|
||||
public static CachedFactory create(CacheSource remoteSource) {
|
||||
return new CachedFactory(remoteSource);
|
||||
public static CacheFactory create(CacheSource remoteSource) {
|
||||
return new CacheFactory(remoteSource);
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,7 @@ import org.redkale.annotation.Scheduling;
|
||||
* @author zhangjx
|
||||
* @since 2.8.0
|
||||
*/
|
||||
public class ScheduledFactory {
|
||||
public class ScheduleFactory {
|
||||
|
||||
protected final Logger logger = Logger.getLogger(this.getClass().getSimpleName());
|
||||
|
||||
@@ -55,17 +55,17 @@ public class ScheduledFactory {
|
||||
|
||||
private boolean disable;
|
||||
|
||||
protected ScheduledFactory(UnaryOperator<String> propertyFunc) {
|
||||
protected ScheduleFactory(UnaryOperator<String> propertyFunc) {
|
||||
this.propertyFunc = propertyFunc;
|
||||
this.scheduler = new ScheduledThreadPoolExecutor(Utility.cpus(), Utility.newThreadFactory("Scheduled-Task-Thread-%s"));
|
||||
this.scheduler.setRemoveOnCancelPolicy(true);
|
||||
}
|
||||
|
||||
public static ScheduledFactory create(UnaryOperator<String> propertyFunc) {
|
||||
return new ScheduledFactory(propertyFunc);
|
||||
public static ScheduleFactory create(UnaryOperator<String> propertyFunc) {
|
||||
return new ScheduleFactory(propertyFunc);
|
||||
}
|
||||
|
||||
public ScheduledFactory disable(boolean val) {
|
||||
public ScheduleFactory disable(boolean val) {
|
||||
this.disable = val;
|
||||
return this;
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
package org.redkale.test.scheduling;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.redkale.scheduling.ScheduledFactory;
|
||||
import org.redkale.scheduling.ScheduleFactory;
|
||||
import org.redkale.util.Utility;
|
||||
|
||||
/**
|
||||
@@ -20,7 +20,7 @@ public class ScheduleTest {
|
||||
|
||||
@Test
|
||||
public void run() throws Exception {
|
||||
ScheduledFactory factory = ScheduledFactory.create(null);
|
||||
ScheduleFactory factory = ScheduleFactory.create(null);
|
||||
ScheduleService service = new ScheduleService();
|
||||
factory.schedule(service);
|
||||
Utility.sleep(3000);
|
||||
|
||||
Reference in New Issue
Block a user