RefGenerator refGenerator = AdapterWrapper.getRefGenerator(deploymentId);
if (refGenerator == null) {
throw new MARSHAL("Could not find RefGenerator for deployment id: " + deploymentId);
}
if (InterfaceType.EJB_HOME == servantType) {
obj = refGenerator.genHomeReference();
} else if (InterfaceType.EJB_OBJECT == servantType) {
obj = refGenerator.genObjectReference(servant.getPrimaryKey());
} else {
log.error("Encountered unknown local invocation handler of type " + servantType + ":" + deploymentId);
throw new MARSHAL("Internal server error while marshaling the reply", 0, CompletionStatus.COMPLETED_YES);