ProtectedmultitonThe Multiton Key for this app
Protected StaticMULTITON_Message Constants
Initialize this Notifier instance.
This is how a Notifier gets its multitonKey. Calls to sendNotification or to access the facade will fail until after this method has been called.
Mediators, Commands or Proxies may override this method in order to send notifications or access the Multiton Facade instance as soon as possible. They CANNOT access the facade in their constructors, since this method will not yet have been called.
the multitonKey for this Notifier to use
Create and send an Notification.
Keeps us from having to construct new Notification instances in our implementation code.
The name of the notification to be sent.
Optionalbody: anyOptional data to be included with the notification.
Optionaltype: stringOptional type of the notification.
A Base
Notifierimplementation.MacroCommand, Command, MediatorandProxyall have a need to sendNotifications.The
Notifierinterface provides a common method calledsendNotificationthat relieves implementation code of the necessity to actually constructNotifications.The
Notifierclass, which all the above-mentioned classes extend, provides an initialized reference to theFacadeMultiton, which is required for the convenience method for sendingNotifications, but also eases implementation as these classes have frequentFacadeinteractions and usually require access to the facade anyway.NOTE: In the MultiCore version of the framework, there is one caveat to notifiers, they cannot send notifications or reach the facade until they have a valid multitonKey.
The multitonKey is set:
See
Notifier