code: public void addInventoryListener(InventoryListener listener) {
          this.inventoryListenerSupport.inventoryListenerRWLock.writeLock().lock();
          try {
              status.assertInitialOrStopped(getClass(), "addInventoryListener()");
              this.inventoryListenerSupport.inventoryListeners.add(listener);
              LOG.debugf("Added inventory listener [%s] for endpoint [%s]", listener, getMonitoredEndpoint());
          } finally {
              this.inventoryListenerSupport.inventoryListenerRWLock.writeLock().unlock();
          }
      }
docs: Works only before {@link #start()} or after {@link #stop()}.
  
  @param listener to add