org.openorb.orb.core
Class SystemExceptionHelper

java.lang.Object
  extended by org.openorb.orb.core.SystemExceptionHelper

public abstract class SystemExceptionHelper
extends java.lang.Object

This class should be used as the helper for all system exceptions.

Author:
Chris Wood

Method Summary
static org.omg.CORBA.SystemException create(java.lang.String repo_id, int minor, org.omg.CORBA.CompletionStatus completed)
          Create a system exception from it's repository ID, minor value and completion status.
static org.omg.CORBA.SystemException create(java.lang.String repo_id, java.lang.String reasonPrefix, int minor, org.omg.CORBA.CompletionStatus completed)
          Create a system exception from it's repository ID, minor value and completion status.
static org.omg.CORBA.SystemException extract(org.omg.CORBA.Any any)
          Extract a system exception from an any.
static java.lang.String id(org.omg.CORBA.SystemException ex)
          Get the repository ID from an exception.
static void insert(org.omg.CORBA.Any any, org.omg.CORBA.SystemException sysex)
          Insert a system exception into an any.
static org.omg.CORBA.SystemException read(org.omg.CORBA.portable.InputStream is)
          Read a system exception from an input stream.
static org.omg.CORBA.SystemException read(java.lang.String reasonPrefix, org.omg.CORBA.portable.InputStream is)
          Read a system exception from an input stream.
static org.omg.CORBA.TypeCode type(java.lang.String repo_id)
          Get a typecode from a repository ID.
static org.omg.CORBA.TypeCode type(org.omg.CORBA.SystemException ex)
          Get a typecode from an exception.
static void write(org.omg.CORBA.portable.OutputStream out, org.omg.CORBA.SystemException val)
          Write a system excpetion to an output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

type

public static org.omg.CORBA.TypeCode type(java.lang.String repo_id)
Get a typecode from a repository ID.

Parameters:
repo_id - Repository ID of the system exception.
Returns:
the required typecode, or typecode of UNKNOWN for an unknown repository ID.

type

public static org.omg.CORBA.TypeCode type(org.omg.CORBA.SystemException ex)
Get a typecode from an exception.

Parameters:
ex - The exception to get the typecode of.
Returns:
the required typecode, or typecode of UNKNOWN for an unknown exception type.

id

public static java.lang.String id(org.omg.CORBA.SystemException ex)
Get the repository ID from an exception.

Parameters:
ex - the system exception.
Returns:
the repository ID of the system exception, or UNKNOWN for an unknown exception.

insert

public static void insert(org.omg.CORBA.Any any,
                          org.omg.CORBA.SystemException sysex)
Insert a system exception into an any. If the exception type is unknown an unknown exception will be inserted into the any. UnknownExceptions can be successfully inserted/extracted from any types.

Parameters:
any - the any to get inserted into.
sysex - the system exception to insert into the any.

extract

public static org.omg.CORBA.SystemException extract(org.omg.CORBA.Any any)
Extract a system exception from an any. UnknownExceptions can be successfully inserted/extracted from any types.

Parameters:
any - the any to extract from.
Throws:
org.omg.CORBA.BAD_OPERATION - the any does not contain a system exception.

read

public static org.omg.CORBA.SystemException read(org.omg.CORBA.portable.InputStream is)
Read a system exception from an input stream.


read

public static org.omg.CORBA.SystemException read(java.lang.String reasonPrefix,
                                                 org.omg.CORBA.portable.InputStream is)
Read a system exception from an input stream.

Parameters:
reasonPrefix - prefix to add to the reason string.

create

public static org.omg.CORBA.SystemException create(java.lang.String repo_id,
                                                   int minor,
                                                   org.omg.CORBA.CompletionStatus completed)
Create a system exception from it's repository ID, minor value and completion status.


create

public static org.omg.CORBA.SystemException create(java.lang.String repo_id,
                                                   java.lang.String reasonPrefix,
                                                   int minor,
                                                   org.omg.CORBA.CompletionStatus completed)
Create a system exception from it's repository ID, minor value and completion status.

Parameters:
reasonPrefix - prefix to add to the reason string.

write

public static void write(org.omg.CORBA.portable.OutputStream out,
                         org.omg.CORBA.SystemException val)
Write a system excpetion to an output stream.