Contents Using IOM Component Stubs Previous Next

IOM Objects That Support More Than One Stub

Java CORBA stubs for IOM objects represent an interface that is implemented by the IOM object. Some IOM objects implement more than one interface, so you can use more than one stub to communicate with those objects. If you have a reference to a stub for one interface that an IOM object implements, you can get a reference to a stub for any other interface that the IOM object implements using the narrow() method on the Helper class for that stub. If you try to narrow an object reference to a stub for an interface that the IOM object does not implement, then the narrow() method returns null.

The following example uses the Fileref object, which implements the interfaces com.sas.iom.SAS.IFileref and com.sas.iom.SAS.IFileInfo.

com.sas.iom.SAS.IFileref iFileRef = 
   sasFileService.UseFileref("MY_FILE");
com.sas.iom.SAS.IFileInfo iFileInfo = 
   com.sas.iom.SAS.IFileInfoHelper.narrow(iFileRef);

Contents Using IOM Component Stubs Previous Next