优化包名
This commit is contained in:
@@ -18,7 +18,6 @@ module org.redkale {
|
||||
exports org.redkale.boot;
|
||||
exports org.redkale.boot.watch;
|
||||
exports org.redkale.cache;
|
||||
exports org.redkale.cache.support;
|
||||
exports org.redkale.cluster;
|
||||
exports org.redkale.convert;
|
||||
exports org.redkale.convert.bson;
|
||||
@@ -34,7 +33,6 @@ module org.redkale {
|
||||
exports org.redkale.net.sncp;
|
||||
exports org.redkale.persistence;
|
||||
exports org.redkale.schedule;
|
||||
exports org.redkale.schedule.support;
|
||||
exports org.redkale.service;
|
||||
exports org.redkale.source;
|
||||
exports org.redkale.util;
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.logging.*;
|
||||
import org.redkale.annotation.Nonnull;
|
||||
import org.redkale.annotation.Resource;
|
||||
import org.redkale.boot.ClassFilter.FilterEntry;
|
||||
import org.redkale.cache.support.CacheModuleEngine;
|
||||
import org.redkale.cache.CacheModuleEngine;
|
||||
import org.redkale.cluster.*;
|
||||
import org.redkale.convert.Convert;
|
||||
import org.redkale.convert.bson.BsonFactory;
|
||||
@@ -35,7 +35,7 @@ import org.redkale.mq.*;
|
||||
import org.redkale.net.*;
|
||||
import org.redkale.net.http.*;
|
||||
import org.redkale.net.sncp.*;
|
||||
import org.redkale.schedule.support.ScheduleModuleEngine;
|
||||
import org.redkale.schedule.ScheduleModuleEngine;
|
||||
import org.redkale.service.Service;
|
||||
import org.redkale.source.*;
|
||||
import org.redkale.util.*;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
*
|
||||
*/
|
||||
package org.redkale.cache.support;
|
||||
package org.redkale.cache;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
*
|
||||
*/
|
||||
package org.redkale.cache.support;
|
||||
package org.redkale.cache;
|
||||
|
||||
import org.redkale.convert.ConvertColumn;
|
||||
import org.redkale.convert.ConvertDisabled;
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
*
|
||||
*/
|
||||
package org.redkale.cache.support;
|
||||
package org.redkale.cache;
|
||||
|
||||
import org.redkale.boot.Application;
|
||||
import org.redkale.boot.ModuleEngine;
|
||||
@@ -15,7 +15,7 @@ import org.redkale.util.AnyValue;
|
||||
public class CacheModuleEngine extends ModuleEngine {
|
||||
|
||||
//全局缓存管理器
|
||||
private CacheManagerService cacheManager;
|
||||
private DefaultCacheManager cacheManager;
|
||||
|
||||
public CacheModuleEngine(Application application) {
|
||||
super(application);
|
||||
@@ -44,7 +44,7 @@ public class CacheModuleEngine extends ModuleEngine {
|
||||
*/
|
||||
public void onAppPostInit() {
|
||||
//设置缓存管理器
|
||||
this.cacheManager = CacheManagerService.create(null).enabled(false);
|
||||
this.cacheManager = DefaultCacheManager.create(null).enabled(false);
|
||||
final AnyValue cacheConf = application.getAppConfig().getAnyValue("cache");
|
||||
if (cacheConf != null && !application.isCompileMode()) {
|
||||
this.resourceFactory.inject(this.cacheManager);
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
*
|
||||
*/
|
||||
package org.redkale.cache.support;
|
||||
package org.redkale.cache;
|
||||
|
||||
import java.time.Duration;
|
||||
import org.redkale.convert.ConvertColumn;
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
*
|
||||
*/
|
||||
package org.redkale.cache.support;
|
||||
package org.redkale.cache;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.time.Duration;
|
||||
@@ -40,7 +40,7 @@ import org.redkale.util.Utility;
|
||||
@Component
|
||||
@AutoLoad(false)
|
||||
@ResourceType(CacheManager.class)
|
||||
public class CacheManagerService implements CacheManager, Service {
|
||||
public class DefaultCacheManager implements CacheManager, Service {
|
||||
|
||||
//是否开启缓存
|
||||
protected boolean enabled = true;
|
||||
@@ -69,20 +69,20 @@ public class CacheManagerService implements CacheManager, Service {
|
||||
//远程缓存Source
|
||||
protected CacheSource remoteSource;
|
||||
|
||||
protected CacheManagerService(@Nullable CacheSource remoteSource) {
|
||||
protected DefaultCacheManager(@Nullable CacheSource remoteSource) {
|
||||
this.remoteSource = remoteSource;
|
||||
}
|
||||
|
||||
//一般用于独立组件
|
||||
public static CacheManagerService create(@Nullable CacheSource remoteSource) {
|
||||
return new CacheManagerService(remoteSource);
|
||||
public static DefaultCacheManager create(@Nullable CacheSource remoteSource) {
|
||||
return new DefaultCacheManager(remoteSource);
|
||||
}
|
||||
|
||||
public boolean enabled() {
|
||||
return this.enabled;
|
||||
}
|
||||
|
||||
public CacheManagerService enabled(boolean val) {
|
||||
public DefaultCacheManager enabled(boolean val) {
|
||||
this.enabled = val;
|
||||
return this;
|
||||
}
|
||||
@@ -123,7 +123,7 @@ public class CacheManagerService implements CacheManager, Service {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public CacheManagerService addHash(String hash) {
|
||||
public DefaultCacheManager addHash(String hash) {
|
||||
this.hashNames.add(hash);
|
||||
return this;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
*
|
||||
*/
|
||||
package org.redkale.schedule.support;
|
||||
package org.redkale.schedule;
|
||||
|
||||
import java.time.DateTimeException;
|
||||
import java.time.temporal.ChronoField;
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
*
|
||||
*/
|
||||
package org.redkale.schedule.support;
|
||||
package org.redkale.schedule;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
@@ -54,7 +54,7 @@ import org.redkale.util.Utility;
|
||||
@Component
|
||||
@AutoLoad(false)
|
||||
@ResourceType(ScheduleManager.class)
|
||||
public class ScheduleManagerService implements ScheduleManager, Service {
|
||||
public class DefaultScheduleManager implements ScheduleManager, Service {
|
||||
|
||||
protected final Logger logger = Logger.getLogger(this.getClass().getSimpleName());
|
||||
|
||||
@@ -76,20 +76,20 @@ public class ScheduleManagerService implements ScheduleManager, Service {
|
||||
|
||||
private AnyValue config;
|
||||
|
||||
protected ScheduleManagerService(UnaryOperator<String> propertyFunc) {
|
||||
protected DefaultScheduleManager(UnaryOperator<String> propertyFunc) {
|
||||
this.propertyFunc = propertyFunc;
|
||||
}
|
||||
|
||||
//一般用于独立组件
|
||||
public static ScheduleManagerService create(UnaryOperator<String> propertyFunc) {
|
||||
return new ScheduleManagerService(propertyFunc);
|
||||
public static DefaultScheduleManager create(UnaryOperator<String> propertyFunc) {
|
||||
return new DefaultScheduleManager(propertyFunc);
|
||||
}
|
||||
|
||||
public boolean enabled() {
|
||||
return this.enabled;
|
||||
}
|
||||
|
||||
public ScheduleManagerService enabled(boolean val) {
|
||||
public DefaultScheduleManager enabled(boolean val) {
|
||||
this.enabled = val;
|
||||
return this;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
*
|
||||
*/
|
||||
package org.redkale.schedule.support;
|
||||
package org.redkale.schedule;
|
||||
|
||||
import org.redkale.boot.Application;
|
||||
import org.redkale.boot.ModuleEngine;
|
||||
@@ -16,7 +16,7 @@ import org.redkale.util.AnyValue;
|
||||
public class ScheduleModuleEngine extends ModuleEngine {
|
||||
|
||||
//全局定时任务管理器
|
||||
private ScheduleManagerService scheduleManager;
|
||||
private DefaultScheduleManager scheduleManager;
|
||||
|
||||
public ScheduleModuleEngine(Application application) {
|
||||
super(application);
|
||||
@@ -45,7 +45,7 @@ public class ScheduleModuleEngine extends ModuleEngine {
|
||||
*/
|
||||
public void onAppPostInit() {
|
||||
//设置定时管理器
|
||||
this.scheduleManager = ScheduleManagerService.create(null).enabled(false);
|
||||
this.scheduleManager = DefaultScheduleManager.create(null).enabled(false);
|
||||
final AnyValue scheduleConf = application.getAppConfig().getAnyValue("schedule");
|
||||
if (scheduleConf != null && !application.isCompileMode()) {
|
||||
this.resourceFactory.inject(this.scheduleManager);
|
||||
@@ -48,7 +48,6 @@ public class RedkaleClassLoader extends URLClassLoader {
|
||||
"org.redkale.boot",
|
||||
"org.redkale.boot.watch",
|
||||
"org.redkale.cache",
|
||||
"org.redkale.cache.support",
|
||||
"org.redkale.cluster",
|
||||
"org.redkale.convert",
|
||||
"org.redkale.convert.bson",
|
||||
@@ -64,7 +63,6 @@ public class RedkaleClassLoader extends URLClassLoader {
|
||||
"org.redkale.net.sncp",
|
||||
"org.redkale.persistence",
|
||||
"org.redkale.schedule",
|
||||
"org.redkale.schedule.support",
|
||||
"org.redkale.service",
|
||||
"org.redkale.source",
|
||||
"org.redkale.util",
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.time.Duration;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import org.junit.jupiter.api.*;
|
||||
import org.redkale.cache.support.CacheManagerService;
|
||||
import org.redkale.cache.DefaultCacheManager;
|
||||
import org.redkale.convert.json.JsonConvert;
|
||||
import org.redkale.source.CacheMemorySource;
|
||||
import org.redkale.util.Utility;
|
||||
@@ -18,7 +18,7 @@ import org.redkale.util.Utility;
|
||||
*/
|
||||
public class CacheManagerTest {
|
||||
|
||||
private static CacheManagerService manager;
|
||||
private static DefaultCacheManager manager;
|
||||
|
||||
public static void main(String[] args) throws Throwable {
|
||||
CacheManagerTest test = new CacheManagerTest();
|
||||
@@ -31,7 +31,7 @@ public class CacheManagerTest {
|
||||
public static void init() throws Exception {
|
||||
CacheMemorySource remoteSource = new CacheMemorySource("cache-remote");
|
||||
remoteSource.init(null);
|
||||
manager = CacheManagerService.create(remoteSource);
|
||||
manager = DefaultCacheManager.create(remoteSource);
|
||||
manager.init(null);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
package org.redkale.test.schedule;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.redkale.schedule.support.ScheduleManagerService;
|
||||
import org.redkale.schedule.DefaultScheduleManager;
|
||||
import org.redkale.util.Utility;
|
||||
|
||||
/**
|
||||
@@ -20,7 +20,7 @@ public class SchedulingTest {
|
||||
|
||||
@Test
|
||||
public void run() throws Exception {
|
||||
ScheduleManagerService manager = ScheduleManagerService.create(null);
|
||||
DefaultScheduleManager manager = DefaultScheduleManager.create(null);
|
||||
manager.init(null);
|
||||
ScheduleService service = new ScheduleService();
|
||||
manager.schedule(service);
|
||||
|
||||
Reference in New Issue
Block a user