What is the correct way to use SoamFactory initialization and uninitialization?
Regardless of whether you are using the IBM® Spectrum Symphony API in a server or standalone client, the initialization and uninitialization rules are the same.
Initialization
You must initialize the IBM Spectrum Symphony API before further use. The API initialization is valid for the whole process. So, if you are using the IBM Spectrum Symphony API in multiple threads, initializing the API in one thread will mean that the API can be used in any of the other threads in the process.
- C++: SoamFactory::initialize()
- Java™: SoamFactory.initialize()
- .NET: SoamFactory.Initialize()
The API will be initialized the first time that the method is called. Subsequent calls to the initialization method will have no effect. Each thread can perform its own SoamFactory initialization before using the IBM Spectrum Symphony API.
Uninitialization
- C++: SoamFactory::uninitialize()
- Java: SoamFactory.uninitialize()
- .NET: SoamFactory.Uninitialize()
You cannot re-initialize the API after it has been uninitialized.
If you are using the IBM Spectrum Symphony API in a server application or daemon process, you should uninitialize the API only when the server is shutting itself down. If this is impossible to do, you may consider not uninitializing the API at all. However, this is not recommended.