try {
MarshalInputStream is = (MarshalInputStream)
request.getInputObject();
String method = request.getOperationName();
response = request.getProtocolHandler().createResponse(request, null);
MarshalOutputStream os = (MarshalOutputStream)
response.getOutputObject();
if (method.equals("get")) {
// Get the name of the requested service
String serviceKey = is.read_string();
// Look it up
org.omg.CORBA.Object serviceObject =
orb.getLocalResolver().resolve( serviceKey ) ;
// Write reply value
os.write_Object(serviceObject);
} else if (method.equals("list")) {
java.util.Set keys = orb.getLocalResolver().list() ;
os.write_long( keys.size() ) ;
Iterator iter = keys.iterator() ;
while (iter.hasNext()) {
String obj = (String)iter.next() ;
os.write_string( obj ) ;
}
} else {
throw wrapper.illegalBootstrapOperation( method ) ;
}