private byte[] internalReferenceToId(
org.omg.CORBA.Object reference ) throws WrongAdapter
{
IOR ior = ORBUtility.getIOR( reference ) ;
IORTemplateList thisTemplate = ior.getIORTemplates() ;
ObjectReferenceFactory orf = getCurrentFactory() ;
IORTemplateList poaTemplate =
IORFactories.getIORTemplateList( orf ) ;
if (!poaTemplate.isEquivalent( thisTemplate ))
throw new WrongAdapter();
// Extract the ObjectId from the first TaggedProfile in the IOR.
// If ior was created in this POA, the same ID was used for
// every profile through the profile templates in the currentFactory,