code: @AnyThread
      protected void safeEndSession ()
      {
          if (!_omgr.isRunning()) {
              log.info("Dropping end session request as we're shutting down " + this + ".");
          } else {
              _omgr.postRunnable(new Runnable() {
                  public void run () {
                      endSession();
                  }
              });
          }
      }
docs: Queues up a runnable on the object manager thread where we can safely end the session.