ReplyHeader_1_2 reply = new ReplyHeader_1_2();
reply.request_id = request.request_id;
ObjectInputStream objectIn;
ObjectOutputStream objectOut;
if (simpleIDL || keyType == 'N' || keyType == 'J') {
// Name Service and JMS use simple IDL interoperability.
objectIn = org.apache.geronimo.interop.rmi.iiop.SimpleObjectInputStream.getInstance(parameters);
objectOut = org.apache.geronimo.interop.rmi.iiop.SimpleObjectOutputStream.getInstance(results);
} else {
// Otherwise use RMI-IIOP interoperability.
objectIn = org.apache.geronimo.interop.rmi.iiop.ObjectInputStream.getInstance(parameters);
objectOut = org.apache.geronimo.interop.rmi.iiop.ObjectOutputStream.getInstance(results);
}
try {
String objectName = null;
for (int colonPos = 0; colonPos < keyLength; colonPos++) {
if (objectKey[colonPos] == ':') {
objectName = UTF8.toString(objectKey, 0, colonPos);
int newKeyLength = keyLength - colonPos - 1;
byte[] newObjectKey = new byte[newKeyLength];
System.arraycopy(objectKey, colonPos + 1, newObjectKey, 0, newKeyLength);
objectKey = newObjectKey;
break;
}
}
if (objectName == null) {
objectName = UTF8.toString(objectKey);
}
processServiceContext(request);
Object object;
try
{
object = nameService.lookup(objectName);
}
catch (javax.naming.NameNotFoundException notFound)
{
warnLookupFailed(clientInfo, notFound);
throw new org.omg.CORBA.OBJECT_NOT_EXIST(objectName);
}
Adapter adapter = (Adapter)object;
if (adapter != null)
{
adapter.invoke(request.operation, objectKey, objectIn, objectOut);
if (objectOut.hasException()) {
reply.reply_status = ReplyStatusType_1_2.USER_EXCEPTION;
} else {
reply.reply_status = ReplyStatusType_1_2.NO_EXCEPTION;
}