Here are the examples of the java api org.springframework.context.event.ContextRefreshedEvent taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
312 Examples
19
Source : VersionRefreshScope.java
with Apache License 2.0
from zouzhirong
with Apache License 2.0
from zouzhirong
public void start(ContextRefreshedEvent event) {
if (event.getApplicationContext() == this.context) {
if (this.eager && this.registry != null) {
for (String name : this.context.getBeanDefinitionNames()) {
BeanDefinition definition = this.registry.getBeanDefinition(name);
if (this.getName().equals(definition.getScope()) && !definition.isLazyInit()) {
this.context.getBean(name);
}
}
}
}
}
19
Source : VersionRefreshScope.java
with Apache License 2.0
from zouzhirong
with Apache License 2.0
from zouzhirong
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
start(event);
}
19
Source : LicenseCheckListener.java
with Apache License 2.0
from zifangsky
with Apache License 2.0
from zifangsky
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
// root application context 没有parent
ApplicationContext context = event.getApplicationContext().getParent();
if (context == null) {
if (StringUtils.isNotBlank(licensePath)) {
logger.info("++++++++ 开始安装证书 ++++++++");
LicenseVerifyParam param = new LicenseVerifyParam();
param.setSubject(subject);
param.setPublicAlias(publicAlias);
param.setStorePreplaced(storePreplaced);
param.setLicensePath(licensePath);
param.setPublicKeysStorePath(publicKeysStorePath);
LicenseVerify licenseVerify = new LicenseVerify();
// 安装证书
licenseVerify.install(param);
logger.info("++++++++ 证书安装结束 ++++++++");
}
}
}
19
Source : AbstractScanner.java
with Apache License 2.0
from zhongxunking
with Apache License 2.0
from zhongxunking
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
// 扫描
String[] beanNames = event.getApplicationContext().getBeanNamesForAnnotation(annotationType);
for (String beanName : beanNames) {
onScan(event.getApplicationContext().getBean(beanName));
}
}
19
Source : FlowerApplicationListener.java
with Apache License 2.0
from zhihuili
with Apache License 2.0
from zhihuili
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
registerFlowerService();
}
19
Source : DDDFactory.java
with Apache License 2.0
from zhihuili
with Apache License 2.0
from zhihuili
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
if (serviceTypes != null) {
for (String serviceType : serviceTypes) {
try {
Clreplaced<?> serviceClreplaced = Clreplaced.forName(serviceType);
String serviceName = FlowerServiceUtil.getServiceName(serviceClreplaced);
FlowerService flowerService = (FlowerService) applicationContext.getBean(serviceClreplaced);
flowerFactory.getServiceFactory().registerFlowerService(serviceName, flowerService);
} catch (ClreplacedNotFoundException e) {
logger.error("", e);
}
}
}
}
19
Source : QueueListener.java
with MIT License
from ZeroOrInfinity
with MIT License
from ZeroOrInfinity
@Override
public void onApplicationEvent(@NonNull ContextRefreshedEvent event) {
new Thread(() -> {
String orderNumber;
while (true) {
orderNumber = mockQueue.getCompleteOrder();
if (StringUtils.isNotBlank(orderNumber)) {
log.info("返回订单处理结果:{}", orderNumber);
deferredResultHolder.getMap().get(orderNumber).setResult("place order success " + orderNumber);
mockQueue.setCompleteOrder(null);
} else {
try {
TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException e) {
log.error("线程睡眠出错!", e);
}
}
}
}, "deferredResultThread").start();
}
19
Source : ApplicationStartupListener.java
with Apache License 2.0
from zc-zh-001
with Apache License 2.0
from zc-zh-001
/**
* 系统启动 监听事件
*/
@Async
@EventListener
public void handleOrderStateChange(ContextRefreshedEvent contextRefreshedEvent) {
crawlerSet.parallelStream().forEach((service) -> shadowSocksSerivce.crawlerAndSave(service));
log.debug("================>{}", "初始扫描完成...");
}
19
Source : CustomSpringListener.java
with Apache License 2.0
from yuanmabiji
with Apache License 2.0
from yuanmabiji
@Override
public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
System.out.println("=======I am a cuctom ContextRefreshedEvent listener,I am listening ContextRefreshedEvent=====");
}
19
Source : CustomSpringBootListener2.java
with Apache License 2.0
from yuanmabiji
with Apache License 2.0
from yuanmabiji
/**
* Handle an application event.
* FileEncodingApplicationListener
* @param event the event to respond to
*/
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
System.out.println("===============用SpringBoot自定义监听器来监听Spring的生命周期事件==================");
}
19
Source : ClearCachesApplicationListener.java
with Apache License 2.0
from yuanmabiji
with Apache License 2.0
from yuanmabiji
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
ReflectionUtils.clearCache();
clearClreplacedLoaderCaches(Thread.currentThread().getContextClreplacedLoader());
}
19
Source : QueueListener.java
with MIT License
from yizzuide
with MIT License
from yizzuide
@Override
public void onApplicationEvent(@NonNull ContextRefreshedEvent contextRefreshedEvent) {
// 模拟另一个线程从队列里取得DeferredResult后处理响应
new Thread(() -> {
while (true) {
DeferredResult<Object> deferredResult = PulsarHolder.getPulsar().getDeferredResult("84735252737");
if (null != deferredResult) {
// 模拟超时
/*try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}*/
User user = new User();
user.setId(1L);
user.setName("yiz");
deferredResult.setResult(user);
}
try {
// 延时处理
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}).start();
}
19
Source : MilkomedaApplicationListener.java
with MIT License
from yizzuide
with MIT License
from yizzuide
// yml配置的实体需要使用@Lazy!!!
// @Lazy
// @Resource
// private JupiterRuleEngine jupiterRuleEngine;
@Override
public void onApplicationEvent(@NonNull ContextRefreshedEvent event) {
// 设置延迟队列实例名
IceHolder.setInstanceName("product");
// 激活Dead queue里的job(重试超过次数的job)
IceHolder.activeDeadJobs();
// 调用环境变量,给Spring EL表达 #env 提供数据源
ApplicationContextHolder.getEnvironment().put("product", "milkomeda");
// 从json配置加载覆盖yml配置
// String ruleItems = "[{\"match\":\"true\"},{\"domain\":\"t_order\",\"fields\":\"id\",\"filter\":\"user_id={$attr.userInfo.uid}\",\"match\":\"size()==0\",\"syntax\":\"el\"}]";
// jupiterRuleEngine.resetRule("payRule", JSONUtil.parseList(ruleItems, JupiterRuleItem.clreplaced));
}
19
Source : MetalContextListener.java
with MIT License
from yizzuide
with MIT License
from yizzuide
@Override
public void onApplicationEvent(@NonNull ContextRefreshedEvent event) {
log.info("正加载配置源...");
// 模拟配置源
Map<String, String> source = new HashMap<>();
source.put("env", "dev");
source.put("version", "1.0");
source.put("platform", "mk");
source.put("fee_rate_config", "{\"service\":0.53, \"inst\": 0.3}");
MetalHolder.init(source);
}
19
Source : WormholeRegistration.java
with MIT License
from yizzuide
with MIT License
from yizzuide
@EventListener
public void onApplicationEvent(@NonNull ContextRefreshedEvent event) {
actionMap = AopContextHolder.getHandlerMetaData(WormholeEventHandler.clreplaced, WormholeAction.clreplaced, (annotation, handlerAnnotation, metaData) -> {
WormholeAction wormholeAction = (WormholeAction) annotation;
boolean isAsyncPresentOn = metaData.getMethod().isAnnotationPresent(Async.clreplaced);
Map<String, Object> attrs = new HashMap<>(4);
attrs.put(ATTR_HANG_TYPE, wormholeAction.transactionHang());
attrs.put(ATTR_ASYNC, isAsyncPresentOn);
metaData.setAttributes(attrs);
return wormholeAction.value();
}, false);
// 领域事件跟踪处理器
List<WormholeEventTrack> trackers = AopContextHolder.getTypeHandlers(WormholeEventTracker.clreplaced);
if (!CollectionUtils.isEmpty(trackers)) {
eventBus.setTrackers(trackers);
}
}
19
Source : PillarEntryContext.java
with MIT License
from yizzuide
with MIT License
from yizzuide
@Override
public void onApplicationEvent(@NonNull ContextRefreshedEvent event) {
pillarEntryMap = AopContextHolder.getHandlerMetaData(PillarEntryHandler.clreplaced, PillarEntryPoint.clreplaced, (annotation, handlerAnnotation, metaData) -> {
PillarEntryHandler pillarEntryHandler = (PillarEntryHandler) handlerAnnotation;
PillarEntryPoint pillarEntryPoint = (PillarEntryPoint) annotation;
String tag = pillarEntryHandler.tag();
if (StringUtils.isEmpty(tag)) {
tag = pillarEntryPoint.tag();
}
// 设置其它属性方法的值
Map<String, Object> attrs = new HashMap<>(2);
attrs.put(ATTR_CODE, pillarEntryPoint.code());
metaData.setAttributes(attrs);
return tag;
}, false);
}
19
Source : IceContext.java
with MIT License
from yizzuide
with MIT License
from yizzuide
@Override
public void onApplicationEvent(@NonNull ContextRefreshedEvent event) {
topicMap = AopContextHolder.getHandlerMetaData(IceHandler.clreplaced, IceListener.clreplaced, (annotation, handlerAnnotation, metaData) -> {
IceListener iceListener = (IceListener) annotation;
return iceListener.value();
}, !props.isMulreplacedopicListenerPerHandler());
topicTtrMap = AopContextHolder.getHandlerMetaData(IceHandler.clreplaced, IceTtrListener.clreplaced, (annotation, handlerAnnotation, metaData) -> {
IceTtrListener iceTtrListener = (IceTtrListener) annotation;
return iceTtrListener.value();
}, !props.isMulreplacedopicListenerPerHandler());
topicTtrOverloadMap = AopContextHolder.getHandlerMetaData(IceHandler.clreplaced, IceTtrOverloadListener.clreplaced, (annotation, handlerAnnotation, metaData) -> {
IceTtrOverloadListener iceTtrOverloadListener = (IceTtrOverloadListener) annotation;
return iceTtrOverloadListener.value();
}, !props.isMulreplacedopicListenerPerHandler());
}
19
Source : HaloContext.java
with MIT License
from yizzuide
with MIT License
from yizzuide
@Override
public void onApplicationEvent(@NonNull ContextRefreshedEvent event) {
tableNameMap = AopContextHolder.getHandlerMetaData(HaloHandler.clreplaced, HaloListener.clreplaced, (annotation, handlerAnnotation, metaData) -> {
HaloListener haloListener = (HaloListener) annotation;
// 设置其它属性方法的值
Map<String, Object> attrs = new HashMap<>(4);
attrs.put(ATTR_TYPE, haloListener.type());
metaData.setAttributes(attrs);
String value = haloListener.value();
cacheWithType(haloListener.type() == HaloType.PRE ? preTableNameMap : postTableNameMap, value, metaData);
return value;
}, false);
}
19
Source : FusionRegistration.java
with MIT License
from yizzuide
with MIT License
from yizzuide
@EventListener
public void onApplicationEvent(@NonNull ContextRefreshedEvent event) {
actionMap = AopContextHolder.getHandlerMetaData(FusionHandler.clreplaced, FusionAction.clreplaced, (annotation, handlerAnnotation, metaData) -> {
FusionAction fusionAction = (FusionAction) annotation;
return fusionAction.value();
}, false);
if (fusionAspect.getConverter() == null) {
fusionAspect.setConverter((tag, returnObj, error) -> {
List<HandlerMetaData> handlerMetaDataList = actionMap.get(tag);
if (CollectionUtils.isEmpty(handlerMetaDataList)) {
return returnObj;
}
HandlerMetaData handlerMetaData = handlerMetaDataList.get(0);
FusionMetaData<?> fusionMetaData = FusionMetaData.builder().returnData(returnObj).error(returnObj == null).msg(error).build();
try {
return handlerMetaData.getMethod().invoke(handlerMetaData.getTarget(), fusionMetaData);
} catch (Exception e) {
log.error("Fusion invoke error with msg: {}", e.getMessage(), e);
}
return returnObj;
});
}
}
19
Source : ApplicationStartup.java
with MIT License
from Yirendai
with MIT License
from Yirendai
@Override
public void onApplicationEvent(final ContextRefreshedEvent event) {
start();
}
19
Source : RocketMqAutoConfiguration.java
with Apache License 2.0
from yihonglei
with Apache License 2.0
from yihonglei
@Override
public void onApplicationEvent(ContextRefreshedEvent refreshedEvent) {
ApplicationContext context = refreshedEvent.getApplicationContext();
if (context == null || context.getParent() != null) {
return;
}
Map<String, LifeCycle> map = context.getBeansOfType(LifeCycle.clreplaced, false, false);
if (map != null) {
map.forEach((k, v) -> {
v.start();
logger.info("启动成功完成 key:[{}] value:[{}] 启动状态:[{}]", k, v, v.isStart());
});
MAP = map;
}
}
19
Source : ApplicationEvent.java
with Apache License 2.0
from xunibidev
with Apache License 2.0
from xunibidev
@Override
public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
log.info("====应用初始化完成,开启CoinProcessor====");
List<ExchangeCoin> coins = coinService.findAllEnabled();
coins.forEach(coin -> {
CoinProcessor processor = coinProcessorFactory.getProcessor(coin.getSymbol());
processor.initializeThumb();
processor.initializeUsdRate();
processor.setIsHalt(false);
});
}
19
Source : ExchangeSpringEvent.java
with Apache License 2.0
from xunibidev
with Apache License 2.0
from xunibidev
@Override
public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
log.info("======程序启动成功======");
// coinTraderFactory.getTraderMap();
/*
HashMap<String,CoinTrader> traders = coinTraderFactory.getTraderMap();
traders.forEach((symbol,trader) ->{
List<ExchangeOrder> orders = exchangeOrderService.findAllTradingOrderBySymbol(symbol);
List<ExchangeOrder> tradingOrders = new ArrayList<>();
orders.forEach(order -> {
BigDecimal tradedAmount = BigDecimal.ZERO;
BigDecimal turnover = BigDecimal.ZERO;
List<ExchangeOrderDetail> details = exchangeOrderDetailService.findAllByOrderId(order.getOrderId());
order.setDetail(details);
for(ExchangeOrderDetail trade:details){
tradedAmount = tradedAmount.add(trade.getAmount());
turnover = turnover.add(trade.getAmount().multiply(trade.getPrice()));
}
order.setTradedAmount(tradedAmount);
order.setTurnover(turnover);
if(!order.isCompleted()){
tradingOrders.add(order);
}
});
try {
trader.trade(tradingOrders);
} catch (ParseException e) {
e.printStackTrace();
log.info("异常:Exchange Spring Event:trader.trade(tradingOrders);");
}
});
*/
}
19
Source : NettyServer.java
with Apache License 2.0
from Xlinlin
with Apache License 2.0
from Xlinlin
@Override
public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
initNetty();
setHandler();
start();
// 启动后5S开始检查Netty server的状态,每个2两分钟执行一次
scheduledExecutorService.scheduleAtFixedRate(() -> check(), 1, 2, TimeUnit.MINUTES);
}
19
Source : DisruptorProducer.java
with Apache License 2.0
from Xlinlin
with Apache License 2.0
from Xlinlin
@Override
public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
log.info("Start disruptor..........");
doStart();
}
19
Source : DisruptorServiceImpl.java
with Apache License 2.0
from Xlinlin
with Apache License 2.0
from Xlinlin
@Override
public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
initAllCacheService();
}
19
Source : DisruptorProducer.java
with Apache License 2.0
from Xlinlin
with Apache License 2.0
from Xlinlin
@Override
public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
log.info(">>> Disruptor producer 启动......");
doStart();
}
19
Source : CanalClientService.java
with Apache License 2.0
from Xlinlin
with Apache License 2.0
from Xlinlin
@Override
public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
log.info(">>> Creplaced启动......");
init();
// 执行启动
creplacedExecutor.execute(() -> start());
// 启动后5S开始检查connector的状态,每个2两分钟执行一次
scheduledExecutorService.scheduleAtFixedRate(() -> check(), 1, 2, TimeUnit.MINUTES);
}
19
Source : PropertyLogger.java
with GNU General Public License v3.0
from wlhbdp
with GNU General Public License v3.0
from wlhbdp
@EventListener
public void handleContextRefresh(ContextRefreshedEvent event) {
logProperties(event.getApplicationContext());
}
19
Source : InitializationListener.java
with Apache License 2.0
from wjggwm
with Apache License 2.0
from wjggwm
/* (non-Javadoc)
* @see org.springframework.context.ApplicationListener#onApplicationEvent(org.springframework.context.ApplicationEvent)
*/
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
if (null == event.getApplicationContext().getParent()) {
/**
* 这里可以添加容器启动后需要执行的代码
*/
logger.info("系统初始化完成");
}
}
19
Source : AnnotateAnalyzer.java
with GNU Affero General Public License v3.0
from WhiteMagic2014
with GNU Affero General Public License v3.0
from WhiteMagic2014
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
if (event.getApplicationContext().getParent() == null) {
// @Command 注解 自动注册指令
logger.info("开始扫描注册 command");
Map<String, Object> beans = event.getApplicationContext().getBeansWithAnnotation(com.whitemagic2014.annotate.Command.clreplaced);
for (Object bean : beans.values()) {
if (bean instanceof com.whitemagic2014.command.Command) {
com.whitemagic2014.annotate.Command com = bean.getClreplaced().getAnnotation(com.whitemagic2014.annotate.Command.clreplaced);
if (com.autoLoad()) {
commands.add((com.whitemagic2014.command.Command) bean);
}
}
}
// @Switch 注解自动 注册入MagicSwitch
logger.info("开始注册 component switch");
Map<String, Object> switchBeans = event.getApplicationContext().getBeansWithAnnotation(Switch.clreplaced);
for (Object bean : switchBeans.values()) {
// 只有指令才去登记 非指令不登记
if (bean instanceof Command) {
Switch sw = bean.getClreplaced().getAnnotation(Switch.clreplaced);
MagicSwitch.init(sw.name(), sw.defaultOn());
}
}
}
}
19
Source : DailyAction.java
with MIT License
from wangruns
with MIT License
from wangruns
public void onApplicationEvent(ContextRefreshedEvent arg0) {
System.out.println("###-----Spring 容器加载完毕_-_-----###");
init(arg0);
}
19
Source : KafkaSampleConsumer.java
with Apache License 2.0
from vmware-archive
with Apache License 2.0
from vmware-archive
@Override
public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
(new Thread() {
public void run() {
try {
consumeMessages();
} catch (Exception e) {
log.error("Consumer crapped out.", e);
}
}
}).start();
}
19
Source : SpringContextInjector.java
with Apache License 2.0
from virjar
with Apache License 2.0
from virjar
@Override
public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
applicationContext = contextRefreshedEvent.getApplicationContext();
}
19
Source : ResourceUrlProvider.java
with MIT License
from Vip-Augus
with MIT License
from Vip-Augus
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
if (isAutodetect()) {
this.handlerMap.clear();
detectResourceHandlers(event.getApplicationContext());
if (!this.handlerMap.isEmpty()) {
this.autodetect = false;
}
}
}
19
Source : ResourceUrlProvider.java
with MIT License
from Vip-Augus
with MIT License
from Vip-Augus
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
if (this.handlerMap.isEmpty()) {
detectResourceHandlers(event.getApplicationContext());
}
}
19
Source : JmsListenerEndpointRegistry.java
with MIT License
from Vip-Augus
with MIT License
from Vip-Augus
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
if (event.getApplicationContext() == this.applicationContext) {
this.contextRefreshed = true;
}
}
19
Source : QueueListener.java
with Apache License 2.0
from ukihsoroy
with Apache License 2.0
from ukihsoroy
@Override
public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
new Thread(() -> {
while (true) {
if (StringUtils.isNotBlank(mockQueue.getCompleteOrder())) {
String orderNumber = mockQueue.getCompleteOrder();
_LOGGER.info("返回订单处理结果: {}", orderNumber);
deferredResultHolder.getMap().get(orderNumber).setResult("place order success;");
mockQueue.setCompleteOrder(null);
} else {
try {
TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}).start();
}
19
Source : ServiceConfigBean.java
with Apache License 2.0
from TFdream
with Apache License 2.0
from TFdream
@Override
public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
if (!isExported()) {
export();
}
}
19
Source : PermissionHandleListener.java
with MIT License
from TaleLin
with MIT License
from TaleLin
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
addNewPermissions();
removeUnusedPermissions();
}
19
Source : EmbeddedModuleStartupListener.java
with MIT License
from sunshower-io
with MIT License
from sunshower-io
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
val module = (EmbeddedModule) event.getApplicationContext().getBean(Module.clreplaced);
val kernel = event.getApplicationContext().getBean(Kernel.clreplaced);
}
19
Source : MykitTransactionEventPublisher.java
with Apache License 2.0
from sunshinelyz
with Apache License 2.0
from sunshinelyz
@Override
public void onApplicationEvent(final ContextRefreshedEvent contextRefreshedEvent) {
start(mykitTransactionMessageConfig.getBufferSize(), mykitTransactionMessageConfig.getConsumerThreads());
}
19
Source : ApplicationStartListener.java
with GNU Lesser General Public License v3.0
from sunpengChina
with GNU Lesser General Public License v3.0
from sunpengChina
public void onApplicationEvent(ContextRefreshedEvent event) {
if (!firstEvent) {
return;
} else {
firstEvent = false;
IServer center = event.getApplicationContext().getBean(IServer.clreplaced);
try {
center.connect();
} catch (ConnectException | NonexistException | InterruptedException e) {
logger.error(e);
}
}
}
19
Source : DestroyGemFireMockObjectsApplicationListenerUnitTests.java
with Apache License 2.0
from spring-projects
with Apache License 2.0
from spring-projects
@Test
public void doesNotDestroyGemFireMockObjectsOnContextRefreshedEvent() {
ContextRefreshedEvent mockEvent = mock(ContextRefreshedEvent.clreplaced);
this.listener.onApplicationEvent(mockEvent);
verify(this.listener, never()).destroyGemFireMockObjects();
}
19
Source : SecurityManagerProxyConfiguration.java
with Apache License 2.0
from spring-projects
with Apache License 2.0
from spring-projects
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
SecurityManagerProxy securityManagerProxy = SecurityManagerProxy.getInstance();
securityManagerProxy.setBeanFactory(event.getApplicationContext().getAutowireCapableBeanFactory());
securityManagerProxy.init(new Properties());
}
19
Source : CRefreshEventHandler.java
with Apache License 2.0
from SourceHot
with Apache License 2.0
from SourceHot
public void onApplicationEvent(ContextRefreshedEvent event) {
System.out.println("ContextRefreshedEvent Received");
}
19
Source : AsyncTaskExecutionListener.java
with Apache License 2.0
from sofastack
with Apache License 2.0
from sofastack
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
if (applicationContext.equals(event.getApplicationContext())) {
AsyncTaskExecutor.ensureAsyncTasksFinish();
}
}
19
Source : ApplicationContextRefreshedListener.java
with Apache License 2.0
from sofastack
with Apache License 2.0
from sofastack
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
ApplicationContext applicationContext = event.getApplicationContext();
// rpc 开始启动事件监听器
applicationContext.publishEvent(new SofaBootRpcStartEvent(applicationContext));
// rpc 启动完毕事件监听器
applicationContext.publishEvent(new SofaBootRpcStartAfterEvent(applicationContext));
}
19
Source : SofaModuleContextRefreshedListener.java
with Apache License 2.0
from sofastack
with Apache License 2.0
from sofastack
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
if (applicationContext.equals(event.getApplicationContext())) {
try {
pipelineContext.process();
} catch (Throwable t) {
SofaLogger.error("process pipeline error", t);
throw new RuntimeException(t);
}
}
}
19
Source : ReadinessCheckListener.java
with Apache License 2.0
from sofastack
with Apache License 2.0
from sofastack
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
if (applicationContext.equals(event.getApplicationContext())) {
healthCheckerProcessor.init();
healthIndicatorProcessor.init();
afterReadinessCheckCallbackProcessor.init();
readinessHealthCheck();
readinessCheckFinish = true;
}
}
See More Examples