示例#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;
  }
示例#2
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;
  }