EMA C++ Edition
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
List of all members | Protected Member Functions
thomsonreuters::ema::access::OmmProviderErrorClient Class Reference

OmmProviderErrorClient class provides callback mechanism used in place of exceptions. More...

Public Member Functions

Callbacks
virtual void onInvalidHandle (UInt64 handle, const EmaString &text)
 
virtual void onInaccessibleLogFile (const EmaString &filename, const EmaString &text)
 
virtual void onMemoryExhaustion (const EmaString &text)
 
virtual void onInvalidUsage (const EmaString &text)
 
virtual void onInvalidUsage (const EmaString &text, Int32 errorCode)
 
virtual void onSystemError (Int64 code, void *ptr, const EmaString &text)
 
virtual void onJsonConverter (const EmaString &text, Int32 errorCode, const ProviderSessionInfo &sessionInfo)
 
Destructor
virtual ~OmmProviderErrorClient ()
 

Protected Member Functions

 OmmProviderErrorClient ()
 

Detailed Description

By default OmmProvider class throws exceptions if usage errors occur. Specifying OmmProviderErrorClient on the constructor of OmmProvider overwrites this behaviour. Instead of throwing exceptions, respective callback methods on OmmProviderErrorClient will be invoked.

Remarks
Thread safety of all the methods in this class depends on user's implementation.
See Also
OmmProvider, OmmException, OmmInvalidUsageException, OmmInvalidHandleExeption, OmmMemoryExhaustionException, OmmInaccessibleLogFile, OmmSystemException, OmmJsonConverterException, ProviderSessionInfo, EmaString

Definition at line 45 of file OmmProviderErrorClient.h.

Constructor & Destructor Documentation

virtual thomsonreuters::ema::access::OmmProviderErrorClient::~OmmProviderErrorClient ( )
virtual
thomsonreuters::ema::access::OmmProviderErrorClient::OmmProviderErrorClient ( )
protected

Member Function Documentation

virtual void thomsonreuters::ema::access::OmmProviderErrorClient::onInaccessibleLogFile ( const EmaString filename,
const EmaString text 
)
virtual

Invoked when log file is inaccessible. Requires OmmProvider constructor to have an OmmProviderErrorClient.

Parameters
[out]filenameidentifies file name that was not able to b open
[out]textspecifies associated error text
Returns
void
virtual void thomsonreuters::ema::access::OmmProviderErrorClient::onInvalidHandle ( UInt64  handle,
const EmaString text 
)
virtual

Invoked upon receiving an invalid handle. Requires OmmProvider constructor to have an OmmProviderErrorClient.

Parameters
[out]handlevalue of the handle that is invalid
[out]textspecifies associated error text
Returns
void
virtual void thomsonreuters::ema::access::OmmProviderErrorClient::onInvalidUsage ( const EmaString text)
virtual

Invoked in the case of invalid usage. Requires OmmProvider constructor to have an OmmProviderErrorClient.

Parameters
[out]textspecifies associated error text
Returns
void
virtual void thomsonreuters::ema::access::OmmProviderErrorClient::onInvalidUsage ( const EmaString text,
Int32  errorCode 
)
virtual

Invoked in the case of invalid usage. Requires OmmProvider constructor to have an OmmProviderErrorClient.

Remarks
This method provides an additional error code for applications to check and handle the error appropriately.
The applications should override only one of the onInvalidUsage() method to avoid receiving two callback calls for an invalid usage error.
Parameters
[out]textspecifies associated error text
[out]errorCodespecifies associated error code
Returns
void
virtual void thomsonreuters::ema::access::OmmProviderErrorClient::onJsonConverter ( const EmaString text,
Int32  errorCode,
const ProviderSessionInfo sessionInfo 
)
virtual
Invoked in the case of Json converter error. Requires OmmProvider constructor to have an OmmProviderErrorClient.
Parameters
[out]textspecifies associated error text
[out]errorCodespecifies associated error code
[out]sessionInfospecifies associated session information
Returns
void
virtual void thomsonreuters::ema::access::OmmProviderErrorClient::onMemoryExhaustion ( const EmaString text)
virtual

Invoked in the case of memory exhaustion. Requires OmmProvider constructor to have an OmmProviderErrorClient.

Parameters
[out]textspecifies associated error text
Returns
void
virtual void thomsonreuters::ema::access::OmmProviderErrorClient::onSystemError ( Int64  code,
void *  ptr,
const EmaString text 
)
virtual

Invoked in the case of an underlying system error. Requires OmmProvider constructor to have an OmmProviderErrorClient.

Parameters
[out]codespecifies system exception code
[out]specifiessystem exception pointer
[out]textspecifies associated error text
Returns
void