Package com.loop54
Class Loop54ClientProvider
java.lang.Object
com.loop54.Loop54ClientProvider
- All Implemented Interfaces:
ILoop54ClientProvider,Closeable,AutoCloseable
Class for handling multiple instances of ILoop54Client. Should be used if working against multiple instances of the
Loop54 e-commerce search engine from the same application. The class is thread safe.
-
Constructor Summary
ConstructorsConstructorDescriptionLoop54ClientProvider(IRemoteClientInfoProvider remoteClientInfoProvider, Loop54SettingsCollection settingsCollection) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes all clients and releases any system resources associated with them.Get a named instance of ILoop54Client.
-
Constructor Details
-
Loop54ClientProvider
public Loop54ClientProvider(IRemoteClientInfoProvider remoteClientInfoProvider, Loop54SettingsCollection settingsCollection) - Parameters:
remoteClientInfoProvider- The client info provider to use in the clients.settingsCollection- One or more settings to setup clients for.
-
-
Method Details
-
getNamed
Get a named instance of ILoop54Client. Will throw if an instance with the same name is not found.- Specified by:
getNamedin interfaceILoop54ClientProvider- Parameters:
instanceName- Name of a instance. For example 'swedish', 'english' or 'content'.- Returns:
- The named instance.
-
getSingleOrThrow
-
close
Closes all clients and releases any system resources associated with them. After calling this method, the provider and its clients should no longer be used.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- if an I/O error occurs while closing any of the clients
-