docs: SibRaDispatcher createDispatcher(final AbstractConsumerSession session,
                                       final Reliability unrecoveredReliability,
                                       final int maxFailedDeliveries,
                                       final int sequentialFailureThreshold)
                      throws ResourceException {
  
          final String methodName = "createDispatcher";
          if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
              SibTr.entry(this, TRACE, methodName,
                          new Object[] { session, unrecoveredReliability, maxFailedDeliveries, sequentialFailureThreshold });
          }
  
          if (_closed) {
  
              throw new IllegalStateException(NLS
                              .getString("LISTENER_CLOSED_CWSIV0953"));
  
          }
  
          final SibRaDispatcher dispatcher;
  
          if (_endpointActivation.isEndpointMethodTransactional()) {
  
              if (_endpointConfiguration.getShareDataSourceWithCMP()) {
  
                  dispatcher = new SibRaSynchronizedDispatcher(this,
                                  session, _endpointActivation, unrecoveredReliability, maxFailedDeliveries,
                                  sequentialFailureThreshold);
  
              } else {
  
                  dispatcher = new SibRaTransactionalDispatcher(this,
                                  session, _endpointActivation, _busName, unrecoveredReliability, maxFailedDeliveries,
                                  sequentialFailureThreshold);
  
              }
  
          } else {
  
              if (SibRaMessageDeletionMode.BATCH.equals(_endpointConfiguration
                              .getMessageDeletionMode())) {
  
                  dispatcher = new SibRaBatchMessageDeletionDispatcher(
                                  this, session, _endpointActivation, unrecoveredReliability, maxFailedDeliveries,
                                  sequentialFailureThreshold);
  
              } else if (SibRaMessageDeletionMode.SINGLE
                              .equals(_endpointConfiguration.getMessageDeletionMode())) {
  
                  dispatcher = new SibRaSingleMessageDeletionDispatcher(
                                  this, session, _endpointActivation, unrecoveredReliability, maxFailedDeliveries,
                                  sequentialFailureThreshold);
  
              } else {
  
                  dispatcher = new SibRaNonTransactionalDispatcher(this,
                                  session, _endpointActivation, unrecoveredReliability, maxFailedDeliveries,
                                  sequentialFailureThreshold);
  
              }
  
          }
  
          _dispatcherCount.incrementAndGet();
          if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
              SibTr.debug(this, TRACE, "Creating a dispatcher, there are now " + _dispatcherCount.get() + " open dispatchers");
          }
  
          if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
              SibTr.exit(this, TRACE, methodName, dispatcher);
          }
          return dispatcher;
  
      }