优化包名

This commit is contained in:
redkale
2023-12-19 00:02:09 +08:00
parent d971fe94ee
commit 1a49db8a1b
13 changed files with 30 additions and 34 deletions

View File

@@ -18,7 +18,6 @@ module org.redkale {
exports org.redkale.boot; exports org.redkale.boot;
exports org.redkale.boot.watch; exports org.redkale.boot.watch;
exports org.redkale.cache; exports org.redkale.cache;
exports org.redkale.cache.support;
exports org.redkale.cluster; exports org.redkale.cluster;
exports org.redkale.convert; exports org.redkale.convert;
exports org.redkale.convert.bson; exports org.redkale.convert.bson;
@@ -34,7 +33,6 @@ module org.redkale {
exports org.redkale.net.sncp; exports org.redkale.net.sncp;
exports org.redkale.persistence; exports org.redkale.persistence;
exports org.redkale.schedule; exports org.redkale.schedule;
exports org.redkale.schedule.support;
exports org.redkale.service; exports org.redkale.service;
exports org.redkale.source; exports org.redkale.source;
exports org.redkale.util; exports org.redkale.util;

View File

@@ -22,7 +22,7 @@ import java.util.logging.*;
import org.redkale.annotation.Nonnull; import org.redkale.annotation.Nonnull;
import org.redkale.annotation.Resource; import org.redkale.annotation.Resource;
import org.redkale.boot.ClassFilter.FilterEntry; import org.redkale.boot.ClassFilter.FilterEntry;
import org.redkale.cache.support.CacheModuleEngine; import org.redkale.cache.CacheModuleEngine;
import org.redkale.cluster.*; import org.redkale.cluster.*;
import org.redkale.convert.Convert; import org.redkale.convert.Convert;
import org.redkale.convert.bson.BsonFactory; import org.redkale.convert.bson.BsonFactory;
@@ -35,7 +35,7 @@ import org.redkale.mq.*;
import org.redkale.net.*; import org.redkale.net.*;
import org.redkale.net.http.*; import org.redkale.net.http.*;
import org.redkale.net.sncp.*; import org.redkale.net.sncp.*;
import org.redkale.schedule.support.ScheduleModuleEngine; import org.redkale.schedule.ScheduleModuleEngine;
import org.redkale.service.Service; import org.redkale.service.Service;
import org.redkale.source.*; import org.redkale.source.*;
import org.redkale.util.*; import org.redkale.util.*;

View File

@@ -1,7 +1,7 @@
/* /*
* *
*/ */
package org.redkale.cache.support; package org.redkale.cache;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;

View File

@@ -1,7 +1,7 @@
/* /*
* *
*/ */
package org.redkale.cache.support; package org.redkale.cache;
import org.redkale.convert.ConvertColumn; import org.redkale.convert.ConvertColumn;
import org.redkale.convert.ConvertDisabled; import org.redkale.convert.ConvertDisabled;

View File

@@ -1,7 +1,7 @@
/* /*
* *
*/ */
package org.redkale.cache.support; package org.redkale.cache;
import org.redkale.boot.Application; import org.redkale.boot.Application;
import org.redkale.boot.ModuleEngine; import org.redkale.boot.ModuleEngine;
@@ -15,7 +15,7 @@ import org.redkale.util.AnyValue;
public class CacheModuleEngine extends ModuleEngine { public class CacheModuleEngine extends ModuleEngine {
//全局缓存管理器 //全局缓存管理器
private CacheManagerService cacheManager; private DefaultCacheManager cacheManager;
public CacheModuleEngine(Application application) { public CacheModuleEngine(Application application) {
super(application); super(application);
@@ -44,7 +44,7 @@ public class CacheModuleEngine extends ModuleEngine {
*/ */
public void onAppPostInit() { public void onAppPostInit() {
//设置缓存管理器 //设置缓存管理器
this.cacheManager = CacheManagerService.create(null).enabled(false); this.cacheManager = DefaultCacheManager.create(null).enabled(false);
final AnyValue cacheConf = application.getAppConfig().getAnyValue("cache"); final AnyValue cacheConf = application.getAppConfig().getAnyValue("cache");
if (cacheConf != null && !application.isCompileMode()) { if (cacheConf != null && !application.isCompileMode()) {
this.resourceFactory.inject(this.cacheManager); this.resourceFactory.inject(this.cacheManager);

View File

@@ -1,7 +1,7 @@
/* /*
* *
*/ */
package org.redkale.cache.support; package org.redkale.cache;
import java.time.Duration; import java.time.Duration;
import org.redkale.convert.ConvertColumn; import org.redkale.convert.ConvertColumn;

View File

@@ -1,7 +1,7 @@
/* /*
* *
*/ */
package org.redkale.cache.support; package org.redkale.cache;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import java.time.Duration; import java.time.Duration;
@@ -40,7 +40,7 @@ import org.redkale.util.Utility;
@Component @Component
@AutoLoad(false) @AutoLoad(false)
@ResourceType(CacheManager.class) @ResourceType(CacheManager.class)
public class CacheManagerService implements CacheManager, Service { public class DefaultCacheManager implements CacheManager, Service {
//是否开启缓存 //是否开启缓存
protected boolean enabled = true; protected boolean enabled = true;
@@ -69,20 +69,20 @@ public class CacheManagerService implements CacheManager, Service {
//远程缓存Source //远程缓存Source
protected CacheSource remoteSource; protected CacheSource remoteSource;
protected CacheManagerService(@Nullable CacheSource remoteSource) { protected DefaultCacheManager(@Nullable CacheSource remoteSource) {
this.remoteSource = remoteSource; this.remoteSource = remoteSource;
} }
//一般用于独立组件 //一般用于独立组件
public static CacheManagerService create(@Nullable CacheSource remoteSource) { public static DefaultCacheManager create(@Nullable CacheSource remoteSource) {
return new CacheManagerService(remoteSource); return new DefaultCacheManager(remoteSource);
} }
public boolean enabled() { public boolean enabled() {
return this.enabled; return this.enabled;
} }
public CacheManagerService enabled(boolean val) { public DefaultCacheManager enabled(boolean val) {
this.enabled = val; this.enabled = val;
return this; return this;
} }
@@ -123,7 +123,7 @@ public class CacheManagerService implements CacheManager, Service {
return enabled; return enabled;
} }
public CacheManagerService addHash(String hash) { public DefaultCacheManager addHash(String hash) {
this.hashNames.add(hash); this.hashNames.add(hash);
return this; return this;
} }

View File

@@ -1,7 +1,7 @@
/* /*
* *
*/ */
package org.redkale.schedule.support; package org.redkale.schedule;
import java.time.DateTimeException; import java.time.DateTimeException;
import java.time.temporal.ChronoField; import java.time.temporal.ChronoField;

View File

@@ -1,7 +1,7 @@
/* /*
* *
*/ */
package org.redkale.schedule.support; package org.redkale.schedule;
import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodHandles;
@@ -54,7 +54,7 @@ import org.redkale.util.Utility;
@Component @Component
@AutoLoad(false) @AutoLoad(false)
@ResourceType(ScheduleManager.class) @ResourceType(ScheduleManager.class)
public class ScheduleManagerService implements ScheduleManager, Service { public class DefaultScheduleManager implements ScheduleManager, Service {
protected final Logger logger = Logger.getLogger(this.getClass().getSimpleName()); protected final Logger logger = Logger.getLogger(this.getClass().getSimpleName());
@@ -76,20 +76,20 @@ public class ScheduleManagerService implements ScheduleManager, Service {
private AnyValue config; private AnyValue config;
protected ScheduleManagerService(UnaryOperator<String> propertyFunc) { protected DefaultScheduleManager(UnaryOperator<String> propertyFunc) {
this.propertyFunc = propertyFunc; this.propertyFunc = propertyFunc;
} }
//一般用于独立组件 //一般用于独立组件
public static ScheduleManagerService create(UnaryOperator<String> propertyFunc) { public static DefaultScheduleManager create(UnaryOperator<String> propertyFunc) {
return new ScheduleManagerService(propertyFunc); return new DefaultScheduleManager(propertyFunc);
} }
public boolean enabled() { public boolean enabled() {
return this.enabled; return this.enabled;
} }
public ScheduleManagerService enabled(boolean val) { public DefaultScheduleManager enabled(boolean val) {
this.enabled = val; this.enabled = val;
return this; return this;
} }

View File

@@ -1,7 +1,7 @@
/* /*
* *
*/ */
package org.redkale.schedule.support; package org.redkale.schedule;
import org.redkale.boot.Application; import org.redkale.boot.Application;
import org.redkale.boot.ModuleEngine; import org.redkale.boot.ModuleEngine;
@@ -16,7 +16,7 @@ import org.redkale.util.AnyValue;
public class ScheduleModuleEngine extends ModuleEngine { public class ScheduleModuleEngine extends ModuleEngine {
//全局定时任务管理器 //全局定时任务管理器
private ScheduleManagerService scheduleManager; private DefaultScheduleManager scheduleManager;
public ScheduleModuleEngine(Application application) { public ScheduleModuleEngine(Application application) {
super(application); super(application);
@@ -45,7 +45,7 @@ public class ScheduleModuleEngine extends ModuleEngine {
*/ */
public void onAppPostInit() { public void onAppPostInit() {
//设置定时管理器 //设置定时管理器
this.scheduleManager = ScheduleManagerService.create(null).enabled(false); this.scheduleManager = DefaultScheduleManager.create(null).enabled(false);
final AnyValue scheduleConf = application.getAppConfig().getAnyValue("schedule"); final AnyValue scheduleConf = application.getAppConfig().getAnyValue("schedule");
if (scheduleConf != null && !application.isCompileMode()) { if (scheduleConf != null && !application.isCompileMode()) {
this.resourceFactory.inject(this.scheduleManager); this.resourceFactory.inject(this.scheduleManager);

View File

@@ -48,7 +48,6 @@ public class RedkaleClassLoader extends URLClassLoader {
"org.redkale.boot", "org.redkale.boot",
"org.redkale.boot.watch", "org.redkale.boot.watch",
"org.redkale.cache", "org.redkale.cache",
"org.redkale.cache.support",
"org.redkale.cluster", "org.redkale.cluster",
"org.redkale.convert", "org.redkale.convert",
"org.redkale.convert.bson", "org.redkale.convert.bson",
@@ -64,7 +63,6 @@ public class RedkaleClassLoader extends URLClassLoader {
"org.redkale.net.sncp", "org.redkale.net.sncp",
"org.redkale.persistence", "org.redkale.persistence",
"org.redkale.schedule", "org.redkale.schedule",
"org.redkale.schedule.support",
"org.redkale.service", "org.redkale.service",
"org.redkale.source", "org.redkale.source",
"org.redkale.util", "org.redkale.util",

View File

@@ -7,7 +7,7 @@ import java.time.Duration;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import org.junit.jupiter.api.*; 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.convert.json.JsonConvert;
import org.redkale.source.CacheMemorySource; import org.redkale.source.CacheMemorySource;
import org.redkale.util.Utility; import org.redkale.util.Utility;
@@ -18,7 +18,7 @@ import org.redkale.util.Utility;
*/ */
public class CacheManagerTest { public class CacheManagerTest {
private static CacheManagerService manager; private static DefaultCacheManager manager;
public static void main(String[] args) throws Throwable { public static void main(String[] args) throws Throwable {
CacheManagerTest test = new CacheManagerTest(); CacheManagerTest test = new CacheManagerTest();
@@ -31,7 +31,7 @@ public class CacheManagerTest {
public static void init() throws Exception { public static void init() throws Exception {
CacheMemorySource remoteSource = new CacheMemorySource("cache-remote"); CacheMemorySource remoteSource = new CacheMemorySource("cache-remote");
remoteSource.init(null); remoteSource.init(null);
manager = CacheManagerService.create(remoteSource); manager = DefaultCacheManager.create(remoteSource);
manager.init(null); manager.init(null);
} }

View File

@@ -4,7 +4,7 @@
package org.redkale.test.schedule; package org.redkale.test.schedule;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.redkale.schedule.support.ScheduleManagerService; import org.redkale.schedule.DefaultScheduleManager;
import org.redkale.util.Utility; import org.redkale.util.Utility;
/** /**
@@ -20,7 +20,7 @@ public class SchedulingTest {
@Test @Test
public void run() throws Exception { public void run() throws Exception {
ScheduleManagerService manager = ScheduleManagerService.create(null); DefaultScheduleManager manager = DefaultScheduleManager.create(null);
manager.init(null); manager.init(null);
ScheduleService service = new ScheduleService(); ScheduleService service = new ScheduleService();
manager.schedule(service); manager.schedule(service);