int[] profileTags = new int[basicAdapter.getEndpointProfiles().size()];
int n = 0;
for (Iterator<Profile> i = basicAdapter.getEndpointProfiles().iterator();
i.hasNext();)
{
Profile profile = i.next();
//MIOP
//if it is a group profile, it can't be added to the object ior
//so do nothing
if (profile instanceof org.jacorb.orb.miop.MIOPProfile)
{
continue;
}
profile.set_object_key (objectKey);
profiles.add (profile);
profileTags[n++] = profile.tag();
TaggedComponentList profileComponents = new TaggedComponentList();
profileComponents.addComponent(create_ORB_TYPE_ID());
componentMap.put(Integer.valueOf(profile.tag()), profileComponents);
if (profile instanceof ProfileBase)
{
// use proxy or ImR address if necessary
patchAddress((ProfileBase)profile, repId, _transient);
// patch primary address port to 0 if SSL is required
if (poa.isSSLRequired())
{
((ProfileBase)profile).patchPrimaryAddress(new IIOPAddress(null, 0));
}
}
}
TaggedComponentList multipleComponents = new TaggedComponentList();
componentMap.put(Integer.valueOf(TAG_MULTIPLE_COMPONENTS.value),
multipleComponents);
// invoke IOR interceptors
if ((interceptor_manager != null) &&
interceptor_manager.hasIORInterceptors())
{
IORInfoImpl info = new IORInfoImpl(this,
poa,
componentMap,
policy_overrides,
profiles);
try
{
interceptor_manager.getIORIterator().iterate( info );
}
catch (Exception e)
{
if (logger.isErrorEnabled())
{
logger.error(e.getMessage());
}
}
}
// add GIOP 1.0 profile if necessary
IIOPProfile iiopProfile = findIIOPProfile(profiles);
if ( (iiopProfile != null)
&& ( this.giopMinorVersion == 0 || this.giopAdd_1_0_Profiles ))
{
Profile profile_1_0 = iiopProfile.to_GIOP_1_0();
profiles.add(profile_1_0);
// shuffle all components over into the multiple components profile
TaggedComponentList iiopComponents =
componentMap.get(Integer.valueOf(TAG_INTERNET_IOP.value));
multipleComponents.addAll(iiopProfile.getComponents());
multipleComponents.addAll(iiopComponents);
// if we only want GIOP 1.0, remove the other profile
if (giopMinorVersion == 0)
{
profiles.remove(iiopProfile);
}
}
if (iiopProfile != null)
{
TaggedComponentList components =
componentMap.get(Integer.valueOf(TAG_INTERNET_IOP.value));
// patch primary address port to 0 if SSL is required
if (isSSLRequiredInComponentList(components))
{
iiopProfile.patchPrimaryAddress(new IIOPAddress(null, 0));
}
}
// marshal the profiles into the IOR and return
TaggedProfile[] tps = null;
if (multipleComponents.isEmpty())
{
tps = new TaggedProfile [profiles.size()];
}
else
{
tps = new TaggedProfile [profiles.size() + 1];
tps[tps.length-1] =
createMultipleComponentsProfile(multipleComponents);
}
TaggedComponentSeqHolder tc = new TaggedComponentSeqHolder();
final TaggedProfileHolder tp = new TaggedProfileHolder();
for (int i = 0; i < profiles.size(); i++)
{
final Profile p = profiles.get(i);
TaggedComponentList clist =
componentMap.get(Integer.valueOf(p.tag()));
final TaggedComponentList c;
if (p instanceof ProfileBase)
{
// If ImR is used, then get rid of direct alternate addresses
// and patch in the ImR alternate addresses.
c = patchTagAlternateIIOPAddresses((ProfileBase) p, clist, repId, _transient);
}
else
{
c = clist;
}
tc.value = c.asArray();
p.marshal (tp, tc);
tps[i] = tp.value;
}
return new IOR(repId, tps);
}