code: @Override
      public void onPluginEvent(PluginEvent event) {
          switch (event.getAction()) {
              case SUBSCRIBE: // Upon initial subscription, begin listening for specified generic events.
                  plugin = event.getPlugin();
                  doSubscribe(true);
                  break;
              
              case LOAD: // Stop listening once loaded.
                  plugin.unregisterListener(this);
                  break;
              
              case UNSUBSCRIBE: // Stop listening for generic events once unsubscribed from plugin events.
                  doSubscribe(false);
                  break;
          }
      }
docs: Listen for plugin lifecycle events.
  
  @see org.carewebframework.shell.plugins.IPluginEventListener#onPluginEvent(org.carewebframework.shell.plugins.PluginEvent)