WebSphere Message Service Clients for C/C++ and .NET, Version 1.2 Operating Systems: Linux, Windows

Handling of non-existent properties in .NET

The handling of non-existent properties in the XMS .NET is broadly consistent with the JMS specification, whilst also maintaining some consistency with the C and C++ implementations of XMS.

In JMS, accessing a non-existent property can result in a Java system exception when a method tries to convert the non-existent (null) value to the required type. If a property does not exist:

If a property does not exist in XMS .NET:

This implementation is different from Java, but it is broadly consistent with the JMS specification, whilst also maintaining some consistency with the XMS C and C++ interfaces. Like the Java implementation, XMS .NET propagates any exceptions from the System.Convert call to the caller. The difference is that XMS explicitly throws NullReferenceExceptions rather than just using the native behavior of the .NET framework through passing null to system conversion routines. If your application sets a property to a String like "abc" and calls GetIntProperty, the System.FormatException thrown by Convert.ToInt32("abc") is propagated to the caller, which is consistent with Java. MessageFormatException is thrown only if the types used for setProperty and getProperty are incompatible. This behavior is also consistent with Java.

Related concepts
Destinations in .NET
Getting and setting properties in .NET
Handling errors in .NET
Using message and exception listeners in .NET

Concept topic

Terms of Use | Rate this page

Last updated: 24 Mar 2006

© Copyright IBM Corporation 2005, 2006. All Rights Reserved.