Interfaces and Abstract Classes

As a result of the fact that Java interfaces cannot hold data, an additional layer was added to the Java bindings for internal processing needs within the implementation of the SIDL object model -- such as throwing an (interface) exception. For this reason, wrappers were created for interfaces and abstract classes. Called Wrapper, these classes hold the interface IOR pointer, inherit from gov.llnl.babel.BaseClass, and implement the outer interface. Therefore, all interface and gov.llnl.babel.BaseClass methods -- such as _cast2 and isType -- can be called on the wrapper object. In addition, the wrapper object is returned when an interface is retrieved from an array. The client is not usually affected in this case. The wrapper class is also used for methods that take or return interface arguments and when an exception implemented as an interface is caught. In the latter case, the developer must be sure to catch the wrapper class. Examples appear later in this chapter.



babel-1.4.0
users_guide Last Modified 2008-10-16

http://www.llnl.gov/CASC/components
components@llnl.gov