我开始为jira开发插件但是在添加事件监听器类之后我遇到了元空间(screen)的问题
@Component
public class IssueEventListener implements InitializingBean, DisposableBean {
private static final Logger log =
LoggerFactory.getLogger(IssueEventListener.class);
@JiraImport
private final EventPublisher publisher;
@Autowired
public IssueEventListener(@JiraImport EventPublisher publisher) {
this.publisher = publisher;
}
/**
* Called when the plugin has been enabled.
* @throws Exception
*/
@Override
public void afterPropertiesSet() throws Exception {
log.info("Enabling plugin");
publisher.register(this);
}
/**
* Called when the plugin is being disabled or removed.
* @throws Exception
*/
@Override
public void destroy() throws Exception {
log.info("Disabling plugin");
publisher.unregister(this);
}
@EventListener
public void onIssueEvent(IssueEvent issueEvent) throws Exception {
Long eventTypeId = issueEvent.getEventTypeId();
Issue issue = issueEvent.getIssue();
IssueAction action = null;
if (eventTypeId.equals(EventType.ISSUE_CREATED_ID)) {
action = new CreateAction();
log.info("Issue {} has been created at {}.", issue.getKey(),
issue.getCreated());
} else if (eventTypeId.equals(EventType.ISSUE_RESOLVED_ID)) {
action = new ResolveAction();
log.info("Issue {} has been resolved at {}.", issue.getKey(),
issue.getResolutionDate());
} else if (eventTypeId.equals(EventType.ISSUE_CLOSED_ID)) {
action = new CloseAction();
log.info("Issue {} has been closed at {}.", issue.getKey(),
issue.getUpdated());
} else if(eventTypeId.equals(EventType.ISSUE_DELETED_ID)) {
action = new DeleteAction();
log.info("Issue {} has been closed at {}.", issue.getKey(),
issue.getUpdated());
}
if (action != null) {
action.execute(issueEvent);
} else {
throw new Exception("Can not find action");
}
}
}
当我使用atlas-run命令启动服务器时,我在控制台中也有警告:(console screen)。
Idk如何增加缓存的最大大小,有人可以解释我应该如何以及在哪里做它?
谢谢!