com.thomsonreuters.ema.access.OmmConsumerErrorClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ema Show documentation
Show all versions of ema Show documentation
Elektron Message API (EMA) Java Edition
///*|-----------------------------------------------------------------------------
// *| This source code is provided under the Apache 2.0 license --
// *| and is provided AS IS with no warranty or guarantee of fit for purpose. --
// *| See the project's LICENSE.md for details. --
// *| Copyright (C) 2019 Refinitiv. All rights reserved. --
///*|-----------------------------------------------------------------------------
package com.thomsonreuters.ema.access;
/**
* OmmConsumerErrorclient class provides callback mechanism used in place of exceptions.
*
* By default OmmConsumer class throws exceptions if a usage error occurs.
*
Specifying OmmConsumerErrorClient on the constructor of OmmConsumer overwrites this behaviour.
*
Instead of throwing exceptions, respective callback method on OmmConsumerErrorClient will be invoked.
*
* @see OmmConsumer
* @see OmmException
* @see OmmInvalidUsageException
* @see OmmInvalidHandleException
*/
public interface OmmConsumerErrorClient
{
/**
* Invoked upon receiving an invalid handle.
*
Requires OmmConsumer constructor to have an OmmConsumerErrorClient.
*
* @param handle value of the handle that is invalid
* @param text specifies associated error text
*/
public void onInvalidHandle(long handle, String text);
/**
* Invoked in the case of invalid usage.
*
Requires OmmConsumer constructor to have an OmmConsumerErrorClient.
*
* @param text specifies associated error text
*/
public default void onInvalidUsage(String text) {}
/**
* Invoked in the case of invalid usage.
*
Requires OmmConsumer constructor to have an OmmConsumerErrorClient.
* 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.
*
* @param text specifies associated error text
* @param errorCode specifies associated error code
*/
public default void onInvalidUsage(String text, int errorCode) {}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy