org.apache.cxf.endpoint

## Class PreexistingConduitSelector

- java.lang.Object
- - org.apache.cxf.endpoint.PreexistingConduitSelector

- All Implemented Interfaces:
    Closeable, AutoCloseable, ConduitSelector

      public class PreexistingConduitSelector
      extends Object
      implements ConduitSelector, Closeable

  Strategy for retreival of a pre-existing Conduit to mediate an outbound message.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PreexistingConduitSelector(Conduit c)` Constructor.
    `PreexistingConduitSelector(Conduit c, Endpoint e)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `void` | `complete(Exchange exchange)` Called on completion of the MEP for which the Conduit was required.
    `Endpoint` | `getEndpoint()`
    `void` | `prepare(Message message)` Called prior to the interceptor chain being traversed.
    `Conduit` | `selectConduit(Message message)` Called when a Conduit is actually required.
    `void` | `setEndpoint(Endpoint ep)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PreexistingConduitSelector

          public PreexistingConduitSelector(Conduit c)

      Constructor.
      Parameters:
        `c` - the pre-existing Conduit.

    - #### PreexistingConduitSelector

          public PreexistingConduitSelector(Conduit c,
                                            Endpoint e)

      Constructor.
      Parameters:
        `c` - the pre-existing Conduit.
        `e` - the target Endpoint

  - ### Method Detail

    - #### prepare

          public void prepare(Message message)

      Called prior to the interceptor chain being traversed.
      Specified by:
        `prepare` in interface `ConduitSelector`
      Parameters:
        `message` - the current Message

    - #### selectConduit

          public Conduit selectConduit(Message message)

      Called when a Conduit is actually required.
      Specified by:
        `selectConduit` in interface `ConduitSelector`
      Parameters:
        `message` -
      Returns:
        the Conduit to use for mediation of the message

    - #### complete

          public void complete(Exchange exchange)

      Called on completion of the MEP for which the Conduit was required.
      Specified by:
        `complete` in interface `ConduitSelector`
      Parameters:
        `exchange` - represents the completed MEP

    - #### getEndpoint

          public Endpoint getEndpoint()

      Specified by:
        `getEndpoint` in interface `ConduitSelector`
      Returns:
        the encapsulated Endpoint

    - #### setEndpoint

          public void setEndpoint(Endpoint ep)

      Specified by:
        `setEndpoint` in interface `ConduitSelector`
      Parameters:
        `ep` - the endpoint to encapsulate

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Throws:
        `IOException`

Apache CXF