Inherits From:
NSException
Declared In:
ADORB/CORBAException.h
If an exception is raised on the CORBA server during performing a client request it should be passed back to the client. ADORB uses the NSException's userInfo dictionary to store the IDL exception's data. CORBA defines two types of exceptions - the system exceptions and the user exceptions. To marshal the exception's userInfo dictionary, ADORB requires additional entries to be present in this dictionary.
Key | Description |
---|---|
IDLExceptionTypeKey | NSNumber, 1 for User exception; 2 for System exception. If not set, a User exception is assumed. |
IDLExceptionKey | The corresponding IDLException object that actually marshals the exception.
If not set, the IDLExceptionIDKey key must be present. |
IDLExceptionIDKey | IDL exception's typeID |
The other entries, if any, are defined by the IDL definition of the exception.
CORBAException class merely provides the methods for creating of the CORBA System and CORBA User exceptions that populate these required entries accordingly.
Creates a CORBA system exception with the name name. If no exception with the name name is defined in the CORBA_StandardException.idl then the exception with the name "UNKNOWN" is returned. The name of the exception is set to "CORBASystemException", the reason is set to name. The returned object is autoreleased.
See also - exceptionWithName: (CORBAObject).
Creates and raises CORBA System exception.
Creates a CORBA User exception with the name name. The name can be a single name or a name path separated by '/'. This method looks for the IDLException with the name name in the specified IDLInterface interface. If no exception with the name name is found then nil
is returned. The name of the exception is set to "CORBAUserException", the reason is set to name. The returned object is autoreleased.
See also - exceptionWithName: (CORBAObject).
Locates IDL exception with the name path namePath and creates a CORBA User exception.
Creates a forward request exception that when returned to the client will cause the client to redirect invocation to the new target 'object'. The object can be either a CORBAObject instance or an activatable NSObject instance, see Object Activation.
Registers an exception name name with the info dictionary. This allows ORB to marshal an exception with name as a CORBA system exception using the info dictionary. The info dictionary should contain the following key/value pairs:
IDLExceptionIDKey
- the sytem exception's typeID,IDLMinorCodeKey
- the exception's minor code,IDLCompletionStatusKey
- the request completion status, one of CORBA_CompletedYes, CORBA_CompletedNo, CORBA_CompletedMaybe.
If the corresponding IDL definition for the receiver contains item with name key then that item’s value is set to value, otherwise a warning message is logged.
The value must be of proper class to be marshaled - for example, if the item is of type short then the value should be NSNumber.