if (orb.subcontractDebugFlag) {
dprint(".consumeServiceContexts->: "
+ opAndId(request));
}
ServiceContexts ctxts = request.getRequestServiceContexts();
ServiceContext sc ;
GIOPVersion giopVersion = request.getGIOPVersion();
// we cannot depend on this since for our local case, we do not send
// in this service context. Can we rely on just the CodeSetServiceContext?
// boolean rtSC = false; // Runtime ServiceContext
boolean hasCodeSetContext = processCodeSetContext(request, ctxts);
if (orb.subcontractDebugFlag) {
dprint(".consumeServiceContexts: " + opAndId(request)
+ ": GIOP version: " + giopVersion);
dprint(".consumeServiceContexts: " + opAndId(request)
+ ": as code set context? " + hasCodeSetContext);
}
sc = ctxts.get(
SendingContextServiceContext.SERVICE_CONTEXT_ID ) ;
if (sc != null) {
SendingContextServiceContext scsc =
(SendingContextServiceContext)sc ;
IOR ior = scsc.getIOR() ;
try {
((CorbaConnection)request.getConnection())
.setCodeBaseIOR(ior);
} catch (ThreadDeath td) {
throw td ;
} catch (Throwable t) {
throw wrapper.badStringifiedIor( t ) ;
}
}
// the RTSC is sent only once during session establishment. We
// need to find out if the CodeBaseRef is already set. If yes,
// then also the rtSC flag needs to be set to true
// this is not possible for the LocalCase since there is no
// IIOPConnection for the LocalCase
// used for a case where we have JDK 1.3 supporting 1.0 protocol,
// but sending 2 service contexts, that is not normal as per
// GIOP rules, based on above information, we figure out that we
// are talking to the legacy ORB and set the ORB Version Accordingly.
// this special case tell us that it is legacy SUN orb
// and not a foreign one
// rtSC is not available for localcase due to which this generic
// path would fail if relying on rtSC
//if (giopVersion.equals(GIOPVersion.V1_0) && hasCodeSetContext && rtSC)
boolean isForeignORB = false;
if (giopVersion.equals(GIOPVersion.V1_0) && hasCodeSetContext) {
if (orb.subcontractDebugFlag) {
dprint(".consumeServiceCOntexts: " + opAndId(request)
+ ": Determined to be an old Sun ORB");
}
orb.setORBVersion(ORBVersionFactory.getOLD()) ;
// System.out.println("setting legacy ORB version");
} else {
// If it didn't include our ORB version service context (below),
// then it must be a foreign ORB.
isForeignORB = true;
}
// try to get the ORBVersion sent as part of the ServiceContext
// if any
sc = ctxts.get( ORBVersionServiceContext.SERVICE_CONTEXT_ID ) ;
if (sc != null) {
ORBVersionServiceContext ovsc =
(ORBVersionServiceContext) sc;
ORBVersion version = ovsc.getVersion();