In the following process, the value for ProviderType is dependent on the type of provider with which you are dealing:
• For non-interactive providers, ProviderType is NiProvider.
• For interactive providers, ProviderType is IProvider.
To establish a connection and submit items:
1. (Optional) Specify a configuration using the EmaConfig.xml file.
Specifying a configuration in EmaConfig.xml is optional because the Enterprise Message API provides a default configuration which is usually sufficient in simple application cases.
2. Create the appropriate OmmProviderTypeConfig object (for details, refer to Section 5.4):
• For a non-interactive provider, create an OmmNiProviderConfig object.
• For an interactive provider, create an OmmIProviderConfig object
3. (Optional) Change the Enterprise Message API configuration using methods on the OmmProviderTypeConfig class.
If EmaConfig.xml file is not used, then at a minimum:
• Non-interactive provider applications might need to modify both the default host address and port.
• Interactive provider applications might need to modify the default port.
4. (Conditional) Implement an application callback client class that inherits from the OmmProviderClient class (for details, refer to Section 5.2).
An application might need to override the default callback implementation and provide its own business logic. Not all methods need to be overridden: only those that require the application’s business logic.
• For non-interactive providers, this step is optional because the application may choose not to open login or dictionary items. In such cases, the provider application will not receive return messages.
• For interactive providers, this step is required, because at a minimum, the application needs to handle all inbound login domain and item request messages.
5. (Optional) Implement an application error client class that inherits from the OmmProviderErrorClient class (for details, refer to Section 5.2).
To be effectively notified about error conditions, the application needs to override any default, error callback methods.
6. Create an OmmProvider object and pass the OmmProviderTypeConfig object (and if needed, also pass in the application error client object), and optionally in NiProvider only, register for Login events by passing in an application callback client class.
7. (Optional) For non-interactive providers, open login and dictionary items using the OmmProvider::registerClient() method.
8. Process received messages.
9. Create, populate, and submit item messages (refresh, update, status).
• For non-interactive providers, the application needs to associate each item with a handle that uniquely identifies the item.
• For interactive providers, the application needs to use the handle from the OMMProviderEvent.
10. (Optional) Submit GenericMsg messages using the appropriate OmmProvider class methods.