if (proxy instanceof EJBHome) {
return refGenerator.genHomeReference();
} else if (proxy instanceof EJBObject) {
Object primaryKey = null;
if (deploymentInfo.getComponentType() == BeanType.STATEFUL) {
RegistryId id = (RegistryId)((EjbObjectProxyHandler)ejbProxyHandler).getRegistryId();
primaryKey = id.getPrimaryKey();
}
else if (deploymentInfo.getComponentType() != BeanType.STATELESS) {
EJBObject ejbObject = (EJBObject) proxy;
primaryKey = ejbObject.getPrimaryKey();
}