code: protected void beforeDelivery(final MessageEndpoint endpoint)
              throws ResourceException {
  
          final String methodName = "beforeDelivery";
          if (TRACE.isEntryEnabled()) {
              SibTr.entry(this, TRACE, methodName, endpoint);
          }
  
          /*
           * Invoke beforeDelivery on the endpoint
           */
  
          try {
  
              endpoint.beforeDelivery(_invoker.getEndpointMethod());
  
          } catch (final NoSuchMethodException exception) {
  
              FFDCFilter.processException(exception, CLASS_NAME + "."
                      + methodName, FFDC_PROBE_2, this);
              if (TRACE.isEventEnabled()) {
                  SibTr.exception(this, TRACE, exception);
              }
              throw new ResourceAdapterInternalException(NLS.getFormattedMessage(
                      ("BEFORE_DELIVERY_CWSIV1200"), new Object[] { exception,
                              endpoint }, null), exception);
  
          }
          
          if (TRACE.isEntryEnabled()) {
              SibTr.exit(this, TRACE, methodName);
          }
  
      }
docs: Invoked before delivery of a message. Calls <code>beforeDelivery</code>
  on the endpoint and then deletes the message under that transaction.
  
  @param endpoint
  the message endpoint we are using
  @throws ResourceAdapterInternalException
  if the endpoint method does not exist or the
  <code>XAResource</code> is not enlisted
  @throws ResourceException
  if before delivery failed