final EjbIIOPService factory = serviceForLocator(locator, deploymentRepository);
if (factory != null) {
return factory.handleForLocator(locator);
}
} else if (object instanceof EJBMetaDataImpl) {
final EJBMetaDataImpl metadata = (EJBMetaDataImpl) object;
Class<?> pk = null;
if (!metadata.isSession()) {
pk = metadata.getPrimaryKeyClass();
}
final EJBLocator<?> locator = EJBClient.getLocatorFor(metadata.getEJBHome());
final EjbIIOPService factory = serviceForLocator(locator, deploymentRepository);
return new EJBMetaDataImplIIOP(metadata.getRemoteInterfaceClass(), metadata.getHomeInterfaceClass(), pk, metadata.isSession(), metadata.isStatelessSession(), (HomeHandle) factory.handleForLocator(locator));
}
return object;
}