【发布时间】:2018-02-03 11:35:53
【问题描述】:
在Liferay's documentation about making modules configurable 之后,我编写了这个 Liferay 7 模块:
@Component(configurationPid = "myproject.api.TranslationConfiguration")
public class TranslationServiceImpl implements TranslationService {
private volatile TranslationConfiguration configuration;
public TranslationServiceImpl() {
log.info("TranslationServiceImpl constructor");
}
@Activate
@Modified
protected void activate(Map<String, Object> properties) {
log.info("Hello from activate");
}
}
当我部署时,日志只显示:
TranslationServiceImpl constructor
Service registered.
STARTED myproject.impl_1.0.0 [538]
为什么没有调用activate 方法?
在 Gogo Shell 中重启模块也不会调用activate。
【问题讨论】: