The principle and application of error handling in Websphere adapter

Source: Internet
Author: User
Tags error handling websphere application server

Introduction to Error handling mechanisms

What is an error binding

In Application Systems, exceptions (Exception) are often present. These exceptions are usually grouped into 2 classes, one being Run-time exceptions (Runtime Exception), which is usually caused by code defects, and the other is business logic exceptions (Business Exception), which are usually due to inaccurate, imperfect, The application system is unable to process the resulting.

For the system developers, the Run-time anomaly is easily captured and processed accordingly, the main way to deal with it is to ignore, after the packaging, to throw, log and so on. For business logic-related exceptions, it is difficult for developers to analyze and process, the best way is to provide these exception information to the application of the caller, by the caller of these business logic related processing. The business logic error that the application system passes to the caller should not be an exception class, rather, it is a business-related structured exception data, so that callers do not care about the implementation of the service and the programming language, simply focus on the returned data (the correct result or the exception data) and handle the data accordingly. In addition, the format of these data is usually independent of the programming language, which is supported by the error binding (Fault Binding) attribute of the Websphere Adapter. In other words, an error binding is a mechanism provided by WebSphere Adapter to deal with business logic exceptions, which distinguishes run-time and business logic exceptions, and provides more meaningful error data to the caller of the application system through this error handling mechanism.

Note: The error binding mechanism currently works only in the WebSphere Process server and in the WebSphere Application Server Feature Pack environment.

Error Binding implementation principle

Error binding is an error-handling mechanism supported by Websphere Adapter, used in outbound scenarios. An error binding has several elements:

Error selector (Fault selector)

Error name (Fault name)

Bad binding type (Fault binding type)

Error (Fault data)

When the WebSphere Adapter encounters an exception, the WebSphere Adapter first invokes the error selector to determine if the exception is an error that is supported by WebSphere Adapter, if it is not, does not, and if so, invokes the error selector to generate the corresponding error name. It then finds the corresponding error binding type based on the wrong name, and finally calls the wrong binding type to generate the appropriate error data and returns the error data to the caller. Figure 1 is the flowchart for the entire error-binding process.

Figure 1. Error binding flowchart

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.