Explorar o código

fix queue start

zhourui %!s(int64=5) %!d(string=hai) anos
pai
achega
a802aa291a
Modificáronse 32 ficheiros con 272 adicións e 200 borrados
  1. 27 58
      o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/ThisApplication.java
  2. 9 7
      o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/ThisApplication.java
  3. 13 7
      o2server/x_calendar_assemble_control/src/main/java/com/x/calendar/assemble/control/ThisApplication.java
  4. 19 28
      o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/ThisApplication.java
  5. 5 2
      o2server/x_file_assemble_control/src/main/java/com/x/file/assemble/control/ThisApplication.java
  6. 4 0
      o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/ThisApplication.java
  7. 5 2
      o2server/x_hotpic_assemble_control/src/main/java/com/x/hotpic/assemble/control/ThisApplication.java
  8. 4 0
      o2server/x_jpush_assemble_control/src/main/java/com/x/jpush/assemble/control/ThisApplication.java
  9. 4 0
      o2server/x_meeting_assemble_control/src/main/java/com/x/meeting/assemble/control/ThisApplication.java
  10. 51 53
      o2server/x_message_assemble_communicate/src/main/java/com/x/message/assemble/communicate/ThisApplication.java
  11. 6 2
      o2server/x_mind_assemble_control/src/main/java/com/x/mind/assemble/control/ThisApplication.java
  12. 7 2
      o2server/x_mind_assemble_control/src/main/webapp/describe/sources/com/x/mind/assemble/control/ThisApplication.java
  13. 5 4
      o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/ThisApplication.java
  14. 6 4
      o2server/x_okr_assemble_control/src/main/webapp/describe/sources/com/x/okr/assemble/control/ThisApplication.java
  15. 5 2
      o2server/x_organization_assemble_authentication/src/main/java/com/x/organization/assemble/authentication/ThisApplication.java
  16. 4 0
      o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/ThisApplication.java
  17. 4 0
      o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/ThisApplication.java
  18. 4 0
      o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/ThisApplication.java
  19. 4 0
      o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/ThisApplication.java
  20. 4 0
      o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/ThisApplication.java
  21. 5 0
      o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/ThisApplication.java
  22. 4 0
      o2server/x_processplatform_assemble_bam/src/main/java/com/x/processplatform/assemble/bam/ThisApplication.java
  23. 5 0
      o2server/x_processplatform_assemble_bam/src/main/webapp/describe/sources/com/x/processplatform/assemble/bam/ThisApplication.java
  24. 14 15
      o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/ThisApplication.java
  25. 4 0
      o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/ThisApplication.java
  26. 7 3
      o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/ThisApplication.java
  27. 16 10
      o2server/x_program_center/src/main/java/com/x/program/center/ThisApplication.java
  28. 4 0
      o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/ThisApplication.java
  29. 4 0
      o2server/x_query_assemble_surface/src/main/java/com/x/query/assemble/surface/ThisApplication.java
  30. 4 0
      o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/ThisApplication.java
  31. 4 0
      o2server/x_query_service_processing/src/main/webapp/describe/sources/com/x/query/service/processing/ThisApplication.java
  32. 11 1
      o2server/x_query_service_processing/src/main/webapp/describe/sources/com/x/query/service/processing/jaxrs/test/ActionGroup2.java

+ 27 - 58
o2server/x_attendance_assemble_control/src/main/java/com/x/attendance/assemble/control/ThisApplication.java

@@ -1,60 +1,63 @@
 package com.x.attendance.assemble.control;
 
+import org.apache.commons.lang3.BooleanUtils;
+
 import com.x.attendance.assemble.control.processor.monitor.MonitorFileDataOpt;
 import com.x.attendance.assemble.control.processor.thread.DataProcessThreadFactory;
-import com.x.attendance.assemble.control.schedule.*;
+import com.x.attendance.assemble.control.schedule.AttendanceStatisticTask;
+import com.x.attendance.assemble.control.schedule.DetailLastDayRecordAnalyseTask;
+import com.x.attendance.assemble.control.schedule.DingdingAttendanceSyncScheduleTask;
+import com.x.attendance.assemble.control.schedule.MobileRecordAnalyseTask;
+import com.x.attendance.assemble.control.schedule.QywxAttendanceSyncScheduleTask;
 import com.x.attendance.assemble.control.service.AttendanceSettingService;
 import com.x.base.core.project.Context;
 import com.x.base.core.project.cache.CacheManager;
 import com.x.base.core.project.config.Config;
 import com.x.base.core.project.logger.LoggerFactory;
 
-import org.apache.commons.lang3.BooleanUtils;
-
 public class ThisApplication {
 
+	private ThisApplication() {
+		//nothing
+	}
+
 	protected static Context context;
 
 	public static Context context() {
 		return context;
 	}
 
-	public static QueueDingdingAttendance dingdingQueue = new QueueDingdingAttendance();
-	public static QueueQywxAttendanceSync qywxQueue = new QueueQywxAttendanceSync();
-	public static QueueQywxUnitStatistic unitQywxStatisticQueue = new QueueQywxUnitStatistic();
-	public static QueueQywxPersonStatistic personQywxStatisticQueue = new QueueQywxPersonStatistic();
-	public static QueueDingdingPersonStatistic personStatisticQueue = new QueueDingdingPersonStatistic();
-	public static QueueDingdingUnitStatistic unitStatisticQueue = new QueueDingdingUnitStatistic();
+	public static final QueueDingdingAttendance dingdingQueue = new QueueDingdingAttendance();
+	public static final QueueQywxAttendanceSync qywxQueue = new QueueQywxAttendanceSync();
+	public static final QueueQywxUnitStatistic unitQywxStatisticQueue = new QueueQywxUnitStatistic();
+	public static final QueueQywxPersonStatistic personQywxStatisticQueue = new QueueQywxPersonStatistic();
+	public static final QueueDingdingPersonStatistic personStatisticQueue = new QueueDingdingPersonStatistic();
+	public static final QueueDingdingUnitStatistic unitStatisticQueue = new QueueDingdingUnitStatistic();
 
-	public static QueuePersonAttendanceDetailAnalyse detailAnalyseQueue = new QueuePersonAttendanceDetailAnalyse();
-	public static QueueAttendanceDetailStatistic detailStatisticQueue = new QueueAttendanceDetailStatistic();
+	public static final QueuePersonAttendanceDetailAnalyse detailAnalyseQueue = new QueuePersonAttendanceDetailAnalyse();
+	public static final QueueAttendanceDetailStatistic detailStatisticQueue = new QueueAttendanceDetailStatistic();
 
 	public static void init() throws Exception {
 		try {
 			CacheManager.init(context.clazz().getSimpleName());
 			LoggerFactory.setLevel(Config.logLevel().x_attendance_assemble_control());
 			new AttendanceSettingService().initAllSystemConfig();
-
-			detailAnalyseQueue.start();
-			detailStatisticQueue.start();
+			context.startQueue(detailAnalyseQueue);
+			context.startQueue(detailStatisticQueue);
 			if (BooleanUtils.isTrue(Config.dingding().getAttendanceSyncEnable())) {
-				dingdingQueue.start();
-				personStatisticQueue.start();
-				unitStatisticQueue.start();
+				context.startQueue(dingdingQueue);
+				context.startQueue(personStatisticQueue);
+				context.startQueue(unitStatisticQueue);
 				context.schedule(DingdingAttendanceSyncScheduleTask.class, "0 0 1 * * ?");
 				// 已经将任务 放到了同步结束后执行 暂时不需要开定时任务了
-//				context.schedule(DingdingAttendanceStatisticScheduleTask.class, "0 0 3 * * ?");
-//				context.schedule(DingdingAttendanceStatisticPersonScheduleTask.class, "0 0 3 * * ?");
 			}
 			if (BooleanUtils.isTrue(Config.qiyeweixin().getAttendanceSyncEnable())) {
-				qywxQueue.start();
-				unitQywxStatisticQueue.start();
-				personQywxStatisticQueue.start();
+				context.startQueue(qywxQueue);
+				context.startQueue(unitQywxStatisticQueue);
+				context.startQueue(personQywxStatisticQueue);
 				context.schedule(QywxAttendanceSyncScheduleTask.class, "0 0 1 * * ?");
 			}
-
 			context.schedule(AttendanceStatisticTask.class, "0 0 0/4 * * ?");
-
 			context.schedule(MobileRecordAnalyseTask.class, "0 0 * * * ?");
 			// 每天凌晨1点,计算前一天所有的未签退和未分析的打卡数据
 			context.schedule(DetailLastDayRecordAnalyseTask.class, "0 0 1 * * ?");
@@ -68,43 +71,9 @@ public class ThisApplication {
 		try {
 			CacheManager.shutdown();
 			DataProcessThreadFactory.getInstance().showdown();
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-		try {
 			MonitorFileDataOpt.stop();
 		} catch (Exception e) {
 			e.printStackTrace();
 		}
-		try {
-			dingdingQueue.stop();
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-		try {
-			personStatisticQueue.stop();
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-		try {
-			unitStatisticQueue.stop();
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-		try {
-			qywxQueue.stop();
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-		try {
-			unitQywxStatisticQueue.stop();
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-		try {
-			personQywxStatisticQueue.stop();
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
 	}
 }

+ 9 - 7
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/ThisApplication.java

@@ -2,6 +2,8 @@ package com.x.bbs.assemble.control;
 
 import java.util.List;
 
+import org.apache.commons.lang3.BooleanUtils;
+
 import com.x.base.core.project.Context;
 import com.x.base.core.project.cache.CacheManager;
 import com.x.base.core.project.config.Config;
@@ -26,10 +28,14 @@ import com.x.bbs.entity.BBSSectionInfo;
 
 public class ThisApplication {
 
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
 	public static final String BBSMANAGER = "BBSManager@CMSManagerSystemRole@R";
-	public static QueueNewReplyNotify queueNewReplyNotify;
-	public static QueueNewSubjectNotify queueNewSubjectNotify;
+	public static final QueueNewReplyNotify queueNewReplyNotify = new QueueNewReplyNotify();
+	public static final QueueNewSubjectNotify queueNewSubjectNotify = new QueueNewSubjectNotify();
 	public static String CONFIG_BBS_ANONYMOUS_PERMISSION = "YES";
 
 	public static Context context() {
@@ -43,11 +49,7 @@ public class ThisApplication {
 			CONFIG_BBS_ANONYMOUS_PERMISSION = (new BBSConfigSettingService())
 					.getValueWithConfigCode("BBS_ANONYMOUS_PERMISSION");
 			initAllSystemConfig();
-			queueNewReplyNotify = new QueueNewReplyNotify();
-			queueNewSubjectNotify = new QueueNewSubjectNotify();
-
 			MessageConnector.start(context());
-
 			context().startQueue(queueNewReplyNotify);
 			context().startQueue(queueNewSubjectNotify);
 			context.schedule(SubjectTotalStatisticTask.class, "0 0 1 * * ?"); // 每天凌晨一点执行
@@ -144,7 +146,7 @@ public class ThisApplication {
 	 * @return
 	 */
 	public static Boolean isForumManager(EffectivePerson effectivePerson, BBSForumInfo forumInfo) {
-		if (isBBSManager(effectivePerson)) {
+		if (BooleanUtils.isTrue(isBBSManager(effectivePerson))) {
 			return true;
 		}
 		if (forumInfo != null && ListTools.isNotEmpty(forumInfo.getForumManagerList())) {

+ 13 - 7
o2server/x_calendar_assemble_control/src/main/java/com/x/calendar/assemble/control/ThisApplication.java

@@ -2,6 +2,8 @@ package com.x.calendar.assemble.control;
 
 import java.util.List;
 
+import org.apache.commons.lang3.BooleanUtils;
+
 import com.x.base.core.project.Context;
 import com.x.base.core.project.cache.CacheManager;
 import com.x.base.core.project.config.Config;
@@ -17,6 +19,10 @@ import com.x.calendar.core.entity.Calendar_Event;
 
 public class ThisApplication {
 
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
 	public static final String CalendarMANAGER = "CalendarManager";
 
@@ -73,7 +79,7 @@ public class ThisApplication {
 	 * @return
 	 */
 	public static Boolean isCalendarManager(EffectivePerson effectivePerson, Calendar calendar) {
-		if (isCalendarSystemManager(effectivePerson)) {
+		if (BooleanUtils.isTrue(isCalendarSystemManager(effectivePerson))) {
 			return true;
 		}
 		if (calendar != null) {
@@ -98,11 +104,11 @@ public class ThisApplication {
 	 */
 	public static Boolean isCalendarPublisher(EffectivePerson effectivePerson, List<String> unitNames,
 			List<String> groupNames, Calendar calendar) {
-		if (isCalendarSystemManager(effectivePerson)) {
+		if (BooleanUtils.isTrue(isCalendarSystemManager(effectivePerson))) {
 			return true;
 		}
 		if (calendar != null) {
-			if (isCalendarManager(effectivePerson, calendar)) {
+			if (BooleanUtils.isTrue(isCalendarManager(effectivePerson, calendar))) {
 				return true;
 			}
 			// 判断发布权限
@@ -142,13 +148,13 @@ public class ThisApplication {
 	 * @throws Exception
 	 */
 	public static Boolean isCalendarPublisher(EffectivePerson effectivePerson, Calendar calendar) throws Exception {
-		if (isCalendarSystemManager(effectivePerson)) {
+		if (BooleanUtils.isTrue(isCalendarSystemManager(effectivePerson))) {
 			return true;
 		}
 		List<String> unitNames = null;
 		List<String> groupNames = null;
 		if (calendar != null) {
-			if (isCalendarManager(effectivePerson, calendar)) {
+			if (BooleanUtils.isTrue(isCalendarManager(effectivePerson, calendar))) {
 				return true;
 			}
 			UserManagerService userManagerService = new UserManagerService();
@@ -192,7 +198,7 @@ public class ThisApplication {
 	 */
 	public static Boolean isEventManager(EffectivePerson effectivePerson, Calendar calendar, Calendar_Event event)
 			throws Exception {
-		if (isCalendarSystemManager(effectivePerson)) {
+		if (BooleanUtils.isTrue(isCalendarSystemManager(effectivePerson))) {
 			return true;
 		}
 		List<String> unitNames = null;
@@ -203,7 +209,7 @@ public class ThisApplication {
 			unitNames = userManagerService.listUnitNamesWithPerson(personName);
 			groupNames = userManagerService.listGroupNamesByPerson(personName);
 			// 判断日历的发布权限
-			if (isCalendarPublisher(effectivePerson, unitNames, groupNames, calendar)) {
+			if (BooleanUtils.isTrue(isCalendarPublisher(effectivePerson, unitNames, groupNames, calendar))) {
 				return true;
 			}
 			// 判断事件的管理权限

+ 19 - 28
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/ThisApplication.java

@@ -1,6 +1,7 @@
 package com.x.cms.assemble.control;
 
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
 
 import com.x.base.core.project.Context;
 import com.x.base.core.project.cache.CacheManager;
@@ -22,17 +23,27 @@ import com.x.cms.assemble.control.timertask.Timertask_RefreshAllDocumentReviews;
 
 public class ThisApplication {
 
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
 
 	public static final String ROLE_CMSManager = "CMSManager@CMSManagerSystemRole@R";
 	public static final String ROLE_Manager = "Manager@ManagerSystemRole@R";
-	public static QueueDataRowImport queueDataRowImport;
-	public static QueueDocumentDelete queueDocumentDelete;
-	public static QueueDocumentUpdate queueDocumentUpdate;
-	public static QueueDocumentViewCountUpdate queueDocumentViewCountUpdate;
-	public static QueueBatchOperation queueBatchOperation;
-	public static QueueSendDocumentNotify queueSendDocumentNotify;
-	private static ConcurrentHashMap<String, DataImportStatus> importStatus = new ConcurrentHashMap<>();
+	// 文档批量导入时数据存储过程
+	public static final QueueDataRowImport queueDataRowImport = new QueueDataRowImport();
+	// Document删除时也需要检查一下热点图片里的数据是否已经删除掉了
+	public static final QueueDocumentDelete queueDocumentDelete = new QueueDocumentDelete();
+	// Document变更标题时也需要更新一下热点图片里的数据
+	public static final QueueDocumentUpdate queueDocumentUpdate = new QueueDocumentUpdate();
+	// Document被访问时,需要将总的访问量更新到item的document中,便于视图使用,在队列里异步修改
+	public static final QueueDocumentViewCountUpdate queueDocumentViewCountUpdate = new QueueDocumentViewCountUpdate();
+	// 执行数据库中的批处理操作
+	public static final QueueBatchOperation queueBatchOperation = new QueueBatchOperation();
+	// Document发布时,向所有阅读者推送通知
+	public static final QueueSendDocumentNotify queueSendDocumentNotify = new QueueSendDocumentNotify();
+	private static final ConcurrentHashMap<String, DataImportStatus> importStatus = new ConcurrentHashMap<>();
 
 	public static Context context() {
 		return context;
@@ -41,21 +52,7 @@ public class ThisApplication {
 	public static void init() throws Exception {
 		CacheManager.init(context.clazz().getSimpleName());
 		LoggerFactory.setLevel(Config.logLevel().x_cms_assemble_control());
-		// 执行数据库中的批处理操作
-		queueBatchOperation = new QueueBatchOperation();
-		// Document删除时也需要检查一下热点图片里的数据是否已经删除掉了
-		queueDocumentDelete = new QueueDocumentDelete();
-		// 文档批量导入时数据存储过程
-		queueDataRowImport = new QueueDataRowImport();
-		// Document变更标题时也需要更新一下热点图片里的数据
-		queueDocumentUpdate = new QueueDocumentUpdate();
-		// Document被访问时,需要将总的访问量更新到item的document中,便于视图使用,在队列里异步修改
-		queueDocumentViewCountUpdate = new QueueDocumentViewCountUpdate();
-		// Document发布时,向所有阅读者推送通知
-		queueSendDocumentNotify = new QueueSendDocumentNotify();
-
 		MessageConnector.start(context());
-
 		context().startQueue(queueBatchOperation);
 		context().startQueue(queueDocumentDelete);
 		context().startQueue(queueDataRowImport);
@@ -77,18 +74,12 @@ public class ThisApplication {
 	public static void destroy() {
 		try {
 			CacheManager.shutdown();
-			queueBatchOperation.stop();
-			queueDocumentDelete.stop();
-			queueDataRowImport.stop();
-			queueDocumentUpdate.stop();
-			queueDocumentViewCountUpdate.stop();
-			queueSendDocumentNotify.stop();
 		} catch (Exception e) {
 			e.printStackTrace();
 		}
 	}
 
-	public static ConcurrentHashMap<String, DataImportStatus> listImportStatus() {
+	public static ConcurrentMap<String, DataImportStatus> listImportStatus() {
 		return importStatus;
 	}
 

+ 5 - 2
o2server/x_file_assemble_control/src/main/java/com/x/file/assemble/control/ThisApplication.java

@@ -9,7 +9,11 @@ import com.x.file.assemble.control.jaxrs.file.FileRemoveQueue;
 
 public class ThisApplication {
 
-	public static FileRemoveQueue fileRemoveQueue;
+	private ThisApplication() {
+		// nothing
+	}
+
+	public static final FileRemoveQueue fileRemoveQueue = new FileRemoveQueue();
 
 	protected static Context context;
 
@@ -21,7 +25,6 @@ public class ThisApplication {
 		try {
 			CacheManager.init(context.clazz().getSimpleName());
 			LoggerFactory.setLevel(Config.logLevel().x_file_assemble_control());
-			fileRemoveQueue = new FileRemoveQueue();
 			MessageConnector.start(context());
 			context().startQueue(fileRemoveQueue);
 		} catch (Exception e) {

+ 4 - 0
o2server/x_general_assemble_control/src/main/java/com/x/general/assemble/control/ThisApplication.java

@@ -7,6 +7,10 @@ import com.x.base.core.project.logger.LoggerFactory;
 
 public class ThisApplication {
 
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
 
 	public static Context context() {

+ 5 - 2
o2server/x_hotpic_assemble_control/src/main/java/com/x/hotpic/assemble/control/ThisApplication.java

@@ -9,7 +9,11 @@ import com.x.hotpic.assemble.control.schedule.InfoExistsCheckTask;
 
 public class ThisApplication {
 
-	public static DocumentExistsCheckTask queueLoginRecord;
+	private ThisApplication() {
+		// nothing
+	}
+
+	public static final DocumentExistsCheckTask queueLoginRecord = new DocumentExistsCheckTask();
 	protected static Context context;
 
 	public static Context context() {
@@ -20,7 +24,6 @@ public class ThisApplication {
 		try {
 			CacheManager.init(context.clazz().getSimpleName());
 			LoggerFactory.setLevel(Config.logLevel().x_hotpic_assemble_control());
-			queueLoginRecord = new DocumentExistsCheckTask();
 			context.startQueue(queueLoginRecord);
 			context.schedule(InfoExistsCheckTask.class, "0 0/10 * * * ?");
 		} catch (Exception e) {

+ 4 - 0
o2server/x_jpush_assemble_control/src/main/java/com/x/jpush/assemble/control/ThisApplication.java

@@ -7,6 +7,10 @@ import com.x.base.core.project.logger.LoggerFactory;
 
 public class ThisApplication {
 
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
 
 	public static Context context() {

+ 4 - 0
o2server/x_meeting_assemble_control/src/main/java/com/x/meeting/assemble/control/ThisApplication.java

@@ -8,6 +8,10 @@ import com.x.base.core.project.message.MessageConnector;
 
 public class ThisApplication {
 
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
 
 	public static Context context() {

+ 51 - 53
o2server/x_message_assemble_communicate/src/main/java/com/x/message/assemble/communicate/ThisApplication.java

@@ -1,37 +1,40 @@
 package com.x.message.assemble.communicate;
 
-import com.x.base.core.project.message.MessageConnector;
 import org.apache.commons.lang3.BooleanUtils;
 
 import com.x.base.core.project.Context;
 import com.x.base.core.project.cache.CacheManager;
 import com.x.base.core.project.config.Config;
 import com.x.base.core.project.logger.LoggerFactory;
+import com.x.base.core.project.message.MessageConnector;
 import com.x.message.assemble.communicate.schedule.Clean;
 import com.x.message.assemble.communicate.schedule.TriggerMq;
-import com.x.message.core.entity.Message;
 
 public class ThisApplication {
 
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
 
-	public static WsConsumeQueue wsConsumeQueue = new WsConsumeQueue();
+	public static final WsConsumeQueue wsConsumeQueue = new WsConsumeQueue();
 
-	public static PmsConsumeQueue pmsConsumeQueue = new PmsConsumeQueue();
+	public static final PmsConsumeQueue pmsConsumeQueue = new PmsConsumeQueue();
 
-	public static CalendarConsumeQueue calendarConsumeQueue = new CalendarConsumeQueue();
+	public static final CalendarConsumeQueue calendarConsumeQueue = new CalendarConsumeQueue();
 
-	public static QiyeweixinConsumeQueue qiyeweixinConsumeQueue = new QiyeweixinConsumeQueue();
+	public static final QiyeweixinConsumeQueue qiyeweixinConsumeQueue = new QiyeweixinConsumeQueue();
 
-	public static ZhengwuDingdingConsumeQueue zhengwuDingdingConsumeQueue = new ZhengwuDingdingConsumeQueue();
+	public static final ZhengwuDingdingConsumeQueue zhengwuDingdingConsumeQueue = new ZhengwuDingdingConsumeQueue();
 
-	public static DingdingConsumeQueue dingdingConsumeQueue = new DingdingConsumeQueue();
+	public static final DingdingConsumeQueue dingdingConsumeQueue = new DingdingConsumeQueue();
 
-	public static WeLinkConsumeQueue weLinkConsumeQueue = new WeLinkConsumeQueue();
+	public static final WeLinkConsumeQueue weLinkConsumeQueue = new WeLinkConsumeQueue();
 
-	public static PmsInnerConsumeQueue pmsInnerConsumeQueue = new PmsInnerConsumeQueue();
+	public static final PmsInnerConsumeQueue pmsInnerConsumeQueue = new PmsInnerConsumeQueue();
 
-	public static MQConsumeQueue mqConsumeQueue = new MQConsumeQueue();
+	public static final MQConsumeQueue mqConsumeQueue = new MQConsumeQueue();
 
 	public static Context context() {
 		return context;
@@ -41,62 +44,57 @@ public class ThisApplication {
 		try {
 			CacheManager.init(context.clazz().getSimpleName());
 			LoggerFactory.setLevel(Config.logLevel().x_message_assemble_communicate());
-			if (Config.communicate().wsEnable()) {
-				wsConsumeQueue.start();
-			}
-			if (Config.communicate().pmsEnable()) {
-				pmsConsumeQueue.start();
-			}
-			if (Config.communicate().calendarEnable()) {
-				calendarConsumeQueue.start();
-			}
+
+			MessageConnector.start(context());
+			startQueue();
 			if (BooleanUtils.isTrue(Config.communicate().clean().getEnable())) {
 				context().schedule(Clean.class, Config.communicate().clean().getCron());
 			}
-			if (BooleanUtils.isTrue(Config.qiyeweixin().getEnable())
-					&& BooleanUtils.isTrue(Config.qiyeweixin().getMessageEnable())) {
-				qiyeweixinConsumeQueue.start();
-			}
-			if (BooleanUtils.isTrue(Config.zhengwuDingding().getEnable())
-					&& BooleanUtils.isTrue(Config.zhengwuDingding().getMessageEnable())) {
-				zhengwuDingdingConsumeQueue.start();
-			}
-			if (Config.dingding().getEnable() && Config.dingding().getMessageEnable()) {
-				dingdingConsumeQueue.start();
-			}
-			if (BooleanUtils.isTrue(Config.pushConfig().getEnable())) {
-				pmsInnerConsumeQueue.start();
-			}
-			if (Config.weLink().getEnable() && Config.weLink().getMessageEnable()) {
-				weLinkConsumeQueue.start();
-			}
-
-			if (Config.mq().getEnable()) {
-				mqConsumeQueue.start();
-			}
-
-			MessageConnector.start(context());
-
 			if (BooleanUtils.isTrue(Config.communicate().cronMq().getEnable())) {
 				context().schedule(TriggerMq.class, Config.communicate().cronMq().getCron());
 			}
-
 		} catch (Exception e) {
 			e.printStackTrace();
 		}
 	}
 
+	private static void startQueue() throws Exception {
+		if (BooleanUtils.isTrue(Config.communicate().wsEnable())) {
+			context().startQueue(wsConsumeQueue);
+		}
+		if (BooleanUtils.isTrue(Config.communicate().pmsEnable())) {
+			context().startQueue(pmsConsumeQueue);
+		}
+		if (BooleanUtils.isTrue(Config.communicate().calendarEnable())) {
+			context().startQueue(calendarConsumeQueue);
+		}
+
+		if (BooleanUtils.isTrue(Config.qiyeweixin().getEnable())
+				&& BooleanUtils.isTrue(Config.qiyeweixin().getMessageEnable())) {
+			context().startQueue(qiyeweixinConsumeQueue);
+		}
+		if (BooleanUtils.isTrue(Config.zhengwuDingding().getEnable())
+				&& BooleanUtils.isTrue(Config.zhengwuDingding().getMessageEnable())) {
+			context().startQueue(zhengwuDingdingConsumeQueue);
+		}
+		if (Config.dingding().getEnable() && Config.dingding().getMessageEnable()) {
+			context().startQueue(dingdingConsumeQueue);
+		}
+		if (BooleanUtils.isTrue(Config.pushConfig().getEnable())) {
+			context().startQueue(pmsInnerConsumeQueue);
+		}
+		if (Config.weLink().getEnable() && Config.weLink().getMessageEnable()) {
+			context().startQueue(weLinkConsumeQueue);
+		}
+
+		if (BooleanUtils.isTrue(Config.mq().getEnable())) {
+			context().startQueue(mqConsumeQueue);
+		}
+	}
+
 	public static void destroy() {
 		try {
 			CacheManager.shutdown();
-			wsConsumeQueue.stop();
-			pmsConsumeQueue.stop();
-			calendarConsumeQueue.stop();
-			qiyeweixinConsumeQueue.stop();
-			zhengwuDingdingConsumeQueue.stop();
-			dingdingConsumeQueue.stop();
-			pmsInnerConsumeQueue.stop();
-			weLinkConsumeQueue.stop();
 			MessageConnector.stop();
 		} catch (Exception e) {
 			e.printStackTrace();

+ 6 - 2
o2server/x_mind_assemble_control/src/main/java/com/x/mind/assemble/control/ThisApplication.java

@@ -8,8 +8,13 @@ import com.x.base.core.project.message.MessageConnector;
 import com.x.mind.assemble.control.queue.QueueShareNotify;
 
 public class ThisApplication {
+
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
-	public static QueueShareNotify queueShareNotify;
+	public static final QueueShareNotify queueShareNotify = new QueueShareNotify();
 
 	public static Context context() {
 		return context;
@@ -19,7 +24,6 @@ public class ThisApplication {
 		try {
 			CacheManager.init(context.clazz().getSimpleName());
 			LoggerFactory.setLevel(Config.logLevel().x_mind_assemble_control());
-			queueShareNotify = new QueueShareNotify();
 			MessageConnector.start(context());
 			context().startQueue(queueShareNotify);
 		} catch (Exception e) {

+ 7 - 2
o2server/x_mind_assemble_control/src/main/webapp/describe/sources/com/x/mind/assemble/control/ThisApplication.java

@@ -8,8 +8,13 @@ import com.x.base.core.project.message.MessageConnector;
 import com.x.mind.assemble.control.queue.QueueShareNotify;
 
 public class ThisApplication {
+
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
-	public static QueueShareNotify queueShareNotify;
+	public static final QueueShareNotify queueShareNotify = new QueueShareNotify();
 
 	public static Context context() {
 		return context;
@@ -19,7 +24,6 @@ public class ThisApplication {
 		try {
 			CacheManager.init(context.clazz().getSimpleName());
 			LoggerFactory.setLevel(Config.logLevel().x_mind_assemble_control());
-			queueShareNotify = new QueueShareNotify();
 			MessageConnector.start(context());
 			context().startQueue(queueShareNotify);
 		} catch (Exception e) {
@@ -30,6 +34,7 @@ public class ThisApplication {
 
 	public static void destroy() {
 		try {
+			CacheManager.shutdown();
 			queueShareNotify.stop();
 		} catch (Exception e) {
 			e.printStackTrace();

+ 5 - 4
o2server/x_okr_assemble_control/src/main/java/com/x/okr/assemble/control/ThisApplication.java

@@ -20,13 +20,17 @@ import com.x.okr.assemble.control.service.OkrConfigSystemService;
 
 public class ThisApplication {
 
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
 
 	public static Map<String, CacheImportFileStatus> importFileStatusMap = new HashMap<String, CacheImportFileStatus>();
 
 	public static final String OKRMANAGER = "OKRManager";
 
-	public static QueueWorkDynamicRecord queueWorkDynamicRecord;
+	public static final QueueWorkDynamicRecord queueWorkDynamicRecord = new QueueWorkDynamicRecord();
 
 	public static Context context() {
 		return context;
@@ -36,11 +40,8 @@ public class ThisApplication {
 		try {
 			CacheManager.init(context.clazz().getSimpleName());
 			LoggerFactory.setLevel(Config.logLevel().x_okr_assemble_control());
-			queueWorkDynamicRecord = new QueueWorkDynamicRecord();
 			context().startQueue(queueWorkDynamicRecord);
-
 			new OkrConfigSystemService().initAllSystemConfig();
-
 			// 每天凌晨2点执行一次
 			context.schedule(St_WorkReportContent.class, "0 0 2 * * ?");
 			// 每天凌晨2点30执行一次

+ 6 - 4
o2server/x_okr_assemble_control/src/main/webapp/describe/sources/com/x/okr/assemble/control/ThisApplication.java

@@ -20,13 +20,17 @@ import com.x.okr.assemble.control.service.OkrConfigSystemService;
 
 public class ThisApplication {
 
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
 
 	public static Map<String, CacheImportFileStatus> importFileStatusMap = new HashMap<String, CacheImportFileStatus>();
 
 	public static final String OKRMANAGER = "OKRManager";
 
-	public static QueueWorkDynamicRecord queueWorkDynamicRecord;
+	public static final QueueWorkDynamicRecord queueWorkDynamicRecord = new QueueWorkDynamicRecord();
 
 	public static Context context() {
 		return context;
@@ -36,11 +40,8 @@ public class ThisApplication {
 		try {
 			CacheManager.init(context.clazz().getSimpleName());
 			LoggerFactory.setLevel(Config.logLevel().x_okr_assemble_control());
-			queueWorkDynamicRecord = new QueueWorkDynamicRecord();
 			context().startQueue(queueWorkDynamicRecord);
-
 			new OkrConfigSystemService().initAllSystemConfig();
-
 			// 每天凌晨2点执行一次
 			context.schedule(St_WorkReportContent.class, "0 0 2 * * ?");
 			// 每天凌晨2点30执行一次
@@ -63,6 +64,7 @@ public class ThisApplication {
 
 	public static void destroy() {
 		try {
+			CacheManager.shutdown();
 		} catch (Exception e) {
 			e.printStackTrace();
 		}

+ 5 - 2
o2server/x_organization_assemble_authentication/src/main/java/com/x/organization/assemble/authentication/ThisApplication.java

@@ -10,7 +10,11 @@ import com.x.organization.assemble.authentication.schedule.CleanupOauthCode;
 
 public class ThisApplication {
 
-	public static QueueLoginRecord queueLoginRecord;
+	private ThisApplication() {
+		// nothing
+	}
+
+	public static final QueueLoginRecord queueLoginRecord = new QueueLoginRecord();
 
 	protected static Context context;
 
@@ -22,7 +26,6 @@ public class ThisApplication {
 		try {
 			CacheManager.init(context.clazz().getSimpleName());
 			LoggerFactory.setLevel(Config.logLevel().x_organization_assemble_authentication());
-			queueLoginRecord = new QueueLoginRecord();
 			context.startQueue(queueLoginRecord);
 			context.schedule(CleanupBind.class, "0 */15 * * * ?");
 			context.schedule(CleanupOauthCode.class, "0 */15 * * * ?");

+ 4 - 0
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/ThisApplication.java

@@ -7,6 +7,10 @@ import com.x.base.core.project.logger.LoggerFactory;
 
 public class ThisApplication {
 
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
 
 	public static Context context() {

+ 4 - 0
o2server/x_organization_assemble_express/src/main/java/com/x/organization/assemble/express/ThisApplication.java

@@ -7,6 +7,10 @@ import com.x.base.core.project.logger.LoggerFactory;
 
 public class ThisApplication {
 
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
 
 	public static Context context() {

+ 4 - 0
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/ThisApplication.java

@@ -8,6 +8,10 @@ import com.x.organization.assemble.personal.schedule.DisableExpiredEmpower;
 
 public class ThisApplication {
 
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
 
 	public static Context context() {

+ 4 - 0
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/ThisApplication.java

@@ -7,6 +7,10 @@ import com.x.base.core.project.logger.LoggerFactory;
 
 public class ThisApplication {
 
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
 
 	public static Context context() {

+ 4 - 0
o2server/x_portal_assemble_surface/src/main/java/com/x/portal/assemble/surface/ThisApplication.java

@@ -7,6 +7,10 @@ import com.x.base.core.project.logger.LoggerFactory;
 
 public class ThisApplication {
 
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
 
 	public static Context context() {

+ 5 - 0
o2server/x_portal_assemble_surface/src/main/webapp/describe/sources/com/x/portal/assemble/surface/ThisApplication.java

@@ -7,6 +7,10 @@ import com.x.base.core.project.logger.LoggerFactory;
 
 public class ThisApplication {
 
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
 
 	public static Context context() {
@@ -24,6 +28,7 @@ public class ThisApplication {
 
 	public static void destroy() {
 		try {
+			CacheManager.shutdown();
 		} catch (Exception e) {
 			e.printStackTrace();
 		}

+ 4 - 0
o2server/x_processplatform_assemble_bam/src/main/java/com/x/processplatform/assemble/bam/ThisApplication.java

@@ -11,6 +11,10 @@ import com.x.processplatform.assemble.bam.schedule.StateTimer;
 
 public class ThisApplication {
 
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
 
 	public static Context context() {

+ 5 - 0
o2server/x_processplatform_assemble_bam/src/main/webapp/describe/sources/com/x/processplatform/assemble/bam/ThisApplication.java

@@ -11,6 +11,10 @@ import com.x.processplatform.assemble.bam.schedule.StateTimer;
 
 public class ThisApplication {
 
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
 
 	public static Context context() {
@@ -31,6 +35,7 @@ public class ThisApplication {
 
 	public static void destroy() {
 		try {
+			CacheManager.shutdown();
 		} catch (Exception e) {
 			e.printStackTrace();
 		}

+ 14 - 15
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/ThisApplication.java

@@ -8,13 +8,17 @@ import com.x.base.core.project.message.MessageConnector;
 
 public class ThisApplication {
 
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
 
-	public static ProjectionExecuteQueue projectionExecuteQueue = new ProjectionExecuteQueue();
-	public static MappingExecuteQueue mappingExecuteQueue = new MappingExecuteQueue();
-	public static FormVersionQueue formVersionQueue = new FormVersionQueue();
-	public static ProcessVersionQueue processVersionQueue = new ProcessVersionQueue();
-	public static ScriptVersionQueue scriptVersionQueue = new ScriptVersionQueue();
+	public static final ProjectionExecuteQueue projectionExecuteQueue = new ProjectionExecuteQueue();
+	public static final MappingExecuteQueue mappingExecuteQueue = new MappingExecuteQueue();
+	public static final FormVersionQueue formVersionQueue = new FormVersionQueue();
+	public static final ProcessVersionQueue processVersionQueue = new ProcessVersionQueue();
+	public static final ScriptVersionQueue scriptVersionQueue = new ScriptVersionQueue();
 
 	public static Context context() {
 		return context;
@@ -25,11 +29,11 @@ public class ThisApplication {
 			CacheManager.init(context.clazz().getSimpleName());
 			LoggerFactory.setLevel(Config.logLevel().x_processplatform_assemble_designer());
 			MessageConnector.start(context());
-			projectionExecuteQueue.start();
-			mappingExecuteQueue.start();
-			formVersionQueue.start();
-			processVersionQueue.start();
-			scriptVersionQueue.start();
+			context().startQueue(projectionExecuteQueue);
+			context().startQueue(mappingExecuteQueue);
+			context().startQueue(formVersionQueue);
+			context().startQueue(processVersionQueue);
+			context().startQueue(scriptVersionQueue);
 		} catch (Exception e) {
 			e.printStackTrace();
 		}
@@ -38,11 +42,6 @@ public class ThisApplication {
 	public static void destroy() {
 		try {
 			CacheManager.shutdown();
-			projectionExecuteQueue.stop();
-			mappingExecuteQueue.stop();
-			formVersionQueue.stop();
-			processVersionQueue.stop();
-			scriptVersionQueue.stop();
 			MessageConnector.stop();
 		} catch (Exception e) {
 			e.printStackTrace();

+ 4 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/ThisApplication.java

@@ -8,6 +8,10 @@ import com.x.processplatform.assemble.surface.schedule.CleanKeyLock;
 
 public class ThisApplication {
 
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
 
 	public static Context context() {

+ 7 - 3
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/ThisApplication.java

@@ -21,13 +21,17 @@ import org.apache.commons.lang3.BooleanUtils;
 
 public class ThisApplication {
 
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
 
-	public static SyncJaxrsInvokeQueue syncJaxrsInvokeQueue = new SyncJaxrsInvokeQueue();
+	public static final SyncJaxrsInvokeQueue syncJaxrsInvokeQueue = new SyncJaxrsInvokeQueue();
 
-	public static SyncJaxwsInvokeQueue syncJaxwsInvokeQueue = new SyncJaxwsInvokeQueue();
+	public static final SyncJaxwsInvokeQueue syncJaxwsInvokeQueue = new SyncJaxwsInvokeQueue();
 
-	public static SyncEmbedQueue syncEmbedQueue = new SyncEmbedQueue();
+	public static final SyncEmbedQueue syncEmbedQueue = new SyncEmbedQueue();
 
 	public static Context context() {
 		return context;

+ 16 - 10
o2server/x_program_center/src/main/java/com/x/program/center/ThisApplication.java

@@ -5,6 +5,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
+import org.apache.commons.lang3.BooleanUtils;
+
 import com.google.gson.internal.LinkedTreeMap;
 import com.x.base.core.project.config.Config;
 import com.x.base.core.project.logger.LoggerFactory;
@@ -28,23 +30,27 @@ import com.x.program.center.schedule.ZhengwuDingdingSyncOrganizationTrigger;
 
 public class ThisApplication {
 
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
 
 	public static Context context() {
 		return context;
 	}
 
-	public static CenterQueue centerQueue = new CenterQueue();
+	public static final CenterQueue centerQueue = new CenterQueue();
 
-	public static LogQueue logQueue = new LogQueue();
+	public static final LogQueue logQueue = new LogQueue();
 
-	public static List<Object> dingdingSyncOrganizationCallbackRequest = new ArrayList<>();
+	public static final List<Object> dingdingSyncOrganizationCallbackRequest = new ArrayList<>();
 
-	public static List<Object> weLinkSyncOrganizationCallbackRequest = new ArrayList<>();
+	public static final List<Object> weLinkSyncOrganizationCallbackRequest = new ArrayList<>();
 
-	public static List<Object> zhengwuDingdingSyncOrganizationCallbackRequest = new ArrayList<>();
+	public static final List<Object> zhengwuDingdingSyncOrganizationCallbackRequest = new ArrayList<>();
 
-	public static List<Object> qiyeweixinSyncOrganizationCallbackRequest = new ArrayList<>();
+	public static final List<Object> qiyeweixinSyncOrganizationCallbackRequest = new ArrayList<>();
 
 	public static Map<String, Map<String, LinkedTreeMap>> metricsReportMap = new ConcurrentHashMap<>();
 
@@ -56,7 +62,7 @@ public class ThisApplication {
 			context().startQueue(logQueue);
 
 			/* 政务钉钉拉入同步 */
-			if (Config.zhengwuDingding().getEnable()) {
+			if (BooleanUtils.isNotTrue(Config.zhengwuDingding().getEnable())) {
 				/* 启动同步任务 */
 				context().scheduleLocal(ZhengwuDingdingSyncOrganization.class, Config.zhengwuDingding().getSyncCron());
 				/* 添加一个强制同步任务 */
@@ -64,7 +70,7 @@ public class ThisApplication {
 						Config.zhengwuDingding().getForceSyncCron());
 			}
 			/* 企业微信拉入同步 */
-			if (Config.qiyeweixin().getEnable()) {
+			if (BooleanUtils.isNotTrue(Config.qiyeweixin().getEnable())) {
 				/* 启动同步任务 */
 				context().scheduleLocal(QiyeweixinSyncOrganization.class, Config.qiyeweixin().getSyncCron());
 				/* 添加一个强制同步任务 */
@@ -72,14 +78,14 @@ public class ThisApplication {
 						Config.qiyeweixin().getForceSyncCron());
 			}
 			/* 钉钉同步 */
-			if (Config.dingding().getEnable()) {
+			if (BooleanUtils.isNotTrue(Config.dingding().getEnable())) {
 				/* 启动同步任务 */
 				context().scheduleLocal(DingdingSyncOrganization.class, Config.dingding().getSyncCron());
 				/* 添加一个强制同步任务 */
 				context().scheduleLocal(DingdingSyncOrganizationTrigger.class, Config.dingding().getForceSyncCron());
 			}
 			/* WeLink同步 */
-			if (Config.weLink().getEnable()) {
+			if (BooleanUtils.isNotTrue(Config.weLink().getEnable())) {
 				/* 启动同步任务 */
 				context().scheduleLocal(WeLinkSyncOrganization.class, Config.weLink().getSyncCron());
 				/* 添加一个强制同步任务 */

+ 4 - 0
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/ThisApplication.java

@@ -7,6 +7,10 @@ import com.x.base.core.project.logger.LoggerFactory;
 
 public class ThisApplication {
 
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
 
 	public static Context context() {

+ 4 - 0
o2server/x_query_assemble_surface/src/main/java/com/x/query/assemble/surface/ThisApplication.java

@@ -7,6 +7,10 @@ import com.x.base.core.project.logger.LoggerFactory;
 
 public class ThisApplication {
 
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
 
 	public static Context context() {

+ 4 - 0
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/ThisApplication.java

@@ -12,6 +12,10 @@ import com.x.query.service.processing.schedule.CrawlWorkCompleted;
 
 public class ThisApplication {
 
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
 
 	public static Context context() {

+ 4 - 0
o2server/x_query_service_processing/src/main/webapp/describe/sources/com/x/query/service/processing/ThisApplication.java

@@ -12,6 +12,10 @@ import com.x.query.service.processing.schedule.CrawlWorkCompleted;
 
 public class ThisApplication {
 
+	private ThisApplication() {
+		// nothing
+	}
+
 	protected static Context context;
 
 	public static Context context() {

+ 11 - 1
o2server/x_query_service_processing/src/main/webapp/describe/sources/com/x/query/service/processing/jaxrs/test/ActionGroup2.java

@@ -1,6 +1,11 @@
 package com.x.query.service.processing.jaxrs.test;
 
+import java.util.ArrayList;
+
+import javax.script.Bindings;
+import javax.script.ScriptContext;
 import javax.script.ScriptEngine;
+import javax.script.SimpleScriptContext;
 
 import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.container.factory.EntityManagerContainerFactory;
@@ -19,7 +24,12 @@ class ActionGroup2 extends BaseAction {
 		try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
 			ActionResult<Wo> result = new ActionResult<>();
 			ScriptEngine engine = ScriptFactory.newScriptEngine();
-			Object o = engine.eval("this.data && this.data.length");
+			ScriptContext scriptContext = new SimpleScriptContext();
+			Bindings bindings = scriptContext.getBindings(ScriptContext.ENGINE_SCOPE);
+			bindings.put("data", new ArrayList<>());
+			engine.setContext(scriptContext);
+			engine.eval("var o = this.data && this.data.length;");
+			Object o = engine.eval("o;");
 			System.out.println(o.getClass());
 			return result;
 		}