Using IOM Component Stubs |
Exception handling for Java clients for the IOM server is not significantly
different from exception handling for any other Java program. Many methods in
the stubs declare that they throw checked exceptions. When calling those
methods, you must do so in a try
block, and you must be sure to
provide a catch
block that handles each possible exception.
Documentation for the stubs provides information
about why each exception is thrown and what to do when one is thrown.
Methods in the stubs also may throw unchecked exceptions when there is an
error related to the distributed nature of your application. For example, an
unchecked exception may be thrown when the communications subsystem fails or
when the stubs are out of date relative to the IOM objects. All of these
exceptions are subclasses of org.omg.CORBA.SystemException
. A
complete list of all subclasses is available in the CORBA specification. Because
they are unchecked exceptions, the Java compiler does not require you to place
your method calls inside a try
block, but you may want to anyway.
Using IOM Component Stubs |