提交 6d36bf68 编写于 作者: 街头小贩's avatar 街头小贩

不再使用CubbyHoleLinkedDeque,处理线程存在因异常而中止工作

上级 69eff3a0
package com.apobates.forum.core.impl;
import com.apobates.forum.core.entity.ActionEventDescriptor;
import com.apobates.forum.utils.cache.AbstractCubbyHole;
import com.apobates.forum.utils.cache.CubbyHoleLinkedDeque;
import com.apobates.forum.utils.cache.CubbyHoleProcessor;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
......@@ -26,7 +22,7 @@ public class CoreAppConfig {
public CoreModuleActionEventAspect buildCmae() {
return new com.apobates.forum.core.impl.CoreModuleActionEventAspect();
}
/*
@Bean
public CubbyHoleProcessor<ActionEventDescriptor> getCubbyHoleProcessor(){
return new ActionEventCubbyHoleProcessor();
......@@ -35,5 +31,5 @@ public class CoreAppConfig {
@Bean("cubbyHole")
public AbstractCubbyHole<ActionEventDescriptor> getCubbyHole(CubbyHoleProcessor<ActionEventDescriptor> cubbyHoleProcessor){
return new CubbyHoleLinkedDeque<>(cubbyHoleProcessor);
}
}*/
}
\ No newline at end of file
package com.apobates.forum.core.impl;
import com.apobates.forum.core.dao.BoardActionCollectionDao;
import com.apobates.forum.core.dao.BoardDao;
import com.apobates.forum.core.dao.PostsDao;
import com.apobates.forum.core.dao.TopicActionCollectionDao;
import com.apobates.forum.core.dao.TopicDao;
import com.apobates.forum.core.entity.ActionEventDescriptor;
import com.apobates.forum.core.entity.Board;
import com.apobates.forum.core.entity.BoardActionCollection;
import com.apobates.forum.core.entity.Posts;
......@@ -11,7 +12,6 @@ import com.apobates.forum.core.entity.Topic;
import com.apobates.forum.core.entity.TopicActionCollection;
import com.apobates.forum.event.elderly.ActionEventCulpritor;
import com.apobates.forum.event.elderly.ForumActionEnum;
import com.apobates.forum.utils.cache.AbstractCubbyHole;
import java.util.Optional;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
......@@ -35,8 +35,12 @@ public class CoreModuleActionEventAspect {
private TopicDao topicDao;
@Autowired
private PostsDao postsDao;
//@Autowired
//private AbstractCubbyHole<ActionEventDescriptor> cubbyHole;
@Autowired
private AbstractCubbyHole<ActionEventDescriptor> cubbyHole;
private BoardActionCollectionDao boardActionCollectionDao;
@Autowired
private TopicActionCollectionDao topicActionCollectionDao;
private final static Logger logger = LoggerFactory.getLogger(CoreModuleActionEventAspect.class);
@Before("execution(* com.apobates.forum.core.impl.service.*.*(..)) && @annotation(actionDescriptor)")
......@@ -104,8 +108,8 @@ public class CoreModuleActionEventAspect {
}else {
entity = buildTopicAction(id, culpritor, actionDescriptor);
}
//topicActionCollectionDao.save(entity);
cubbyHole.put(entity);
topicActionCollectionDao.save(entity);
//cubbyHole.put(entity);
}
private TopicActionCollection buildTopicAction(long topicId, ActionEventCulpritor culpritor, ActionDescriptor actionDescriptor){
......@@ -146,8 +150,8 @@ public class CoreModuleActionEventAspect {
long rodeMember = culpritor.getMemberId();
logger.info("[CAT]12>7.1 board id: "+board.getId()+", title: "+board.getTitle());
BoardActionCollection entity = new BoardActionCollection(actionDescriptor.action(), board.getTitle(), primaryKey, culpritor, rodeMember);
//boardActionCollectionDao.save(entity);
cubbyHole.put(entity);
boardActionCollectionDao.save(entity);
//cubbyHole.put(entity);
}
private Long getPrimaryKey(Object[] paramValues, String[] paramNames, String keyName) {
......
......@@ -5,7 +5,7 @@ import org.apache.commons.lang3.tuple.ImmutablePair;
/**
* 双参数的执行函数
* @deprecated
*
* @param <T> 条件的第一个参数类型
* @param <U> 条件的第二个参数类型
* @author xiaofanku
......
......@@ -4,7 +4,7 @@ import java.util.function.Predicate;
/**
* 单参数的执行函数
* @deprecated
*
* @param <T> 条件的参数类型
* @author xiaofanku
* @since 20200805
......
......@@ -4,7 +4,7 @@ import org.apache.commons.lang3.tuple.ImmutableTriple;
/**
* 三个参数的执行函数
* @deprecated
*
* @param <T> 条件的第一个参数类型
* @param <U> 条件的第二个参数类型
* @param <V> 条件的第三个参数类型
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册