Class EventRegistry


  • public class EventRegistry
    extends java.lang.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 method addPossibleEventConsumer(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​(java.lang.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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EventRegistry

        public EventRegistry​(org.osgi.framework.BundleContext bundleContext)
    • Method Detail

      • addPossibleEventConsumer

        public void addPossibleEventConsumer​(java.lang.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!
        The VaadinApplicationContext 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).