本文整理汇总了Java中com.networknt.service.SingletonServiceFactory.getBeans方法的典型用法代码示例。如果您正苦于以下问题:Java SingletonServiceFactory.getBeans方法的具体用法?Java SingletonServiceFactory.getBeans怎么用?Java SingletonServiceFactory.getBeans使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.networknt.service.SingletonServiceFactory
的用法示例。
在下文中一共展示了SingletonServiceFactory.getBeans方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shutdown
import com.networknt.service.SingletonServiceFactory; //导入方法依赖的package包/类
static public void shutdown() {
// need to unregister the service
if(config.enableRegistry && registry != null && config.enableHttp) {
registry.unregister(serviceHttpUrl);
if(logger.isInfoEnabled()) logger.info("unregister serviceHttpUrl " + serviceHttpUrl);
}
if(config.enableRegistry && registry != null && config.enableHttps) {
registry.unregister(serviceHttpsUrl);
if(logger.isInfoEnabled()) logger.info("unregister serviceHttpsUrl " + serviceHttpsUrl);
}
ShutdownHookProvider[] shutdownHookProviders = SingletonServiceFactory.getBeans(ShutdownHookProvider.class);
if(shutdownHookProviders != null) Arrays.stream(shutdownHookProviders).forEach(s -> s.onShutdown());
stop();
logger.info("Cleaning up before server shutdown");
}
示例2: FrameworkRegistry
import com.networknt.service.SingletonServiceFactory; //导入方法依赖的package包/类
private FrameworkRegistry() {
Generator[] generators = SingletonServiceFactory.getBeans(Generator.class);
final Map<String, Generator> map = new HashMap<>();
if(generators != null) Arrays.stream(generators).forEach(s -> map.put(s.getFramework(), s));
this.frameworks = Collections.unmodifiableMap(map);
}