Пример #1
0
  private synchronized List<Hl7v2Interceptor> getConsumerInterceptorChain() {
    if (consumerInterceptorChain == null) {
      // set up initial interceptor chain
      List<Hl7v2Interceptor> initialChain = new ArrayList<Hl7v2Interceptor>();
      initialChain.add(new ConsumerStringProcessingInterceptor());
      if (isSupportUnsolicitedFragmentation()) {
        initialChain.add(new ConsumerRequestDefragmenterInterceptor());
      }
      initialChain.add(new ConsumerMarshalInterceptor());
      initialChain.add(new ConsumerRequestAcceptanceInterceptor());
      if (isSupportInteractiveContinuation()) {
        initialChain.add(new ConsumerInteractiveResponseSenderInterceptor());
      }
      if (isAudit()) {
        initialChain.add(new ConsumerAuditInterceptor());
      }
      initialChain.add(new ConsumerResponseAcceptanceInterceptor());
      initialChain.add(new ConsumerAdaptingInterceptor(getCharsetName()));
      if (isAudit()) {
        initialChain.add(new ConsumerAuthenticationFailureInterceptor());
      }

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