Here are the examples of the java api @org.springframework.context.event.EventListener taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
523 Examples
19
View Source File : EventLoggerHandler.java
License : Apache License 2.0
Project Creator : zeebe-io
License : Apache License 2.0
Project Creator : zeebe-io
@EventListener
public void logEvent() {
}
19
View Source File : RedisDeadQueue.java
License : MIT License
Project Creator : yizzuide
License : MIT License
Project Creator : yizzuide
@EventListener
public void onApplicationEvent(IceInstanceChangeEvent event) {
String instanceName = event.getSource().toString();
this.deadQueueKey = "ice:dead_queue:" + instanceName;
}
19
View Source File : DelegatingDelayJobHandler.java
License : MIT License
Project Creator : yizzuide
License : MIT License
Project Creator : yizzuide
@EventListener
public void onApplicationEvent(IceInstanceChangeEvent event) {
String instanceName = event.getSource().toString();
this.delayBucketKey = "ice-delay-bucket:" + instanceName;
}
19
View Source File : AbstractHydrogenLoader.java
License : MIT License
Project Creator : yizzuide
License : MIT License
Project Creator : yizzuide
@EventListener
public void configListener(DelegatingEnvironmentChangeEvent event) {
// 键没有修改,直接返回
if (CollectionUtils.isEmpty(event.getKeys())) {
return;
}
refresh();
}
19
View Source File : Listings.java
License : GNU Affero General Public License v3.0
Project Creator : wolfiabot
License : GNU Affero General Public License v3.0
Project Creator : wolfiabot
@EventListener
public void onGuildLeave(final GuildLeaveEvent event) {
postAllStats(event.getJDA());
}
19
View Source File : PrivateRoomQueue.java
License : GNU Affero General Public License v3.0
Project Creator : wolfiabot
License : GNU Affero General Public License v3.0
Project Creator : wolfiabot
@EventListener
public void onGuildMemberJoin(final GuildMemberJoinEvent event) {
getAllManagedRooms().forEach(room -> room.onGuildMemberJoin(event));
}
19
View Source File : MossInstanceDiscoveryListener.java
License : Apache License 2.0
Project Creator : SpringCloud
License : Apache License 2.0
Project Creator : SpringCloud
@EventListener
public void onInstanceRegistered(InstanceRegisteredEvent<?> event) {
discover();
}
19
View Source File : MossInstanceDiscoveryListener.java
License : Apache License 2.0
Project Creator : SpringCloud
License : Apache License 2.0
Project Creator : SpringCloud
@EventListener
public void onInstanceRegistered(InstanceRegisteredEvent<?> event) {
Object source = event.getSource();
if (source instanceof MossEurekaAutoServiceRegistration) {
MossEurekaAutoServiceRegistration eurekaAutoServiceRegistration = (MossEurekaAutoServiceRegistration) source;
cloudEurekaClient.set(eurekaAutoServiceRegistration.getRegistration().getEurekaClient());
discover();
cloudEurekaClient.remove();
}
}
19
View Source File : InvestbookApplication.java
License : GNU Affero General Public License v3.0
Project Creator : spacious-team
License : GNU Affero General Public License v3.0
Project Creator : spacious-team
@EventListener
public void onApplicationEvent(ServletWebServerInitializedEvent event) {
if (properties.isOpenHomePageAfterStart()) {
int port = event.getWebServer().getPort();
BrowserHomePageOpener.open("http://localhost:" + port);
}
}
19
View Source File : EventsBean.java
License : Apache License 2.0
Project Creator : ralscha
License : Apache License 2.0
Project Creator : ralscha
@EventListener
public void subscriptionDeleted(WampSubscriptionDeletedEvent evt) {
this.methodCounter.computeIfAbsent("subscriptionDeleted", k -> new ArrayList<>()).add(evt);
}
19
View Source File : EventsBean.java
License : Apache License 2.0
Project Creator : ralscha
License : Apache License 2.0
Project Creator : ralscha
@EventListener
public void sessionEstablished(WampSessionEstablishedEvent evt) {
this.methodCounter.computeIfAbsent("sessionEstablished", k -> new ArrayList<>()).add(evt);
}
19
View Source File : EventsBean.java
License : Apache License 2.0
Project Creator : ralscha
License : Apache License 2.0
Project Creator : ralscha
@EventListener
public void unsubscribed(WampSubscriptionUnsubscribedEvent evt) {
this.methodCounter.computeIfAbsent("unsubscribed", k -> new ArrayList<>()).add(evt);
}
19
View Source File : EventsBean.java
License : Apache License 2.0
Project Creator : ralscha
License : Apache License 2.0
Project Creator : ralscha
@EventListener
public void disconnected(WampDisconnectEvent evt) {
this.methodCounter.computeIfAbsent("disconnected", k -> new ArrayList<>()).add(evt);
}
19
View Source File : EventsBean.java
License : Apache License 2.0
Project Creator : ralscha
License : Apache License 2.0
Project Creator : ralscha
@EventListener
public void subscribed(WampSubscriptionSubscribedEvent evt) {
this.methodCounter.computeIfAbsent("subscribed", k -> new ArrayList<>()).add(evt);
}
19
View Source File : EventsBean.java
License : Apache License 2.0
Project Creator : ralscha
License : Apache License 2.0
Project Creator : ralscha
@EventListener
public void subscriptionCreated(WampSubscriptionCreatedEvent evt) {
this.methodCounter.computeIfAbsent("subscriptionCreated", k -> new ArrayList<>()).add(evt);
}
19
View Source File : EventsBean.java
License : Apache License 2.0
Project Creator : ralscha
License : Apache License 2.0
Project Creator : ralscha
@EventListener
public void procedureUnregistered(WampProcedureUnregisteredEvent evt) {
this.methodCounter.computeIfAbsent("procedureUnregistered", k -> new ArrayList<>()).add(evt);
}
19
View Source File : EventsBean.java
License : Apache License 2.0
Project Creator : ralscha
License : Apache License 2.0
Project Creator : ralscha
@EventListener
public void procedureRegistered(WampProcedureRegisteredEvent evt) {
this.methodCounter.computeIfAbsent("procedureRegistered", k -> new ArrayList<>()).add(evt);
}
19
View Source File : SseEventBus.java
License : Apache License 2.0
Project Creator : ralscha
License : Apache License 2.0
Project Creator : ralscha
@EventListener
public void handleEvent(SseEvent event) {
try {
String convertedValue = null;
if (!(event.data() instanceof String)) {
convertedValue = this.convertObject(event);
}
if (event.clientIds().isEmpty()) {
for (Client client : this.clients.values()) {
if (!event.excludeClientIds().contains(client.getId()) && this.subscriptionRegistry.isClientSubscribedToEvent(client.getId(), event.event())) {
ClientEvent clientEvent = new ClientEvent(client, event, convertedValue);
this.sendQueue.put(clientEvent);
this.listener.afterEventQueued(clientEvent, true);
}
}
} else {
for (String clientId : event.clientIds()) {
if (this.subscriptionRegistry.isClientSubscribedToEvent(clientId, event.event())) {
ClientEvent clientEvent = new ClientEvent(this.clients.get(clientId), event, convertedValue);
this.sendQueue.put(clientEvent);
this.listener.afterEventQueued(clientEvent, true);
}
}
}
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
19
View Source File : AppDetailTask.java
License : Apache License 2.0
Project Creator : pacphi
License : Apache License 2.0
Project Creator : pacphi
@EventListener
void handleAppDetailReadyToBeRetrieved(AppDetailReadyToBeRetrievedEvent event) {
if (appDetailReadyToBeCollectedDecider.isDecided()) {
collect(appDetailReadyToBeCollectedDecider.getSpaces());
appDetailReadyToBeCollectedDecider.reset();
}
}
19
View Source File : TraceListener.java
License : Apache License 2.0
Project Creator : osswangxining
License : Apache License 2.0
Project Creator : osswangxining
@EventListener
public void onSend(SentApplicationEvent event) {
this.repository.add(getSentTrace(event));
}
19
View Source File : TraceListener.java
License : Apache License 2.0
Project Creator : osswangxining
License : Apache License 2.0
Project Creator : osswangxining
@EventListener
public void onAck(AckRemoteApplicationEvent event) {
this.repository.add(getReceivedTrace(event));
}
19
View Source File : UpdateUserEventListener.java
License : Mozilla Public License 2.0
Project Creator : opfab
License : Mozilla Public License 2.0
Project Creator : opfab
@EventListener
public void handleUserUpdate(UpdatedUserEvent event) {
userServiceCache.clearUserCache(event.getLogin());
}
19
View Source File : PersistingEventListener.java
License : Apache License 2.0
Project Creator : odrotbohm
License : Apache License 2.0
Project Creator : odrotbohm
@EventListener
void on(AbstractEvent<?> event) {
events.save(event);
}
19
View Source File : TestListener.java
License : Apache License 2.0
Project Creator : odrotbohm
License : Apache License 2.0
Project Creator : odrotbohm
@EventListener
void on(PriceChanged event) {
this.priceChanged = event;
}
19
View Source File : TestListener.java
License : Apache License 2.0
Project Creator : odrotbohm
License : Apache License 2.0
Project Creator : odrotbohm
@EventListener
void on(ProductAdded event) {
this.productAdded = event;
}
19
View Source File : LoggingApplicationListener.java
License : Apache License 2.0
Project Creator : odrotbohm
License : Apache License 2.0
Project Creator : odrotbohm
@EventListener
void on(Object event) {
log.info("Received application event: {}", event);
}
19
View Source File : LoggingApplicationListener.java
License : Apache License 2.0
Project Creator : odrotbohm
License : Apache License 2.0
Project Creator : odrotbohm
@EventListener
void on(Object event) {
log.info("Received application event: " + event);
}
19
View Source File : SomeEventListenerB.java
License : Apache License 2.0
Project Creator : odrotbohm
License : Apache License 2.0
Project Creator : odrotbohm
@EventListener
void on(SomeEventA event) {
}
19
View Source File : WebSocketController.java
License : Apache License 2.0
Project Creator : mploed
License : Apache License 2.0
Project Creator : mploed
@EventListener
public void greeting(ScoringPerformed event) throws Exception {
this.template.convertAndSend("/topic/greetings", new WebSocketMessage(event.getApplicationNumber() + " has been scored with " + event.getPoints() + " and final result " + event.getScoreColor()));
}
19
View Source File : ApplicationListenerDemo.java
License : Apache License 2.0
Project Creator : mercyblitz
License : Apache License 2.0
Project Creator : mercyblitz
@EventListener
public void onPayloadApplicationEvent(PayloadApplicationEvent<String> event) {
println("onPayloadApplicationEvent - 接收到 Spring PayloadApplicationEvent:" + event);
}
19
View Source File : EurekaStateChangeListener.java
License : Apache License 2.0
Project Creator : lihangqi
License : Apache License 2.0
Project Creator : lihangqi
/**
* 服务实例续约事件
* @param event
*/
@EventListener
public void listen(EurekaInstanceRenewedEvent event) {
// log.info("服务实例[{}]续约成功", event.getInstanceInfo().getAppName());
}
19
View Source File : EurekaStateChangeListener.java
License : Apache License 2.0
Project Creator : lihangqi
License : Apache License 2.0
Project Creator : lihangqi
/**
* Eureka Server启动事件
* @param event
*/
@EventListener
public void listen(EurekaServerStartedEvent event) {
log.info("Eureka Server在[{}]启动成功", event.getTimestamp());
}
19
View Source File : EurekaStateChangeListener.java
License : Apache License 2.0
Project Creator : lihangqi
License : Apache License 2.0
Project Creator : lihangqi
/**
* Eureka Registry启动事件
* @param event
*/
@EventListener
public void listen(EurekaRegistryAvailableEvent event) {
log.info("Eureka Registry在[{}]启动成功", event.getTimestamp());
}
19
View Source File : EurekaClientEventListener.java
License : Apache License 2.0
Project Creator : lihangqi
License : Apache License 2.0
Project Creator : lihangqi
@EventListener
public void listen(InstanceRegisteredEvent<EurekaInstanceConfigBean> event) {
log.info("实例[{}]注册事件", event.getConfig().getAppname());
}
19
View Source File : EventListenContainerService.java
License : Apache License 2.0
Project Creator : klunge
License : Apache License 2.0
Project Creator : klunge
@EventListener
public void onApplicationEvent(InMemoryRestoredEvent inMemoryRestoredEvent) {
startListen();
}
19
View Source File : ConsumerOffsetListenerContainerService.java
License : Apache License 2.0
Project Creator : klunge
License : Apache License 2.0
Project Creator : klunge
@org.springframework.context.event.EventListener
public void onApplicationEvent(InMemoryFailedEvent inMemoryFailedEvent) {
stopListen();
}
19
View Source File : ConsumerOffsetListenerContainerService.java
License : Apache License 2.0
Project Creator : klunge
License : Apache License 2.0
Project Creator : klunge
@org.springframework.context.event.EventListener
public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
synchronized (listenerManagementLock) {
if (defaultQuorum == null || defaultQuorum.isPresent()) {
startListen();
}
}
}
19
View Source File : ConsumerOffsetListenerContainerService.java
License : Apache License 2.0
Project Creator : klunge
License : Apache License 2.0
Project Creator : klunge
@org.springframework.context.event.EventListener
public void onApplicationEvent(InMemoryRestoredEvent inMemoryRestoredEvent) {
startListen();
}
19
View Source File : NotifySubscriberService.java
License : Apache License 2.0
Project Creator : jetlinks
License : Apache License 2.0
Project Creator : jetlinks
@EventListener
public void handleEvent(EnreplacedyDeletedEvent<NotifySubscriberEnreplacedy> enreplacedy) {
enreplacedy.getEnreplacedy().forEach(e -> {
e.setState(SubscribeState.disabled);
doNotifyChange(e);
});
}
19
View Source File : NotifySubscriberService.java
License : Apache License 2.0
Project Creator : jetlinks
License : Apache License 2.0
Project Creator : jetlinks
@EventListener
public void handleEvent(EnreplacedyCreatedEvent<NotifySubscriberEnreplacedy> enreplacedy) {
enreplacedy.getEnreplacedy().forEach(this::doNotifyChange);
}
19
View Source File : NotifySubscriberService.java
License : Apache License 2.0
Project Creator : jetlinks
License : Apache License 2.0
Project Creator : jetlinks
@EventListener
public void handleEvent(EnreplacedySavedEvent<NotifySubscriberEnreplacedy> enreplacedy) {
enreplacedy.getEnreplacedy().forEach(this::doNotifyChange);
}
19
View Source File : NotifySubscriberService.java
License : Apache License 2.0
Project Creator : jetlinks
License : Apache License 2.0
Project Creator : jetlinks
@EventListener
public void handleEvent(EnreplacedyModifyEvent<NotifySubscriberEnreplacedy> enreplacedy) {
enreplacedy.getAfter().forEach(this::doNotifyChange);
}
19
View Source File : NotifierCacheManager.java
License : Apache License 2.0
Project Creator : jetlinks
License : Apache License 2.0
Project Creator : jetlinks
@EventListener
public void handleTemplateDelete(EnreplacedyDeletedEvent<NotifyTemplateEnreplacedy> event) {
event.async(reloadTemplate(event.getEnreplacedy()));
}
19
View Source File : NotifierCacheManager.java
License : Apache License 2.0
Project Creator : jetlinks
License : Apache License 2.0
Project Creator : jetlinks
@EventListener
public void handleConfigModify(EnreplacedyModifyEvent<NotifyConfigEnreplacedy> event) {
event.async(reloadConfig(event.getBefore()));
}
19
View Source File : NotifierCacheManager.java
License : Apache License 2.0
Project Creator : jetlinks
License : Apache License 2.0
Project Creator : jetlinks
@EventListener
public void handleTemplateSave(EnreplacedySavedEvent<NotifyTemplateEnreplacedy> event) {
event.async(reloadTemplate(event.getEnreplacedy()));
}
19
View Source File : NotifierCacheManager.java
License : Apache License 2.0
Project Creator : jetlinks
License : Apache License 2.0
Project Creator : jetlinks
@EventListener
public void handleConfigDelete(EnreplacedyDeletedEvent<NotifyConfigEnreplacedy> event) {
event.async(reloadConfig(event.getEnreplacedy()));
}
19
View Source File : NotifierCacheManager.java
License : Apache License 2.0
Project Creator : jetlinks
License : Apache License 2.0
Project Creator : jetlinks
@EventListener
public void handleConfigSave(EnreplacedySavedEvent<NotifyConfigEnreplacedy> event) {
event.async(reloadConfig(event.getEnreplacedy()));
}
19
View Source File : NotifierCacheManager.java
License : Apache License 2.0
Project Creator : jetlinks
License : Apache License 2.0
Project Creator : jetlinks
@EventListener
public void handleTemplateModify(EnreplacedyModifyEvent<NotifyTemplateEnreplacedy> event) {
event.async(reloadTemplate(event.getBefore()));
}
19
View Source File : TestPatientMergedEventListener.java
License : GNU General Public License v3.0
Project Creator : informatici
License : GNU General Public License v3.0
Project Creator : informatici
@EventListener
public void handle(PatientMergedEvent patientMergedEvent) {
this.patientMergedEvent = patientMergedEvent;
if (shouldFail) {
throw new RuntimeException("failure testing");
}
}
19
View Source File : ProjectExportServiceImpl.java
License : Apache License 2.0
Project Creator : inception-project
License : Apache License 2.0
Project Creator : inception-project
@EventListener
public void onContextRefreshedEvent(ContextRefreshedEvent aEvent) {
init();
}
See More Examples