Package org.opennms.osgi
Class EventRegistry
- java.lang.Object
-
- org.opennms.osgi.EventRegistry
-
public class EventRegistry extends Object
The EventRegistry is a single point of entry to get an EventListener/EventConsumer registered in the underlying OSGi-Container. To register an EventConsumer, you have to invoke the methodaddPossibleEventConsumer(Object, VaadinApplicationContext)
.- Author:
- Markus von RĂ¼den
-
-
Constructor Summary
Constructors Constructor Description EventRegistry(org.osgi.framework.BundleContext bundleContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPossibleEventConsumer(Object possibleEventConsumer, VaadinApplicationContext applicationContext)
Adds the possibleEventConsumer as an EventListener/EventConsumer to the OSGi registry.
The event consumer is registered when: The object has at least one method annotated with @EventConsumer The annotated method has only one parameter.EventProxy
getScope(VaadinApplicationContext vaadinApplicationContext)
-
-
-
Method Detail
-
addPossibleEventConsumer
public void addPossibleEventConsumer(Object possibleEventConsumer, VaadinApplicationContext applicationContext)
Adds the possibleEventConsumer as an EventListener/EventConsumer to the OSGi registry.
The event consumer is registered when:- The object has at least one method annotated with @EventConsumer
- The annotated method has only one parameter.
Attention: If the possibleEventConsumer has no Annotation @EventConsumer or has multiple method parameters the object is not registered as a listener!
TheVaadinApplicationContext
parameter is used to bind the event consumer to the user session (otherwise all users would be informed when one user provokes an event notification).- Parameters:
possibleEventConsumer
- An object with or without an annotation @EventConsumer.applicationContext
- must not be null. is used to bind the event consumer to the user session (otherwise all users would be informed when one user provokes an event notification).
-
getScope
public EventProxy getScope(VaadinApplicationContext vaadinApplicationContext)
-
-