Skip to main content

Does VisiBroker support the use of Exception as element of sequence?

  • February 16, 2013
  • 0 replies
  • 0 views

Problem:

  • Product Name:Visibroker
  • Product Version: 521
  • Product Component: ORB
  • Platform/OS Version:ALL

Does VisiBroker support the use of Exception as element of sequence?

Resolution:

In processing sequences - it supports both simple and constructed types, but not exceptions.

test IDL :

 // Example 1: This is a sequence created from a simple data type
 typedef sequence bytestream;


 // Example 2: This is a constructed data type, it can be made into a sequence
 struct MyStruct
 {
 string aField;
 };

 typedef sequence MyStructList;


 // Example 3: This is an exception. It CANNOT be made into a sequence
 exception MyException
 {
 string errMsg;
 };

 typedef sequence MyExceptionList; // This will fail

--------------- IDL complete ------------

The following exception is generated when the IDL is compiled:

idl2java exception.idl
exception.idl: 27:::MyException refers to an exception (expected a type name)


Based on the CORBA specification (3-11) which states,

"An identifier declared to be an exception identifier may thereafter appear only in a raises clause of an operation declaration, and nowhere else."

Hence the standard IDL grammar does not support the use of "Exception" as the element of a sequence. VisiBroker conforms to the specification and does not allow Exceptions as an element of a sequence.


#exception
#IDL
#VisiBroker
#Security