com.github.lontime.extspring.components.StartupComponentExt Maven / Gradle / Ivy
package com.github.lontime.extspring.components;
import java.util.List;
import org.springframework.beans.factory.SmartInitializingSingleton;
import com.github.lontime.base.commonj.components.ActiveComponents;
import com.github.lontime.base.commonj.components.ComponentLifecycle;
import com.github.lontime.base.commonj.utils.LoggerHelper;
/**
* StartupComponentExt.
* @author lontime
* @since 1.0
*/
public class StartupComponentExt implements SmartInitializingSingleton {
@Override
public void afterSingletonsInstantiated() {
LoggerHelper.info(getClass(), "afterSingletonsInstantiated: total active components:{0}", ActiveComponents.size());
final List components = ActiveComponents.getAll();
for (ComponentLifecycle component : components) {
component.reentrantStart();
}
for (ComponentLifecycle component : components) {
if (!component.awaitRunning()) {
LoggerHelper.warn(getClass(), "afterSingletonsInstantiated: component {0} is not running!", component.getName());
}
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy