Exemple #1
0
  private synchronized List<Hl7v2Interceptor> getProducerInterceptorChain() {
    if (producerInterceptorChain == null) {
      // set up initial interceptor chain
      List<Hl7v2Interceptor> initialChain = new ArrayList<Hl7v2Interceptor>();
      initialChain.add(new ProducerStringProcessingInterceptor());
      if (isSupportUnsolicitedFragmentation()) {
        initialChain.add(new ProducerRequestFragmenterInterceptor());
      }
      initialChain.add(
          isSupportInteractiveContinuation()
              ? new ProducerMarshalAndInteractiveResponseReceiverInterceptor()
              : new ProducerMarshalInterceptor());
      initialChain.add(new ProducerResponseAcceptanceInterceptor());
      if (isAudit()) {
        initialChain.add(new ProducerAuditInterceptor());
      }
      initialChain.add(new ProducerRequestAcceptanceInterceptor());
      initialChain.add(new ProducerAdaptingInterceptor());

      // add interceptors provided by the user
      List<Hl7v2Interceptor> additionalInterceptors =
          new ArrayList<Hl7v2Interceptor>(mllpComponent.getAdditionalProducerInterceptors());
      additionalInterceptors.addAll(customInterceptors);
      producerInterceptorChain = ChainUtils.createChain(initialChain, additionalInterceptors);
    }
    return producerInterceptorChain;
  }