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, so we will get the same result // from any profile. Iterator<Object> iter = ior.iterator(); if (!iter.hasNext()) throw iorWrapper().noProfilesInIor(); TaggedProfile prof = (TaggedProfile) (iter.next()); ObjectId oid = prof.getObjectId(); return oid.getId(); }
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, so we will get the same result // from any profile. Iterator<Object> iter = ior.iterator(); if (!iter.hasNext()) throw iorWrapper().noProfilesInIor(); TaggedProfile prof = (TaggedProfile) (iter.next()); ObjectId oid = prof.getObjectId(); return oid.getId(); }