EntitiesBundleMonitor.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:motech 作者:
/**
 * Receives notification that the context of the entities bundle has had a lifecycle change and
 * checks it current status.
 *
 * @param event The {@code ServiceEvent} object.
 */
@Override
public void serviceChanged(ServiceEvent event) {
    ServiceReference<?> reference = event.getServiceReference();

    if (isEntities(reference.getBundle())) {
        Object service = bundleContext.getService(reference);

        if (service instanceof ApplicationContext) {
            LOGGER.trace(
                    "The Entities Bundle Application Context Status: {}",
                    nullSafeToString(event)
            );

            synchronized (lock) {
                contextInitialized = event.getType() != ServiceEvent.UNREGISTERING;

                if (contextInitialized) {
                    LOGGER.info("The entities bundle context has been initialized");
                } else {
                    LOGGER.info("The entities bundle context has been unregistered");
                }
            }
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号