View Javadoc
1   /*
2    * Copyright 2015 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *       http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.openehealth.ipf.platform.camel.ihe.core;
18  
19  import org.apache.camel.Endpoint;
20  import org.apache.camel.Processor;
21  import org.openehealth.ipf.commons.ihe.core.chain.Chainable;
22  
23  /**
24   * Generic interceptor interface implementing a Camel {@link Processor}
25   * that supports internal ordering via the {@link Chainable} interface
26   *
27   * @since 3.1
28   */
29  public interface Interceptor<E extends Endpoint> extends Processor, Chainable {
30  
31      /**
32       * @return the processor instance wrapped by this interceptor.
33       */
34      Processor getWrappedProcessor();
35  
36      /**
37       * Lets this interceptor wrap the given processor.
38       *
39       * @param wrappedProcessor processor instance to be wrapped.
40       */
41      void setWrappedProcessor(Processor wrappedProcessor);
42  
43      /**
44       * @return the endpoint that uses this interceptor
45       */
46      E getEndpoint();
47  
48      /**
49       * Sets the endpoint that uses this interceptor
50       *
51       * @param endpoint the endpoint that uses this interceptor
52       */
53      void setEndpoint(E endpoint);
54  }