Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

Share this Page URL
Help

Chapter 7: Exceptions, logging, and trac... > 7.1: Adapter exception handling - Pg. 148

7.1 Adapter exception handling In software development, the term exception refers to a programming construct that is designed to handle conditions which can change the normal flow of program execution. Exception objects and exception traces can convey important information about why the exception has occurred and where in the code it occurred. During adapter development, we should follow these guide lines. 7.1.1 Exception creation during adapter development The root interface defined for the connector architecture exception hierarchy is ResourceException . When we write exception classes that have a specific action or category, the exception classes should always subclass ResourceException. For example, a ConnectionFailedException might represent an adapter-specific connection failure, so when we write ConnectionFailedException class for exceptions in the connection category, we need to extend ResourceException class. This section shows some examples of Service Provider Interface exceptions that extends ResourceException. They are defined in the JCA specification: javax.resource.spi.EISSystemException javax.resource.spi.IllegalStateException javax.resource.spi.ResourceAdapterInternalException