public OutputStream request(org.omg.CORBA.Object self,
String operation,
boolean responseExpected)
{
ClientInvocationInfo invocationInfo =
orb.createOrIncrementInvocationInfo();
Iterator contactInfoListIterator =
invocationInfo.getContactInfoListIterator();
if (contactInfoListIterator == null) {
contactInfoListIterator = contactInfoList.iterator();
invocationInfo.setContactInfoListIterator(contactInfoListIterator);
}
if (! contactInfoListIterator.hasNext()) {
throw ((CorbaContactInfoListIterator)contactInfoListIterator)
.getFailureException();
}
CorbaContactInfo contactInfo = (CorbaContactInfo) contactInfoListIterator.next();
ClientRequestDispatcher subcontract = contactInfo.getClientRequestDispatcher();
// Remember chosen subcontract for invoke and releaseReply.
// NOTE: This is necessary since a stream is not available in
// releaseReply if there is a client marshaling error or an
// error in _invoke.
invocationInfo.setClientRequestDispatcher(subcontract);
return (OutputStream)
subcontract.beginRequest(self, operation,
!responseExpected, contactInfo);
}