CORBAException

Inherits From:
NSException

Declared In:
ADORB/CORBAException.h

Class Description

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.

KeyDescription
IDLExceptionTypeKeyNSNumber, 1 for User exception; 2 for System exception. If not set, a User exception is assumed.
IDLExceptionKeyThe corresponding IDLException object that actually marshals the exception. If not set, the IDLExceptionIDKey key must be present.
IDLExceptionIDKeyIDL 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.

Class Methods

+ systemException:(NSString*)name minorCode:(long)code completed:(CORBACompletionStatus)status

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).

+ raise:(NSString*)name minorCode:(long)code completed:(CORBACompletionStatus)status

Creates and raises CORBA System exception.

+ exceptionWithName:(NSString*)name interface:(IDLInterface*)interface

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).

+ userException:(NSString*)namePath info:(NSDictionary*)userInfo

Locates IDL exception with the name path namePath and creates a CORBA User exception.

+ forwardRequestExceptionWithObject:object

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.

+ (void)registerStandardExceptionInfo:(NSDictionary*)info forExceptionName:(NSString*)name

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:

Instance Methods

- (void)setValue:value forKey:(NSString*)key

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.

Constants

CORBACompletionStatus:

Exception userInfo keys