defaultConvert
This commit is contained in:
@@ -6,6 +6,8 @@ import java.util.*;
|
|||||||
import org.redkale.annotation.AutoLoad;
|
import org.redkale.annotation.AutoLoad;
|
||||||
import org.redkale.annotation.ResourceChanged;
|
import org.redkale.annotation.ResourceChanged;
|
||||||
import org.redkale.annotation.ResourceType;
|
import org.redkale.annotation.ResourceType;
|
||||||
|
import org.redkale.convert.json.JsonConvert;
|
||||||
|
import org.redkale.convert.json.JsonFactory;
|
||||||
import org.redkale.inject.Resourcable;
|
import org.redkale.inject.Resourcable;
|
||||||
import org.redkale.inject.ResourceEvent;
|
import org.redkale.inject.ResourceEvent;
|
||||||
import org.redkale.inject.ResourceFactory;
|
import org.redkale.inject.ResourceFactory;
|
||||||
@@ -56,6 +58,9 @@ public abstract class AbstractCacheSource extends AbstractService implements Cac
|
|||||||
// @since 2.8.0 //是否非阻塞式
|
// @since 2.8.0 //是否非阻塞式
|
||||||
public static final String CACHE_SOURCE_NON_BLOCKING = "non-blocking";
|
public static final String CACHE_SOURCE_NON_BLOCKING = "non-blocking";
|
||||||
|
|
||||||
|
protected static final JsonConvert defaultConvert =
|
||||||
|
JsonFactory.create().skipAllIgnore(true).getConvert();
|
||||||
|
|
||||||
@ResourceChanged
|
@ResourceChanged
|
||||||
public abstract void onResourceChange(ResourceEvent[] events);
|
public abstract void onResourceChange(ResourceEvent[] events);
|
||||||
|
|
||||||
|
|||||||
@@ -39,9 +39,6 @@ import org.redkale.util.*;
|
|||||||
@ResourceType(CacheSource.class)
|
@ResourceType(CacheSource.class)
|
||||||
public final class CacheMemorySource extends AbstractCacheSource {
|
public final class CacheMemorySource extends AbstractCacheSource {
|
||||||
|
|
||||||
@Resource(required = false)
|
|
||||||
private JsonConvert defaultConvert = JsonConvert.root();
|
|
||||||
|
|
||||||
@Resource(name = Resource.PARENT_NAME + "_convert", required = false)
|
@Resource(name = Resource.PARENT_NAME + "_convert", required = false)
|
||||||
private JsonConvert convert;
|
private JsonConvert convert;
|
||||||
|
|
||||||
@@ -127,10 +124,7 @@ public final class CacheMemorySource extends AbstractCacheSource {
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void init(AnyValue conf) {
|
public void init(AnyValue conf) {
|
||||||
if (this.convert == null) {
|
if (this.convert == null) {
|
||||||
this.convert = this.defaultConvert;
|
this.convert = defaultConvert;
|
||||||
}
|
|
||||||
if (this.convert == null) {
|
|
||||||
this.convert = JsonConvert.root();
|
|
||||||
}
|
}
|
||||||
final CacheMemorySource self = this;
|
final CacheMemorySource self = this;
|
||||||
AnyValue prop = conf == null ? null : conf.getAnyValue("properties");
|
AnyValue prop = conf == null ? null : conf.getAnyValue("properties");
|
||||||
|
|||||||
Reference in New Issue
Block a user