org.openorb.CORBA
Class SystemExceptionHelper

java.lang.Object
  |
  +--org.openorb.CORBA.SystemExceptionHelper

public abstract class SystemExceptionHelper
extends java.lang.Object

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

Version:
$Revision: 1.11 $ $Date: 2002/07/21 09:30:46 $
Author:
Chris Wood

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

Constructor Detail

SystemExceptionHelper

public SystemExceptionHelper()
Method Detail

type

public static 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 TypeCode type(SystemException ex)
Get a typecode from an exception.
Parameters:
repo_id - 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(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(Any any,
                          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.
ex - the system exception to insert into the any.

extract

public static SystemException extract(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:
BAD_OPERATION - the any does not contain a system exception.

read

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

read

public static SystemException read(java.lang.String reasonPrefix,
                                   InputStream is)
Read a system exception from an input stream.
Parameters:
reasonPrefix - prefix to add to the reason string.

create

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

create

public static SystemException create(java.lang.String repo_id,
                                     java.lang.String reason,
                                     int minor,
                                     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(OutputStream out,
                         SystemException val)
Write a system excpetion to an output stream.