Interface WidgetController

  • All Known Implementing Classes:
    AbstractWidgetController

    public interface WidgetController
    Controller used by Cockpit Widget components.

    A WidgetController typically acts as a conventional controller as well as a Publish-Subscribe-Channel used for inter-widget communication. A widget controller is typically a Spring bean defined in the session scope.

    See Also:
    Widget, WidgetAdapter
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addCockpitEventAcceptor​(java.lang.String context, CockpitEventAcceptor acceptor)
      Registers the event acceptor acceptor so that it receives notifications when an event with the matching context context is dispatched.
      void dispatchEvent​(java.lang.String context, java.lang.Object source, java.util.Map<java.lang.String,​java.lang.Object> params)
      Notifies all event acceptors which are registered for events with the context code context.
      void removeCockpitEventAcceptor​(java.lang.String context, CockpitEventAcceptor acceptor)
      Unregisters the event acceptor acceptor for events with the specified context code context .
      void setCockpitEventAcceptors​(java.util.Map<java.lang.String,​java.util.List<CockpitEventAcceptor>> acceptorMap)
      Sets the event acceptors to register with this controller.
    • Method Detail

      • addCockpitEventAcceptor

        void addCockpitEventAcceptor​(java.lang.String context,
                                     CockpitEventAcceptor acceptor)
        Registers the event acceptor acceptor so that it receives notifications when an event with the matching context context is dispatched.
        Parameters:
        context - event context
        acceptor - event acceptor
      • removeCockpitEventAcceptor

        void removeCockpitEventAcceptor​(java.lang.String context,
                                        CockpitEventAcceptor acceptor)
        Unregisters the event acceptor acceptor for events with the specified context code context .
        Parameters:
        context - event context
        acceptor - event acceptor
      • setCockpitEventAcceptors

        void setCockpitEventAcceptors​(java.util.Map<java.lang.String,​java.util.List<CockpitEventAcceptor>> acceptorMap)
        Sets the event acceptors to register with this controller.
        Parameters:
        acceptorMap - acceptor map where the key is the controller context code and the value a list of acceptors
      • dispatchEvent

        void dispatchEvent​(java.lang.String context,
                           java.lang.Object source,
                           java.util.Map<java.lang.String,​java.lang.Object> params)
        Notifies all event acceptors which are registered for events with the context code context.
        Parameters:
        context - event context
        source - event source
        params - parameters to be be passed to registered listeners