ior.value.profiles.length);
ior.value.profiles = profiles;
ior.value.profiles[len - 1] = new org.omg.IOP.TaggedProfile();
ior.value.profiles[len - 1].tag = org.omg.IOP.TAG_INTERNET_IOP.value;
org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer();
OutputStream out = new OutputStream(buf);
out._OB_writeEndian();
org.omg.IIOP.ProfileBody_1_0Helper.write(out, body);
ior.value.profiles[len - 1].profile_data = new byte[buf
.length()];
System.arraycopy(buf.data(), 0,
ior.value.profiles[len - 1].profile_data, 0, buf
.length());
}
} else {
if (multiProfile_) {
//
// Add one profile for each host
//
for (int i = 0; i < hosts_.length; i++) {
org.omg.IIOP.ProfileBody_1_1 body = new org.omg.IIOP.ProfileBody_1_1();
body.iiop_version = new org.omg.IIOP.Version(
profileInfo.major, profileInfo.minor);
body.host = hosts_[i];
if (port_ >= 0x8000)
body.port = (short) (port_ - 0xffff - 1);
else
body.port = (short) port_;
body.object_key = profileInfo.key;
body.components = new org.omg.IOP.TaggedComponent[components
.size()];
components.copyInto(body.components);
int len = ior.value.profiles.length + 1;
org.omg.IOP.TaggedProfile[] profiles = new org.omg.IOP.TaggedProfile[len];
System.arraycopy(ior.value.profiles, 0, profiles, 0,
ior.value.profiles.length);
ior.value.profiles = profiles;
ior.value.profiles[len - 1] = new org.omg.IOP.TaggedProfile();
ior.value.profiles[len - 1].tag = org.omg.IOP.TAG_INTERNET_IOP.value;
org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer();
OutputStream out = new OutputStream(buf);
out._OB_writeEndian();
org.omg.IIOP.ProfileBody_1_1Helper.write(out, body);
ior.value.profiles[len - 1].profile_data = new byte[buf
.length()];
System.arraycopy(buf.data(), 0,
ior.value.profiles[len - 1].profile_data, 0, buf
.length());
}
} else {
//
// Add a single tagged profile. If there are additional
// hosts, add a tagged component for each host.
//
org.omg.IIOP.ProfileBody_1_1 body = new org.omg.IIOP.ProfileBody_1_1();
body.iiop_version = new org.omg.IIOP.Version(profileInfo.major,
profileInfo.minor);
body.host = hosts_[0];
if (port_ >= 0x8000)
body.port = (short) (port_ - 0xffff - 1);
else
body.port = (short) port_;
body.object_key = profileInfo.key;
for (int i = 1; i < hosts_.length; i++) {
org.omg.IOP.TaggedComponent c = new org.omg.IOP.TaggedComponent();
c.tag = org.omg.IOP.TAG_ALTERNATE_IIOP_ADDRESS.value;
org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer();
OutputStream out = new OutputStream(buf);
out._OB_writeEndian();
out.write_string(hosts_[i]);
out.write_ushort(body.port);
c.component_data = new byte[buf.length()];
System.arraycopy(buf.data(), 0, c.component_data, 0, buf
.length());
components.addElement(c);
}
body.components = new org.omg.IOP.TaggedComponent[components
.size()];
components.copyInto(body.components);
int len = ior.value.profiles.length + 1;
org.omg.IOP.TaggedProfile[] profiles = new org.omg.IOP.TaggedProfile[len];
System.arraycopy(ior.value.profiles, 0, profiles, 0,
ior.value.profiles.length);
ior.value.profiles = profiles;
ior.value.profiles[len - 1] = new org.omg.IOP.TaggedProfile();
ior.value.profiles[len - 1].tag = org.omg.IOP.TAG_INTERNET_IOP.value;
org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer();
OutputStream out = new OutputStream(buf);
out._OB_writeEndian();
org.omg.IIOP.ProfileBody_1_1Helper.write(out, body);
ior.value.profiles[len - 1].profile_data = new byte[buf
.length()];
System.arraycopy(buf.data(), 0,
ior.value.profiles[len - 1].profile_data, 0, buf