Package io.meeds.deeds.service
Class ListenerService
- java.lang.Object
-
- io.meeds.deeds.service.ListenerService
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
@Component public class ListenerService extends Object implements org.springframework.context.ApplicationContextAware
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classListenerService.Eventstatic classListenerService.EventDeserializerclassListenerService.Listener
-
Constructor Summary
Constructors Constructor Description ListenerService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(EventListener<?> listener)voidaddListener(String eventName, EventListener<?> listener)voidinit()voidpublishEvent(String eventName, Object data)protected voidpublishEventLocally(ListenerService.Event event)voidremoveListsner(String listenerName)voidremoveListsner(String eventName, String listenerName)voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext)protected voidtriggerEvent(ListenerService.Event event)
-
-
-
Method Detail
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
init
@PostConstruct public void init()
-
addListener
public void addListener(EventListener<?> listener)
-
addListener
public void addListener(String eventName, EventListener<?> listener)
-
removeListsner
public void removeListsner(String listenerName)
-
publishEventLocally
protected void publishEventLocally(ListenerService.Event event)
-
triggerEvent
protected void triggerEvent(ListenerService.Event event)
-
-