public interface IManagerConfigurator
HttpConversationManager
object for a given use case. Implementations usually add request/response filters, set various listeners and are either
singletons or objects following the Builder design pattern.
Make sure the configure(HttpConversationManager)
method is invoked prior to creating the first conversation with the manager.
Implementors should consider using the closeSettings()
method to prevent other
configurators or components to interfere with the settings applied on a manager. For example, if a configurator implementation applies a custom SSL socket factory listener on a manager which is
essential for the behaviour the configurator repesents (for ex.: because the configured listener is collaborating with some request filters) then closing of the corresponding setting can prevent
conflicts. This is needed as multiple configurators might be used to set up a conversation manager, not to mention that the client code is also allowed to make modifications on it.
Modifier and Type | Method and Description |
---|---|
HttpConversationManager |
configure(HttpConversationManager manager)
Configures the specified manager object.
|
HttpConversationManager configure(HttpConversationManager manager)
Implementations which are not idempotent are highly recommended to use the configuredBy
and
isConfiguredBy
methods of the specified manager, as follows:
public HttpConversationManager configure(HttpConversationManager manager) { if (manager.isConfiguredBy(this)) ...; // Do not perform configuration again. Simply return the manager or throw an exception. return manager .addFilter(...) .addFilter(...) .set***(...) *.configuredBy(this); }The important parts of the example are at the very beginning and at the very end. The following flow is recommended to prevent from configuring a single manager multiple times with the same configurator.
manager
- the manager to configure, must be non-null