Last updated August 02, 2010 21:28, by Ken Cavanaugh
Current system:
("<PackageName>" "<ClassName>" <GroupName>
(
(<SystemExceptionClass>
(<UpperCaseIdent>
<Code> <LEVEL> "<Message>")
...
)
...
)
)
In Java:
public interface MinorCodeAccess {
int getMinorCode( int code ) ;
}
package <PackageName> ;
@ExceptionWrapper( idPrefix="IOP" )
@ORBException( OMGException=false, group="<GroupName>" ) // or just a number for the group?
public interface <ClassName> extends MinorCodeAccess {
@Message( "<Message>" )
@Log( level=<LEVEL>, id=<Code> )
<SystemExceptionClass> <LowerCaseIdent>( args as needed ) { }
}
Notes:
- The computation of Code depends on Number, SystemExceptionClass, GroupName, and whether this is the OMG standard system exceptions or not.
- @Cause may be used on at most one argument, which must have a type assignment compatible with Throwable, which will be used to chain an exception.
- Three different return types are possible:
- void, in which case only a message is logged, if an @Log annotation is present.
- String, in which case a message may be logged, and the fully I18N message is returned.
- A subtype of SystemException, in which case the exception is returned.
- A log is generated only if @Log is specified, otherwise only the return value (if any) is computed.
- The interface MUST extend MinorCodeAccess, which provides an implementation of getMinorCode.
- This takes advantage of the @ORBException annotation to get the OMGException and group needed to compute the minor code.
- Minor codes can be identified symbolically and referenced in the @Log annotation.
Several steps are needed here:
- A tool is needed (written in Jscheme) that will write out the Java interfaces given a Jscheme file.
- A new annotation (@ORBException) is needed to trigger special processing of exception files for the ORB.
- The code generator needs to properly generate the exception prefix and the minor code for the system exceptions.
- Note that @ORBException means that ONLY sysex, void, and String are allowed as method results.
- The ORB's exception management system needs to be revised:
- No more ORB instance dependent loggers
- Need to add ORB id (when available) to exception records
- Need to keep client code the same
- Move to using only 1 logger instance (no one ever used finer grain logging anyway, because it's too hard to use)
- This eliminates CORBALogDomains completely
- This also eliminates the logDomain X group lookup problem
- Not sure it's even worth preserving the ORB id in the log report
Computing the exception id:
- For OMG exceptions:
- "IOP" ExceptionId "0" MinorCode
- For Sun-specific exceptions:
- "IOP" ExceptionId "1" MinorCode
Exception id is always leading zero padded to 3 digits from the ordinal position of the ClassName in the list:
UNKNOWN BAD_PARAM NO_MEMORY IMP_LIMIT COMM_FAILURE INV_OBJREF NO_PERMISSION INTERNAL MARSHAL INITIALIZE NO_IMPLEMENT BAD_TYPECODE BAD_OPERATION NO_RESOURCES NO_RESPONSE PERSIST_STORE BAD_INV_ORDER TRANSIENT FREE_MEM INV_IDENT INV_FLAG INTF_REPOS BAD_CONTEXT OBJ_ADAPTER DATA_CONVERSION OBJECT_NOT_EXIST TRANSACTION_REQUIRED TRANSACTION_ROLLEDBACK INVALID_TRANSACTION INV_POLICY CODESET_INCOMPATIBLE REBIND TIMEOUT TRANSACTION_UNAVAILABLE BAD_QOS INVALID_ACTIVITY ACTIVITY_COMPLETED ACTIVITY_REQUIRED
Minor code is 200*base + id, where base is the ordinal position of the exception group (corresponding to the file) in:
ORBUtil Activation Naming Interceptors POA IOR Util
We should just add a number 0-6 for this in the ORBException declaration. The actual minor code is based on either the SUNVMCID or the OMG VMCID.





