code: public void messagingEngineDestroyed(final JsMessagingEngine messagingEngine) {
  
          final String methodName = "messagingEngineDestroyed";
          if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
              SibTr.entry(this, TRACE, methodName, messagingEngine);
          }
  
          /*
           * If there are no longer any local messaging engines on the required
           * bus, switch to a remote messaging engine
           */
  
          final JsMessagingEngine[] localMessagingEngines = SibRaEngineComponent
                  .getMessagingEngines(_endpointConfiguration.getBusName());
  
          if (0 == localMessagingEngines.length) {
  
              /*
               * The last local messaging engine for the required bus has been
               * destroyed; attempt to connect to a remote messaging engine
               * instead
               */
  
              SibTr.info(TRACE, "ME_DESTROYED_CWSIV0779", new Object[] {
                      messagingEngine.getName(),
                      _endpointConfiguration.getBusName(), this });
  
              _remoteDestination = true;
  
              // Synchronized so that other threads will see that we're connecting to a remote ME
              synchronized(this) {
                  _remoteMessagingEngine = true;
              }
  
              createRemoteListenerDeactivateOnException(true);
  
          }
  
          if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
              SibTr.exit(this, TRACE, methodName);
          }
  
      }
docs: Notifies the listener that the given messaging engine is being destroyed.
  
  @param messagingEngine
  the messaging engine