提交 b3c7c12e 编写于 作者: O o2null

Merge branch 'feature/数据中心应用缓存优化' into 'develop'

【平台】数据中心应用缓存优化

See merge request o2oa/o2oa!1455
......@@ -10,6 +10,7 @@ import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.query.core.entity.schema.Statement;
import com.x.query.core.entity.schema.Table;
import com.x.query.core.entity.wrap.*;
......@@ -158,21 +159,21 @@ class ActionCover extends BaseAction {
}
business.entityManagerContainer().commit();
if(!wi.getTableList().isEmpty()){
ApplicationCache.notify(Table.class);
ApplicationCache.notify(Statement.class);
CacheManager.notify(Table.class);
CacheManager.notify(Statement.class);
business.buildAllTable();
}else if(!wi.getStatementList().isEmpty()){
ApplicationCache.notify(Statement.class);
CacheManager.notify(Statement.class);
}
if(!wi.getViewList().isEmpty()){
ApplicationCache.notify(View.class);
CacheManager.notify(View.class);
}
if(!wi.getStatList().isEmpty()){
ApplicationCache.notify(Stat.class);
CacheManager.notify(Stat.class);
}
if(!wi.getRevealList().isEmpty()){
ApplicationCache.notify(Reveal.class);
CacheManager.notify(Reveal.class);
}
return query;
......
......@@ -8,6 +8,7 @@ import com.x.base.core.container.EntityManagerContainer;
import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.JpaObject;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -109,12 +110,12 @@ class ActionCreate extends BaseAction {
}
business.entityManagerContainer().commit();
if(!wi.getTableList().isEmpty()){
ApplicationCache.notify(Table.class);
ApplicationCache.notify(Statement.class);
CacheManager.notify(Table.class);
CacheManager.notify(Statement.class);
business.buildAllTable();
}else if(!wi.getStatementList().isEmpty()){
ApplicationCache.notify(Statement.class);
CacheManager.notify(Statement.class);
}
return query;
}
......
......@@ -7,7 +7,7 @@ import com.x.base.core.entity.JpaObject;
import com.x.base.core.entity.annotation.CheckPersistType;
import com.x.base.core.project.bean.WrapCopier;
import com.x.base.core.project.bean.WrapCopierFactory;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -25,7 +25,7 @@ class ActionCreateModel extends BaseAction {
Model model = Wi.copier.copy(wi);
emc.persist(model, CheckPersistType.all);
emc.commit();
ApplicationCache.notify(Model.class);
CacheManager.notify(Model.class);
Wo wo = new Wo();
wo.setId(model.getId());
result.setData(wo);
......
package com.x.query.assemble.designer.jaxrs.neural;
import com.x.base.core.project.cache.CacheManager;
import org.apache.commons.lang3.StringUtils;
import com.x.base.core.container.EntityManagerContainer;
......@@ -8,7 +9,6 @@ import com.x.base.core.entity.JpaObject;
import com.x.base.core.entity.annotation.CheckRemoveType;
import com.x.base.core.project.bean.WrapCopier;
import com.x.base.core.project.bean.WrapCopierFactory;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.exception.ExceptionEntityNotExist;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
......@@ -38,7 +38,7 @@ class ActionDeleteModel extends BaseAction {
emc.beginTransaction(Model.class);
emc.remove(model, CheckRemoveType.all);
emc.commit();
ApplicationCache.notify(Model.class);
CacheManager.notify(Model.class);
Wo wo = new Wo();
wo.setId(model.getId());
result.setData(wo);
......
......@@ -7,7 +7,7 @@ import com.x.base.core.entity.JpaObject;
import com.x.base.core.entity.annotation.CheckPersistType;
import com.x.base.core.project.bean.WrapCopier;
import com.x.base.core.project.bean.WrapCopierFactory;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.exception.ExceptionEntityNotExist;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
......@@ -31,7 +31,7 @@ class ActionUpdateModel extends BaseAction {
Wi.copier.copy(wi, model);
emc.check(model, CheckPersistType.all);
emc.commit();
ApplicationCache.notify(Model.class);
CacheManager.notify(Model.class);
Wo wo = new Wo();
wo.setId(model.getId());
result.setData(wo);
......
......@@ -16,8 +16,8 @@ import com.x.query.core.entity.View;
import com.x.query.core.entity.schema.Statement;
import com.x.query.core.entity.schema.Table;
import com.x.query.core.entity.wrap.*;
import net.sf.ehcache.Element;
import com.x.base.core.project.cache.Cache.CacheKey;
import com.x.base.core.project.cache.CacheManager;
class ActionSelect extends BaseAction {
......@@ -39,7 +39,8 @@ class ActionSelect extends BaseAction {
cacheObject.setName(query.getName());
cacheObject.setQuery(wrapQuery);
String flag = StringTools.uniqueToken();
this.cache.put(new Element(flag, cacheObject));
CacheKey cacheKey = new CacheKey(flag);
CacheManager.put(this.cache, cacheKey, cacheObject);
Wo wo = XGsonBuilder.convert(wrapQuery, Wo.class);
wo.setFlag(flag);
result.setData(wo);
......
......@@ -6,8 +6,9 @@ import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoFile;
import com.x.base.core.project.tools.DefaultCharset;
import net.sf.ehcache.Element;
import com.x.base.core.project.cache.Cache.CacheKey;
import com.x.base.core.project.cache.CacheManager;
import java.util.Optional;
class ActionSelectFile extends BaseAction {
......@@ -16,11 +17,12 @@ class ActionSelectFile extends BaseAction {
ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag) throws Exception {
try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
ActionResult<Wo> result = new ActionResult<>();
Element element = cache.get(flag);
if (null == element || null == element.getObjectValue()) {
CacheKey cacheKey = new CacheKey(flag);
Optional<?> optional = CacheManager.get(this.cache, cacheKey);
if (!optional.isPresent()) {
throw new ExceptionFlagNotExist(flag);
}
CacheObject cacheObject = (CacheObject) element.getObjectValue();
CacheObject cacheObject = (CacheObject) optional.get();
Wo wo = new Wo(gson.toJson(cacheObject.getQuery()).getBytes(DefaultCharset.name),
this.contentType(true, cacheObject.getName() + extension),
this.contentDisposition(true, cacheObject.getName() + extension));
......
package com.x.query.assemble.designer.jaxrs.output;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.jaxrs.StandardJaxrsAction;
import com.x.query.core.entity.wrap.WrapQuery;
import net.sf.ehcache.Ehcache;
import com.x.base.core.project.cache.Cache.CacheCategory;
abstract class BaseAction extends StandardJaxrsAction {
protected Ehcache cache = ApplicationCache.instance().getCache(CacheObject.class);
protected CacheCategory cache = new CacheCategory(CacheObject.class);
public static class CacheObject {
......
......@@ -2,6 +2,7 @@ package com.x.query.assemble.designer.jaxrs.query;
import java.util.Date;
import com.x.base.core.project.cache.CacheManager;
import org.apache.commons.lang3.StringUtils;
import com.google.gson.JsonElement;
......@@ -11,7 +12,6 @@ import com.x.base.core.entity.JpaObject;
import com.x.base.core.entity.annotation.CheckPersistType;
import com.x.base.core.project.bean.WrapCopier;
import com.x.base.core.project.bean.WrapCopierFactory;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -51,7 +51,7 @@ class ActionCreate extends BaseAction {
query.setLastUpdateTime(new Date());
emc.persist(query, CheckPersistType.all);
emc.commit();
ApplicationCache.notify(Query.class);
CacheManager.notify(Query.class);
Wo wo = new Wo();
wo.setId(query.getId());
result.setData(wo);
......
......@@ -11,7 +11,7 @@ import javax.persistence.criteria.Root;
import com.x.base.core.container.EntityManagerContainer;
import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.annotation.CheckRemoveType;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -61,10 +61,10 @@ class ActionDelete extends BaseAction {
emc.beginTransaction(Query.class);
emc.remove(query, CheckRemoveType.all);
emc.commit();
ApplicationCache.notify(View.class);
ApplicationCache.notify(Stat.class);
ApplicationCache.notify(Reveal.class);
ApplicationCache.notify(Query.class);
CacheManager.notify(View.class);
CacheManager.notify(Stat.class);
CacheManager.notify(Reveal.class);
CacheManager.notify(Query.class);
Wo wo = new Wo();
wo.setId(query.getId());
result.setData(wo);
......
......@@ -2,6 +2,7 @@ package com.x.query.assemble.designer.jaxrs.query;
import java.util.Date;
import com.x.base.core.project.cache.CacheManager;
import org.apache.commons.lang3.StringUtils;
import com.google.gson.JsonElement;
......@@ -11,7 +12,6 @@ import com.x.base.core.entity.JpaObject;
import com.x.base.core.entity.annotation.CheckPersistType;
import com.x.base.core.project.bean.WrapCopier;
import com.x.base.core.project.bean.WrapCopierFactory;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -52,7 +52,7 @@ class ActionEdit extends BaseAction {
query.setLastUpdateTime(new Date());
emc.check(query, CheckPersistType.all);
emc.commit();
ApplicationCache.notify(Query.class);
CacheManager.notify(Query.class);
Wo wo = new Wo();
wo.setId(query.getId());
result.setData(wo);
......
......@@ -6,13 +6,13 @@ import java.io.ByteArrayOutputStream;
import javax.imageio.ImageIO;
import com.x.base.core.project.cache.CacheManager;
import org.apache.commons.codec.binary.Base64;
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
import org.imgscalr.Scalr;
import com.x.base.core.container.EntityManagerContainer;
import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -46,7 +46,7 @@ class ActionSetIcon extends BaseAction {
query.setIcon(icon);
query.setIconHue(iconHue);
emc.commit();
ApplicationCache.notify(Query.class);
CacheManager.notify(Query.class);
Wo wo = new Wo();
wo.setId(query.getId());
result.setData(wo);
......
package com.x.query.assemble.designer.jaxrs.reveal;
import com.x.base.core.project.cache.CacheManager;
import org.apache.commons.lang3.StringUtils;
import com.google.gson.JsonElement;
......@@ -9,7 +10,6 @@ import com.x.base.core.entity.JpaObject;
import com.x.base.core.entity.annotation.CheckPersistType;
import com.x.base.core.project.bean.WrapCopier;
import com.x.base.core.project.bean.WrapCopierFactory;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -42,7 +42,7 @@ class ActionCreate extends BaseAction {
reveal.setQuery(query.getId());
emc.persist(reveal, CheckPersistType.all);
emc.commit();
ApplicationCache.notify(Reveal.class);
CacheManager.notify(Reveal.class);
Wo wo = new Wo();
wo.setId(reveal.getId());
result.setData(wo);
......
......@@ -3,7 +3,7 @@ package com.x.query.assemble.designer.jaxrs.reveal;
import com.x.base.core.container.EntityManagerContainer;
import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.annotation.CheckRemoveType;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -30,7 +30,7 @@ class ActionDelete extends BaseAction {
}
emc.remove(reveal, CheckRemoveType.all);
emc.commit();
ApplicationCache.notify(Reveal.class);
CacheManager.notify(Reveal.class);
Wo wo = new Wo();
wo.setId(reveal.getId());
result.setData(wo);
......
package com.x.query.assemble.designer.jaxrs.reveal;
import com.x.base.core.project.cache.CacheManager;
import org.apache.commons.lang3.StringUtils;
import com.google.gson.JsonElement;
......@@ -9,7 +10,6 @@ import com.x.base.core.entity.JpaObject;
import com.x.base.core.entity.annotation.CheckPersistType;
import com.x.base.core.project.bean.WrapCopier;
import com.x.base.core.project.bean.WrapCopierFactory;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -45,7 +45,7 @@ class ActionEdit extends BaseAction {
}
emc.check(reveal, CheckPersistType.all);
emc.commit();
ApplicationCache.notify(Reveal.class);
CacheManager.notify(Reveal.class);
Wo wo = new Wo();
wo.setId(reveal.getId());
result.setData(wo);
......
package com.x.query.assemble.designer.jaxrs.stat;
import com.x.base.core.project.cache.CacheManager;
import org.apache.commons.lang3.StringUtils;
import com.google.gson.JsonElement;
......@@ -50,7 +51,7 @@ class ActionCreate extends BaseAction {
emc.persist(stat, CheckPersistType.all);
emc.commit();
ApplicationCache.notify(Stat.class);
CacheManager.notify(Stat.class);
Wo wo = new Wo();
wo.setId(stat.getId());
result.setData(wo);
......
......@@ -4,6 +4,7 @@ import com.x.base.core.container.EntityManagerContainer;
import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.annotation.CheckRemoveType;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -30,7 +31,7 @@ class ActionDelete extends BaseAction {
}
emc.remove(stat, CheckRemoveType.all);
emc.commit();
ApplicationCache.notify(Stat.class);
CacheManager.notify(Stat.class);
Wo wo = new Wo();
wo.setId(stat.getId());
result.setData(wo);
......
package com.x.query.assemble.designer.jaxrs.stat;
import com.x.base.core.project.cache.CacheManager;
import org.apache.commons.lang3.StringUtils;
import com.google.gson.JsonElement;
......@@ -54,7 +55,7 @@ class ActionEdit extends BaseAction {
emc.check(stat, CheckPersistType.all);
emc.commit();
ApplicationCache.notify(Stat.class);
CacheManager.notify(Stat.class);
Wo wo = new Wo();
wo.setId(stat.getId());
result.setData(wo);
......
......@@ -2,6 +2,7 @@ package com.x.query.assemble.designer.jaxrs.statement;
import java.util.Date;
import com.x.base.core.project.cache.CacheManager;
import org.apache.commons.lang3.StringUtils;
import com.google.gson.JsonElement;
......@@ -67,7 +68,7 @@ class ActionCreate extends BaseAction {
statement.setLastUpdateTime(new Date());
emc.persist(statement, CheckPersistType.all);
emc.commit();
ApplicationCache.notify(Statement.class);
CacheManager.notify(Statement.class);
Wo wo = new Wo();
wo.setId(statement.getId());
result.setData(wo);
......
......@@ -3,6 +3,7 @@ package com.x.query.assemble.designer.jaxrs.statement;
import com.x.base.core.container.EntityManagerContainer;
import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.exception.ExceptionAccessDenied;
import com.x.base.core.project.exception.ExceptionEntityNotExist;
import com.x.base.core.project.http.ActionResult;
......@@ -31,7 +32,7 @@ class ActionDelete extends BaseAction {
emc.beginTransaction(Statement.class);
emc.remove(statement);
emc.commit();
ApplicationCache.notify(Statement.class);
CacheManager.notify(Statement.class);
Wo wo = new Wo();
wo.setId(statement.getId());
result.setData(wo);
......
......@@ -2,6 +2,7 @@ package com.x.query.assemble.designer.jaxrs.statement;
import java.util.Date;
import com.x.base.core.project.cache.CacheManager;
import org.apache.commons.lang3.StringUtils;
import com.google.gson.JsonElement;
......@@ -76,7 +77,7 @@ class ActionEdit extends BaseAction {
statement.setLastUpdateTime(new Date());
emc.check(statement, CheckPersistType.all);
emc.commit();
ApplicationCache.notify(Statement.class);
CacheManager.notify(Statement.class);
Wo wo = new Wo();
wo.setId(statement.getId());
result.setData(wo);
......
......@@ -2,6 +2,7 @@ package com.x.query.assemble.designer.jaxrs.table;
import java.util.Date;
import com.x.base.core.project.cache.CacheManager;
import org.apache.commons.lang3.StringUtils;
import com.google.gson.JsonElement;
......@@ -70,7 +71,7 @@ class ActionCreate extends BaseAction {
table.setBuildSuccess(false);
emc.persist(table, CheckPersistType.all);
emc.commit();
ApplicationCache.notify(Table.class);
CacheManager.notify(Table.class);
Wo wo = new Wo();
wo.setId(table.getId());
result.setData(wo);
......
......@@ -6,6 +6,7 @@ import com.x.base.core.container.EntityManagerContainer;
import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.annotation.CheckRemoveType;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.exception.ExceptionEntityNotExist;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
......@@ -35,8 +36,8 @@ class ActionDelete extends BaseAction {
emc.beginTransaction(Table.class);
emc.remove(table);
emc.commit();
ApplicationCache.notify(Statement.class);
ApplicationCache.notify(Table.class);
CacheManager.notify(Statement.class);
CacheManager.notify(Table.class);
Wo wo = new Wo();
wo.setId(table.getId());
result.setData(wo);
......
......@@ -2,6 +2,7 @@ package com.x.query.assemble.designer.jaxrs.table;
import java.util.Date;
import com.x.base.core.project.cache.CacheManager;
import org.apache.commons.lang3.StringUtils;
import com.google.gson.JsonElement;
......@@ -68,8 +69,8 @@ class ActionEdit extends BaseAction {
table.setDraftData(gson.toJson(dynamicEntity));
emc.check(table, CheckPersistType.all);
emc.commit();
ApplicationCache.notify(Table.class);
ApplicationCache.notify(Statement.class);
CacheManager.notify(Table.class);
CacheManager.notify(Statement.class);
}
wo.setId(table.getId());
result.setData(wo);
......
package com.x.query.assemble.designer.jaxrs.table;
import com.x.base.core.project.cache.CacheManager;
import org.apache.commons.lang3.StringUtils;
import com.x.base.core.container.EntityManagerContainer;
......@@ -31,8 +32,8 @@ class ActionStatusBuild extends BaseAction {
table.setData(table.getDraftData());
table.setStatus(Table.STATUS_build);
emc.commit();
ApplicationCache.notify(Table.class);
ApplicationCache.notify(Statement.class);
CacheManager.notify(Table.class);
CacheManager.notify(Statement.class);
Wo wo = new Wo();
wo.setId(table.getId());
result.setData(wo);
......
......@@ -3,6 +3,7 @@ package com.x.query.assemble.designer.jaxrs.table;
import com.x.base.core.container.EntityManagerContainer;
import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.exception.ExceptionEntityNotExist;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
......@@ -24,8 +25,8 @@ class ActionStatusDraft extends BaseAction {
emc.beginTransaction(Table.class);
table.setStatus(Table.STATUS_draft);
emc.commit();
ApplicationCache.notify(Table.class);
ApplicationCache.notify(Statement.class);
CacheManager.notify(Table.class);
CacheManager.notify(Statement.class);
Wo wo = new Wo();
wo.setId(table.getId());
result.setData(wo);
......
package com.x.query.assemble.designer.jaxrs.view;
import com.x.base.core.project.cache.CacheManager;
import org.apache.commons.lang3.StringUtils;
import com.google.gson.JsonElement;
......@@ -53,7 +54,7 @@ class ActionCreate extends BaseAction {
view.setQuery(query.getId());
emc.persist(view, CheckPersistType.all);
emc.commit();
ApplicationCache.notify(View.class);
CacheManager.notify(View.class);
Wo wo = new Wo();
wo.setId(view.getId());
result.setData(wo);
......
......@@ -4,6 +4,7 @@ import com.x.base.core.container.EntityManagerContainer;
import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.annotation.CheckRemoveType;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.cache.CacheManager;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WoId;
......@@ -30,7 +31,7 @@ class ActionDelete extends BaseAction {
}
emc.remove(view, CheckRemoveType.all);
emc.commit();
ApplicationCache.notify(View.class);
CacheManager.notify(View.class);
Wo wo = new Wo();
wo.setId(view.getId());
result.setData(wo);
......
package com.x.query.assemble.designer.jaxrs.view;
import com.x.base.core.project.cache.CacheManager;
import org.apache.commons.lang3.StringUtils;
import com.google.gson.JsonElement;
......@@ -58,7 +59,7 @@ class ActionEdit extends BaseAction {
}
emc.check(view, CheckPersistType.all);
emc.commit();
ApplicationCache.notify(View.class);
CacheManager.notify(View.class);
Wo wo = new Wo();
wo.setId(view.getId());
result.setData(wo);
......
......@@ -8,7 +8,6 @@ import org.apache.commons.lang3.StringUtils;
import com.x.base.core.container.EntityManagerContainer;
import com.x.base.core.entity.JpaObject;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.organization.OrganizationDefinition;
import com.x.base.core.project.tools.ListTools;
......@@ -19,16 +18,17 @@ import com.x.query.core.entity.Stat;
import com.x.query.core.entity.View;
import com.x.query.core.entity.schema.Statement;
import com.x.query.core.entity.schema.Table;
import net.sf.ehcache.Ehcache;
import net.sf.ehcache.Element;
import com.x.base.core.project.cache.Cache.CacheCategory;
import com.x.base.core.project.cache.Cache.CacheKey;
import com.x.base.core.project.cache.CacheManager;
import java.util.Optional;
public class Business {
private static Ehcache cache = ApplicationCache.instance().getCache(Query.class, View.class, Stat.class,
private static CacheCategory cache = new CacheCategory(Query.class, View.class, Stat.class,
Reveal.class, Table.class, Statement.class);
public Ehcache cache() {
public CacheCategory cache() {
return cache;
}
......@@ -98,15 +98,15 @@ public class Business {
@SuppressWarnings("unchecked")
public <T extends JpaObject> T pick(String flag, Class<T> cls) throws Exception {
String cacheKey = ApplicationCache.concreteCacheKey(cls, flag);
Element element = cache.get(cacheKey);
if ((null != element) && (null != element.getObjectValue())) {
return (T) element.getObjectValue();
CacheKey cacheKey = new CacheKey(cls, flag);
Optional<?> optional = CacheManager.get(cache, cacheKey);
if (optional.isPresent()) {
return (T) optional.get();
} else {
T t = this.entityManagerContainer().flag(flag, cls);
if (null != t) {
entityManagerContainer().get(cls).detach(t);
cache.put(new Element(cacheKey, t));
CacheManager.put(cache, cacheKey, t);
return t;
}
return null;
......
......@@ -7,35 +7,34 @@ import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.tools.StringTools;
import com.x.query.assemble.surface.AbstractFactory;
import com.x.query.assemble.surface.Business;
import com.x.query.core.entity.Query;
import net.sf.ehcache.Ehcache;
import net.sf.ehcache.Element;
import com.x.base.core.project.cache.Cache.CacheCategory;
import com.x.base.core.project.cache.Cache.CacheKey;
import com.x.base.core.project.cache.CacheManager;
import java.util.Optional;
public class QueryFactory extends AbstractFactory {
private Ehcache cache;
private CacheCategory cache;
public QueryFactory(Business business) throws Exception {
super(business);
this.cache = ApplicationCache.instance().getCache(Query.class);
this.cache = new CacheCategory(Query.class);
}
public List<Query> pick(List<String> flags) throws Exception {
List<Query> list = new ArrayList<>();
for (String str : flags) {
Element element = cache.get(str);
if (null != element) {
if (null != element.getObjectValue()) {
list.add((Query) element.getObjectValue());
}
CacheKey cacheKey = new CacheKey(str);
Optional<?> optional = CacheManager.get(cache, cacheKey);
if (optional.isPresent()) {
list.add((Query) optional.get());
} else {
Query o = this.pickObject(str);
cache.put(new Element(str, o));
CacheManager.put(cache, cacheKey, o);
if (null != o) {
list.add(o);
}
......@@ -49,14 +48,13 @@ public class QueryFactory extends AbstractFactory {
return null;
}
Query o = null;
Element element = cache.get(flag);
if (null != element) {
if (null != element.getObjectValue()) {
o = (Query) element.getObjectValue();
}
CacheKey cacheKey = new CacheKey(flag);
Optional<?> optional = CacheManager.get(cache, cacheKey);
if (optional.isPresent()) {
o = (Query) optional.get();
} else {
o = this.pickObject(flag);
cache.put(new Element(flag, o));
CacheManager.put(cache, cacheKey, o);
}
return o;
}
......
......@@ -5,7 +5,6 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.JpaObject;
import com.x.base.core.project.bean.WrapCopier;
import com.x.base.core.project.bean.WrapCopierFactory;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.exception.ExceptionAccessDenied;
import com.x.base.core.project.exception.ExceptionEntityNotExist;
import com.x.base.core.project.http.ActionResult;
......@@ -13,8 +12,9 @@ import com.x.base.core.project.http.EffectivePerson;
import com.x.query.assemble.surface.Business;
import com.x.query.core.entity.Query;
import com.x.query.core.entity.Reveal;
import net.sf.ehcache.Element;
import com.x.base.core.project.cache.Cache.CacheKey;
import com.x.base.core.project.cache.CacheManager;
import java.util.Optional;
class ActionGetWithQuery extends BaseAction {
......@@ -29,17 +29,17 @@ class ActionGetWithQuery extends BaseAction {
if (business.readable(effectivePerson, query)) {
throw new ExceptionAccessDenied(effectivePerson);
}
String cacheKey = ApplicationCache.concreteCacheKey(this.getClass(), flag, queryFlag);
Element element = business.cache().get(cacheKey);
CacheKey cacheKey = new CacheKey(this.getClass(), flag, queryFlag);
Optional<?> optional = CacheManager.get(business.cache(), cacheKey);
Reveal reveal = null;
if ((null != element) && (null != element.getObjectValue())) {
reveal = (Reveal) element.getObjectValue();
if (optional.isPresent()) {
reveal = (Reveal) optional.get();
} else {
String id = business.reveal().getWithQuery(flag, query);
reveal = business.pick(id, Reveal.class);
if (null != reveal) {
business.entityManagerContainer().get(Reveal.class).detach(reveal);
business.cache().put(new Element(cacheKey, reveal));
CacheManager.put(business.cache(), cacheKey, reveal);
}
}
if (null == reveal) {
......
......@@ -5,7 +5,6 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.JpaObject;
import com.x.base.core.project.bean.WrapCopier;
import com.x.base.core.project.bean.WrapCopierFactory;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.exception.ExceptionAccessDenied;
import com.x.base.core.project.exception.ExceptionEntityNotExist;
import com.x.base.core.project.http.ActionResult;
......@@ -13,8 +12,9 @@ import com.x.base.core.project.http.EffectivePerson;
import com.x.query.assemble.surface.Business;
import com.x.query.core.entity.Query;
import com.x.query.core.entity.Stat;
import net.sf.ehcache.Element;
import com.x.base.core.project.cache.Cache.CacheKey;
import com.x.base.core.project.cache.CacheManager;
import java.util.Optional;
class ActionGetWithQuery extends BaseAction {
......@@ -29,17 +29,17 @@ class ActionGetWithQuery extends BaseAction {
if (!business.readable(effectivePerson, query)) {
throw new ExceptionAccessDenied(effectivePerson);
}
String cacheKey = ApplicationCache.concreteCacheKey(this.getClass(), flag, queryFlag);
Element element = business.cache().get(cacheKey);
CacheKey cacheKey = new CacheKey(this.getClass(), flag, queryFlag);
Optional<?> optional = CacheManager.get(business.cache(), cacheKey);
Stat stat = null;
if ((null != element) && (null != element.getObjectValue())) {
stat = (Stat) element.getObjectValue();
if (optional.isPresent()) {
stat = (Stat) optional.get();
} else {
String id = business.stat().getWithQuery(flag, query);
stat = business.pick(id, Stat.class);
if (null != stat) {
business.entityManagerContainer().get(Stat.class).detach(stat);
business.cache().put(new Element(cacheKey, stat));
CacheManager.put(business.cache(), cacheKey, stat);
}
}
if (null == stat) {
......
......@@ -17,7 +17,6 @@ import com.x.base.core.container.EntityManagerContainer;
import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.JpaObject;
import com.x.base.core.entity.dynamic.DynamicEntity;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.exception.ExceptionAccessDenied;
import com.x.base.core.project.exception.ExceptionEntityNotExist;
import com.x.base.core.project.http.ActionResult;
......@@ -31,8 +30,9 @@ import com.x.query.assemble.surface.ThisApplication;
import com.x.query.core.entity.schema.Statement;
import com.x.query.core.entity.schema.Table;
import com.x.query.core.express.statement.Runtime;
import net.sf.ehcache.Element;
import com.x.base.core.project.cache.Cache.CacheKey;
import com.x.base.core.project.cache.CacheManager;
import java.util.Optional;
class ActionExecute extends BaseAction {
......@@ -70,14 +70,14 @@ class ActionExecute extends BaseAction {
private Statement getStatement(Business business, String flag) throws Exception {
Statement statement = null;
String statmentCacheKey = ApplicationCache.concreteCacheKey(this.getClass(), flag);
Element element = this.cache.get(statmentCacheKey);
if ((null != element) && null != element.getObjectValue()) {
statement = (Statement) element.getObjectValue();
CacheKey cacheKey = new CacheKey(this.getClass(), flag);
Optional<?> optional = CacheManager.get(cache, cacheKey);
if (optional.isPresent()) {
statement = (Statement) optional.get();
} else {
statement = business.entityManagerContainer().flag(flag, Statement.class);
if (null != statement) {
cache.put(new Element(statmentCacheKey, statement));
CacheManager.put(cache, cacheKey, statement);
}
}
return statement;
......@@ -85,14 +85,14 @@ class ActionExecute extends BaseAction {
private CompiledScript getCompiledScriptOfScriptText(Statement statement) throws Exception {
CompiledScript compiledScript = null;
String compiledScriptCacheKey = ApplicationCache.concreteCacheKey(this.getClass(), statement.getId(),
CacheKey cacheKey = new CacheKey(this.getClass(), statement.getId(),
Statement.scriptText_FIELDNAME);
Element element = this.cache.get(compiledScriptCacheKey);
if ((null != element) && null != element.getObjectValue()) {
compiledScript = (CompiledScript) element.getObjectValue();
Optional<?> optional = CacheManager.get(cache, cacheKey);
if (optional.isPresent()) {
compiledScript = (CompiledScript) optional.get();
} else {
compiledScript = ScriptFactory.compile(ScriptFactory.functionalization(statement.getScriptText()));
cache.put(new Element(compiledScriptCacheKey, compiledScript));
CacheManager.put(cache, cacheKey, compiledScript);
}
return compiledScript;
}
......
package com.x.query.assemble.surface.jaxrs.statement;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import com.google.gson.JsonElement;
import com.google.gson.reflect.TypeToken;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.gson.XGsonBuilder;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.StandardJaxrsAction;
import com.x.query.assemble.surface.Business;
import com.x.query.core.entity.schema.Statement;
import com.x.query.core.express.statement.Runtime;
import net.sf.ehcache.Ehcache;
import com.x.base.core.project.cache.Cache.CacheCategory;
abstract class BaseAction extends StandardJaxrsAction {
protected Ehcache cache = ApplicationCache.instance().getCache(Statement.class);
protected CacheCategory cache = new CacheCategory(Statement.class);
protected Runtime runtime(EffectivePerson effectivePerson, JsonElement jsonElement, Business business, Integer page,
Integer size) throws Exception {
......
......@@ -18,7 +18,6 @@ import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.WrapStringList;
import com.x.query.assemble.surface.Business;
import com.x.query.assemble.surface.jaxrs.view.ActionBundle.Wi;
import com.x.query.core.entity.Query;
import com.x.query.core.entity.View;
import com.x.query.core.express.plan.FilterEntry;
......
......@@ -4,7 +4,6 @@ import org.apache.commons.lang3.StringUtils;
import com.x.base.core.container.EntityManagerContainer;
import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.exception.ExceptionAccessDenied;
import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
......@@ -12,8 +11,9 @@ import com.x.base.core.project.jaxrs.WoFile;
import com.x.base.core.project.logger.Logger;
import com.x.base.core.project.logger.LoggerFactory;
import com.x.query.assemble.surface.Business;
import net.sf.ehcache.Element;
import com.x.base.core.project.cache.Cache.CacheKey;
import com.x.base.core.project.cache.CacheManager;
import java.util.Optional;
class ActionExcelResult extends BaseAction {
......@@ -24,10 +24,10 @@ class ActionExcelResult extends BaseAction {
logger.info("{}", flag);
ActionResult<Wo> result = new ActionResult<>();
Business business = new Business(emc);
String cacheKey = ApplicationCache.concreteCacheKey(flag);
Element element = business.cache().get(cacheKey);
if (null != element && null != element.getObjectValue()) {
ExcelResultObject obj = (ExcelResultObject) element.getObjectValue();
CacheKey cacheKey = new CacheKey(flag);
Optional<?> optional = CacheManager.get(business.cache(), cacheKey);
if (optional.isPresent()) {
ExcelResultObject obj = (ExcelResultObject) optional.get();
if (!StringUtils.equals(effectivePerson.getDistinguishedName(), obj.getPerson())) {
throw new ExceptionAccessDenied(effectivePerson);
}
......
......@@ -19,7 +19,6 @@ import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.logger.Logger;
import com.x.base.core.project.logger.LoggerFactory;
import com.x.query.assemble.surface.Business;
import com.x.query.assemble.surface.jaxrs.view.ActionBundle.Wi;
import com.x.query.core.entity.Query;
import com.x.query.core.entity.View;
import com.x.query.core.express.plan.FilterEntry;
......
......@@ -5,7 +5,6 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.JpaObject;
import com.x.base.core.project.bean.WrapCopier;
import com.x.base.core.project.bean.WrapCopierFactory;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.exception.ExceptionAccessDenied;
import com.x.base.core.project.exception.ExceptionEntityNotExist;
import com.x.base.core.project.http.ActionResult;
......@@ -13,8 +12,9 @@ import com.x.base.core.project.http.EffectivePerson;
import com.x.query.assemble.surface.Business;
import com.x.query.core.entity.Query;
import com.x.query.core.entity.View;
import net.sf.ehcache.Element;
import com.x.base.core.project.cache.Cache.CacheKey;
import com.x.base.core.project.cache.CacheManager;
import java.util.Optional;
class ActionGetWithQuery extends BaseAction {
......@@ -29,17 +29,17 @@ class ActionGetWithQuery extends BaseAction {
if (!business.readable(effectivePerson, query)) {
throw new ExceptionAccessDenied(effectivePerson);
}
String cacheKey = ApplicationCache.concreteCacheKey(this.getClass(), flag, queryFlag);
Element element = business.cache().get(cacheKey);
CacheKey cacheKey = new CacheKey(this.getClass(), flag, queryFlag);
Optional<?> optional = CacheManager.get(business.cache(), cacheKey);
View view = null;
if ((null != element) && (null != element.getObjectValue())) {
view = (View) element.getObjectValue();
if (optional.isPresent()) {
view = (View) optional.get();
} else {
String id = business.view().getWithQuery(flag, query);
view = business.pick(id, View.class);
if (null != view) {
business.entityManagerContainer().get(View.class).detach(view);
business.cache().put(new Element(cacheKey, view));
CacheManager.put(business.cache(), cacheKey, view);
}
}
if (null == view) {
......
......@@ -7,7 +7,6 @@ import java.util.Map;
import java.util.Objects;
import com.google.gson.reflect.TypeToken;
import com.x.base.core.project.gson.XGsonBuilder;
import com.x.processplatform.core.entity.element.Process;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -17,7 +16,6 @@ import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.gson.GsonPropertyObject;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.jaxrs.StandardJaxrsAction;
......@@ -32,22 +30,23 @@ import com.x.query.core.express.plan.ProcessPlatformPlan;
import com.x.query.core.express.plan.Row;
import com.x.query.core.express.plan.Runtime;
import com.x.query.core.express.plan.SelectEntry;
import net.sf.ehcache.Element;
import com.x.base.core.project.cache.Cache.CacheKey;
import com.x.base.core.project.cache.CacheManager;
import java.util.Optional;
abstract class BaseAction extends StandardJaxrsAction {
protected Plan accessPlan(Business business, View view, Runtime runtime) throws Exception {
Plan plan = null;
if (BooleanUtils.isTrue(view.getCacheAccess())) {
String cacheKey = ApplicationCache.concreteCacheKey("accessPlan", view.getId(),
CacheKey cacheKey = new CacheKey("accessPlan", view.getId(),
StringTools.sha(gson.toJson(runtime)));
Element element = business.cache().get(cacheKey);
if ((null != element) && (null != element.getObjectValue())) {
plan = (Plan) element.getObjectValue();
Optional<?> optional = CacheManager.get(business.cache(), cacheKey);
if (optional.isPresent()) {
plan = (Plan) optional.get();
} else {
plan = this.dealPlan(business, view, runtime);
business.cache().put(new Element(cacheKey, plan));
CacheManager.put(business.cache(), cacheKey, plan);
}
} else {
plan = this.dealPlan(business, view, runtime);
......@@ -112,14 +111,14 @@ abstract class BaseAction extends StandardJaxrsAction {
protected List<String> fetchBundle(Business business, View view, Runtime runtime) throws Exception {
List<String> os = null;
if (BooleanUtils.isTrue(view.getCacheAccess())) {
String cacheKey = ApplicationCache.concreteCacheKey("fetchBundle", view.getId(),
CacheKey cacheKey = new CacheKey("fetchBundle", view.getId(),
StringTools.sha(gson.toJson(runtime)));
Element element = business.cache().get(cacheKey);
if ((null != element) && (null != element.getObjectValue())) {
os = (List<String>) element.getObjectValue();
Optional<?> optional = CacheManager.get(business.cache(), cacheKey);
if (optional.isPresent()) {
os = (List<String>) optional.get();
} else {
os = this.dealBundle(business, view, runtime);
business.cache().put(new Element(cacheKey, os));
CacheManager.put(business.cache(), cacheKey, os);
}
} else {
os = this.dealBundle(business, view, runtime);
......@@ -196,7 +195,8 @@ abstract class BaseAction extends StandardJaxrsAction {
obj.setName(name);
obj.setPerson(effectivePerson.getDistinguishedName());
String flag = StringTools.uniqueToken();
business.cache().put(new Element(flag, obj));
CacheKey cacheKey = new CacheKey(flag);
CacheManager.put(business.cache(), cacheKey, obj);
return flag;
}
}
......
......@@ -7,35 +7,34 @@ import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.tools.StringTools;
import com.x.query.core.entity.Query;
import com.x.query.service.processing.AbstractFactory;
import com.x.query.service.processing.Business;
import net.sf.ehcache.Ehcache;
import net.sf.ehcache.Element;
import com.x.base.core.project.cache.Cache.CacheCategory;
import com.x.base.core.project.cache.Cache.CacheKey;
import com.x.base.core.project.cache.CacheManager;
import java.util.Optional;
public class QueryFactory extends AbstractFactory {
private Ehcache cache;
private CacheCategory cache;
public QueryFactory(Business business) throws Exception {
super(business);
this.cache = ApplicationCache.instance().getCache(Query.class);
this.cache = new CacheCategory(Query.class);
}
public List<Query> pick(List<String> flags) throws Exception {
List<Query> list = new ArrayList<>();
for (String str : flags) {
Element element = cache.get(str);
if (null != element) {
if (null != element.getObjectValue()) {
list.add((Query) element.getObjectValue());
}
CacheKey cacheKey = new CacheKey(str);
Optional<?> optional = CacheManager.get(cache, cacheKey);
if (optional.isPresent()) {
list.add((Query) optional.get());
} else {
Query o = this.pickObject(str);
cache.put(new Element(str, o));
CacheManager.put(cache, cacheKey, o);
if (null != o) {
list.add(o);
}
......@@ -49,14 +48,13 @@ public class QueryFactory extends AbstractFactory {
return null;
}
Query o = null;
Element element = cache.get(flag);
if (null != element) {
if (null != element.getObjectValue()) {
o = (Query) element.getObjectValue();
}
CacheKey cacheKey = new CacheKey(flag);
Optional<?> optional = CacheManager.get(cache, cacheKey);
if (optional.isPresent()) {
o = (Query) optional.get();
} else {
o = this.pickObject(flag);
cache.put(new Element(flag, o));
CacheManager.put(cache, cacheKey, o);
}
return o;
}
......
......@@ -20,7 +20,6 @@ import com.x.base.core.container.EntityManagerContainer;
import com.x.base.core.container.factory.EntityManagerContainerFactory;
import com.x.base.core.entity.dataitem.DataItemConverter;
import com.x.base.core.entity.dataitem.ItemCategory;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.config.Config;
import com.x.base.core.project.config.StorageMapping;
import com.x.base.core.project.exception.ExceptionEntityNotExist;
......@@ -43,8 +42,9 @@ import com.x.query.service.processing.Business;
import com.x.query.service.processing.ThisApplication;
import com.x.query.service.processing.helper.ExtractTextHelper;
import com.x.query.service.processing.helper.LanguageProcessingHelper;
import net.sf.ehcache.Element;
import com.x.base.core.project.cache.Cache.CacheKey;
import com.x.base.core.project.cache.CacheManager;
import java.util.Optional;
class ActionListCalculateWithWork extends BaseAction {
......@@ -63,10 +63,10 @@ class ActionListCalculateWithWork extends BaseAction {
throw new ExceptionModelNotReady(model.getName());
}
NeuralNetwork<MomentumBackpropagation> neuralNetwork = null;
String cacheKey = ApplicationCache.concreteCacheKey(this.getClass(), model.getId());
Element element = cache.get(cacheKey);
if (null != element && (null != element.getObjectValue())) {
neuralNetwork = ((NeuralNetwork<MomentumBackpropagation>) element.getObjectValue());
CacheKey cacheKey = new CacheKey(this.getClass(), model.getId());
Optional<?> optional = CacheManager.get(cache, cacheKey);
if (optional.isPresent()) {
neuralNetwork = ((NeuralNetwork<MomentumBackpropagation>) optional.get());
} else {
if (StringUtils.isEmpty(model.getNnet())) {
throw new ExceptionModelNotReady(model.getName());
......@@ -75,7 +75,7 @@ class ActionListCalculateWithWork extends BaseAction {
NeuralNetworkCODEC.array2network(
DoubleTools.byteToDoubleArray(ByteTools.decompressBase64String(model.getNnet())),
neuralNetwork);
cache.put(new Element(cacheKey, neuralNetwork));
CacheManager.put(cache, cacheKey, neuralNetwork);
}
Wo wo = new Wo();
Work work = emc.flag(workId, Work.class);
......
package com.x.query.service.processing.jaxrs.neural;
import com.x.base.core.project.cache.ApplicationCache;
import com.x.base.core.project.jaxrs.StandardJaxrsAction;
import com.x.base.core.project.logger.Logger;
import com.x.base.core.project.logger.LoggerFactory;
import com.x.query.core.entity.neural.Model;
import net.sf.ehcache.Ehcache;
import com.x.base.core.project.cache.Cache.CacheCategory;
abstract class BaseAction extends StandardJaxrsAction {
protected Ehcache cache = ApplicationCache.instance().getCache(Model.class);
protected CacheCategory cache = new CacheCategory(Model.class);
private static Logger logger = LoggerFactory.getLogger(BaseAction.class);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册