if(DEBUG) System.err.println("##### " + getClass().getName() + ".writeRequest:" + oid + " " + typeDescription + " " + operation);
++ _requestsSend;
MethodDescription methodDescription = typeDescription.getMethodDescription(operation);
Marshal marshal = new Marshal(false, _iBridge);
TargetAddress targetAddress = new TargetAddress(-7,
(short)0,
marshalObjectKey(oid, typeDescription.getTypeName()),
new TaggedProfile(2, new byte[]{(byte)7, (byte)6, (byte)5}),
new IORAddressingInfo(3,
new IOR(new CorbaString8(""),
new TaggedProfile[0])
)
);
LogicalThreadID logicalThreadID = new LogicalThreadID(new OneThreadID[]{new OneThreadID(0, threadId.getBytes())});
ServiceContext serviceContexts[] = new ServiceContext[]{new ServiceContext(4, marshalLogicalThreadID(logicalThreadID))};
// if the type of request is not provided, use methodDescription if available, otherwise fall back to synchron
if(synchron[0] == null) {
if(methodDescription == null)
synchron[0] = new Boolean(true);
else
synchron[0] = new Boolean(!methodDescription.isOneway());
}
int messageType = MsgType_1_1.Request_value;
marshal.writeObject(__RequestHeader_1_2TypeDescription,
new RequestHeader_1_2(++ _requestId,
(byte)(synchron[0].booleanValue() ? 3 : 0),
(byte)0, (byte)0, (byte)0,
targetAddress,
new CorbaString8(operation),
serviceContexts)
);
// write the in parameters
for(int i = 0; i < methodDescription.getInSignature().length; ++ i) {
if(methodDescription.getInSignature()[i] != null) { // is it an in parameter
if(methodDescription.getOutSignature()[i] != null) // is it also an out parameter
marshal.writeObject(methodDescription.getOutSignature()[i].getComponentType(), ((Object [])params[i])[0]);
else // in only
marshal.writeObject(methodDescription.getInSignature()[i], params[i]);
}
}
// add the marshal to the flush list
_flushList.addElement(new Object[]{MsgType_1_1.Request, marshal});