@org.springframework.context.event.EventListener

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 7

19 Source : EventLoggerHandler.java
with Apache License 2.0
from zeebe-io

@EventListener
public void logEvent() {
}

19 Source : RedisDeadQueue.java
with MIT License
from yizzuide

@EventListener
public void onApplicationEvent(IceInstanceChangeEvent event) {
    String instanceName = event.getSource().toString();
    this.deadQueueKey = "ice:dead_queue:" + instanceName;
}

19 Source : DelegatingDelayJobHandler.java
with MIT License
from yizzuide

@EventListener
public void onApplicationEvent(IceInstanceChangeEvent event) {
    String instanceName = event.getSource().toString();
    this.delayBucketKey = "ice-delay-bucket:" + instanceName;
}

19 Source : AbstractHydrogenLoader.java
with MIT License
from yizzuide

@EventListener
public void configListener(DelegatingEnvironmentChangeEvent event) {
    // 键没有修改,直接返回
    if (CollectionUtils.isEmpty(event.getKeys())) {
        return;
    }
    refresh();
}

19 Source : Listings.java
with GNU Affero General Public License v3.0
from wolfiabot

@EventListener
public void onGuildLeave(final GuildLeaveEvent event) {
    postAllStats(event.getJDA());
}

19 Source : PrivateRoomQueue.java
with GNU Affero General Public License v3.0
from wolfiabot

@EventListener
public void onGuildMemberJoin(final GuildMemberJoinEvent event) {
    getAllManagedRooms().forEach(room -> room.onGuildMemberJoin(event));
}

19 Source : MossInstanceDiscoveryListener.java
with Apache License 2.0
from SpringCloud

@EventListener
public void onInstanceRegistered(InstanceRegisteredEvent<?> event) {
    discover();
}

19 Source : MossInstanceDiscoveryListener.java
with Apache License 2.0
from 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 Source : InvestbookApplication.java
with GNU Affero General Public License v3.0
from spacious-team

@EventListener
public void onApplicationEvent(ServletWebServerInitializedEvent event) {
    if (properties.isOpenHomePageAfterStart()) {
        int port = event.getWebServer().getPort();
        BrowserHomePageOpener.open("http://localhost:" + port);
    }
}

19 Source : EventsBean.java
with Apache License 2.0
from ralscha

@EventListener
public void subscriptionDeleted(WampSubscriptionDeletedEvent evt) {
    this.methodCounter.computeIfAbsent("subscriptionDeleted", k -> new ArrayList<>()).add(evt);
}

19 Source : EventsBean.java
with Apache License 2.0
from ralscha

@EventListener
public void sessionEstablished(WampSessionEstablishedEvent evt) {
    this.methodCounter.computeIfAbsent("sessionEstablished", k -> new ArrayList<>()).add(evt);
}

19 Source : EventsBean.java
with Apache License 2.0
from ralscha

@EventListener
public void unsubscribed(WampSubscriptionUnsubscribedEvent evt) {
    this.methodCounter.computeIfAbsent("unsubscribed", k -> new ArrayList<>()).add(evt);
}

19 Source : EventsBean.java
with Apache License 2.0
from ralscha

@EventListener
public void disconnected(WampDisconnectEvent evt) {
    this.methodCounter.computeIfAbsent("disconnected", k -> new ArrayList<>()).add(evt);
}

19 Source : EventsBean.java
with Apache License 2.0
from ralscha

@EventListener
public void subscribed(WampSubscriptionSubscribedEvent evt) {
    this.methodCounter.computeIfAbsent("subscribed", k -> new ArrayList<>()).add(evt);
}

19 Source : EventsBean.java
with Apache License 2.0
from ralscha

@EventListener
public void subscriptionCreated(WampSubscriptionCreatedEvent evt) {
    this.methodCounter.computeIfAbsent("subscriptionCreated", k -> new ArrayList<>()).add(evt);
}

19 Source : EventsBean.java
with Apache License 2.0
from ralscha

@EventListener
public void procedureUnregistered(WampProcedureUnregisteredEvent evt) {
    this.methodCounter.computeIfAbsent("procedureUnregistered", k -> new ArrayList<>()).add(evt);
}

19 Source : EventsBean.java
with Apache License 2.0
from ralscha

@EventListener
public void procedureRegistered(WampProcedureRegisteredEvent evt) {
    this.methodCounter.computeIfAbsent("procedureRegistered", k -> new ArrayList<>()).add(evt);
}

19 Source : SseEventBus.java
with Apache License 2.0
from 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 Source : AppDetailTask.java
with Apache License 2.0
from pacphi

@EventListener
void handleAppDetailReadyToBeRetrieved(AppDetailReadyToBeRetrievedEvent event) {
    if (appDetailReadyToBeCollectedDecider.isDecided()) {
        collect(appDetailReadyToBeCollectedDecider.getSpaces());
        appDetailReadyToBeCollectedDecider.reset();
    }
}

19 Source : TraceListener.java
with Apache License 2.0
from osswangxining

@EventListener
public void onSend(SentApplicationEvent event) {
    this.repository.add(getSentTrace(event));
}

19 Source : TraceListener.java
with Apache License 2.0
from osswangxining

@EventListener
public void onAck(AckRemoteApplicationEvent event) {
    this.repository.add(getReceivedTrace(event));
}

19 Source : UpdateUserEventListener.java
with Mozilla Public License 2.0
from opfab

@EventListener
public void handleUserUpdate(UpdatedUserEvent event) {
    userServiceCache.clearUserCache(event.getLogin());
}

19 Source : PersistingEventListener.java
with Apache License 2.0
from odrotbohm

@EventListener
void on(AbstractEvent<?> event) {
    events.save(event);
}

19 Source : TestListener.java
with Apache License 2.0
from odrotbohm

@EventListener
void on(PriceChanged event) {
    this.priceChanged = event;
}

19 Source : TestListener.java
with Apache License 2.0
from odrotbohm

@EventListener
void on(ProductAdded event) {
    this.productAdded = event;
}

19 Source : LoggingApplicationListener.java
with Apache License 2.0
from odrotbohm

@EventListener
void on(Object event) {
    log.info("Received application event: {}", event);
}

19 Source : LoggingApplicationListener.java
with Apache License 2.0
from odrotbohm

@EventListener
void on(Object event) {
    log.info("Received application event: " + event);
}

19 Source : SomeEventListenerB.java
with Apache License 2.0
from odrotbohm

@EventListener
void on(SomeEventA event) {
}

19 Source : WebSocketController.java
with Apache License 2.0
from 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 Source : ApplicationListenerDemo.java
with Apache License 2.0
from mercyblitz

@EventListener
public void onPayloadApplicationEvent(PayloadApplicationEvent<String> event) {
    println("onPayloadApplicationEvent - 接收到 Spring PayloadApplicationEvent:" + event);
}

19 Source : EurekaStateChangeListener.java
with Apache License 2.0
from lihangqi

/**
 * 服务实例续约事件
 * @param event
 */
@EventListener
public void listen(EurekaInstanceRenewedEvent event) {
// log.info("服务实例[{}]续约成功", event.getInstanceInfo().getAppName());
}

19 Source : EurekaStateChangeListener.java
with Apache License 2.0
from lihangqi

/**
 * Eureka Server启动事件
 * @param event
 */
@EventListener
public void listen(EurekaServerStartedEvent event) {
    log.info("Eureka Server在[{}]启动成功", event.getTimestamp());
}

19 Source : EurekaStateChangeListener.java
with Apache License 2.0
from lihangqi

/**
 * Eureka Registry启动事件
 * @param event
 */
@EventListener
public void listen(EurekaRegistryAvailableEvent event) {
    log.info("Eureka Registry在[{}]启动成功", event.getTimestamp());
}

19 Source : EurekaClientEventListener.java
with Apache License 2.0
from lihangqi

@EventListener
public void listen(InstanceRegisteredEvent<EurekaInstanceConfigBean> event) {
    log.info("实例[{}]注册事件", event.getConfig().getAppname());
}

19 Source : EventListenContainerService.java
with Apache License 2.0
from klunge

@EventListener
public void onApplicationEvent(InMemoryRestoredEvent inMemoryRestoredEvent) {
    startListen();
}

19 Source : ConsumerOffsetListenerContainerService.java
with Apache License 2.0
from klunge

@org.springframework.context.event.EventListener
public void onApplicationEvent(InMemoryFailedEvent inMemoryFailedEvent) {
    stopListen();
}

19 Source : ConsumerOffsetListenerContainerService.java
with Apache License 2.0
from klunge

@org.springframework.context.event.EventListener
public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
    synchronized (listenerManagementLock) {
        if (defaultQuorum == null || defaultQuorum.isPresent()) {
            startListen();
        }
    }
}

19 Source : ConsumerOffsetListenerContainerService.java
with Apache License 2.0
from klunge

@org.springframework.context.event.EventListener
public void onApplicationEvent(InMemoryRestoredEvent inMemoryRestoredEvent) {
    startListen();
}

19 Source : NotifySubscriberService.java
with Apache License 2.0
from jetlinks

@EventListener
public void handleEvent(EnreplacedyDeletedEvent<NotifySubscriberEnreplacedy> enreplacedy) {
    enreplacedy.getEnreplacedy().forEach(e -> {
        e.setState(SubscribeState.disabled);
        doNotifyChange(e);
    });
}

19 Source : NotifySubscriberService.java
with Apache License 2.0
from jetlinks

@EventListener
public void handleEvent(EnreplacedyCreatedEvent<NotifySubscriberEnreplacedy> enreplacedy) {
    enreplacedy.getEnreplacedy().forEach(this::doNotifyChange);
}

19 Source : NotifySubscriberService.java
with Apache License 2.0
from jetlinks

@EventListener
public void handleEvent(EnreplacedySavedEvent<NotifySubscriberEnreplacedy> enreplacedy) {
    enreplacedy.getEnreplacedy().forEach(this::doNotifyChange);
}

19 Source : NotifySubscriberService.java
with Apache License 2.0
from jetlinks

@EventListener
public void handleEvent(EnreplacedyModifyEvent<NotifySubscriberEnreplacedy> enreplacedy) {
    enreplacedy.getAfter().forEach(this::doNotifyChange);
}

19 Source : NotifierCacheManager.java
with Apache License 2.0
from jetlinks

@EventListener
public void handleTemplateDelete(EnreplacedyDeletedEvent<NotifyTemplateEnreplacedy> event) {
    event.async(reloadTemplate(event.getEnreplacedy()));
}

19 Source : NotifierCacheManager.java
with Apache License 2.0
from jetlinks

@EventListener
public void handleConfigModify(EnreplacedyModifyEvent<NotifyConfigEnreplacedy> event) {
    event.async(reloadConfig(event.getBefore()));
}

19 Source : NotifierCacheManager.java
with Apache License 2.0
from jetlinks

@EventListener
public void handleTemplateSave(EnreplacedySavedEvent<NotifyTemplateEnreplacedy> event) {
    event.async(reloadTemplate(event.getEnreplacedy()));
}

19 Source : NotifierCacheManager.java
with Apache License 2.0
from jetlinks

@EventListener
public void handleConfigDelete(EnreplacedyDeletedEvent<NotifyConfigEnreplacedy> event) {
    event.async(reloadConfig(event.getEnreplacedy()));
}

19 Source : NotifierCacheManager.java
with Apache License 2.0
from jetlinks

@EventListener
public void handleConfigSave(EnreplacedySavedEvent<NotifyConfigEnreplacedy> event) {
    event.async(reloadConfig(event.getEnreplacedy()));
}

19 Source : NotifierCacheManager.java
with Apache License 2.0
from jetlinks

@EventListener
public void handleTemplateModify(EnreplacedyModifyEvent<NotifyTemplateEnreplacedy> event) {
    event.async(reloadTemplate(event.getBefore()));
}

19 Source : TestPatientMergedEventListener.java
with GNU General Public License v3.0
from informatici

@EventListener
public void handle(PatientMergedEvent patientMergedEvent) {
    this.patientMergedEvent = patientMergedEvent;
    if (shouldFail) {
        throw new RuntimeException("failure testing");
    }
}

19 Source : ProjectExportServiceImpl.java
with Apache License 2.0
from inception-project

@EventListener
public void onContextRefreshedEvent(ContextRefreshedEvent aEvent) {
    init();
}

See More Examples