code: synchronized protected void addMessagingEngine(
              final JsMessagingEngine messagingEngine) throws ResourceException {
  
          final String methodName = "addMessagingEngine";
          if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
              SibTr.entry(this, TRACE, methodName, messagingEngine);
          }
  
          if (isListenerRequired(messagingEngine)) {
  
              createListener(messagingEngine);
  
              SibTr.info(TRACE, "NEW_CONSUMER_CWSIV0764", new Object[] {
                      _endpointConfiguration.getBusName(),
                      messagingEngine.getName(),
                      _endpointConfiguration.getDestination()
                              .getDestinationName() });
  
          }
  
          if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
              SibTr.exit(this, TRACE, methodName);
          }
  
      }
docs: If the messaging engine is one of the required set or there are no
  required messaging engines and there are no other connections then create
  a listener.
  
  @param messagingEngine
  the messaging engine to connect to
  @throws ResourceException
  if determining the required messaging engines fails or if
  creation of a listener fails