if (bean instanceof ServiceRegistryAware) {
ServiceRegistryAware psa = (ServiceRegistryAware) bean;
psa.setServiceRegistry(serviceRegistry);
}
if (bean instanceof ProxyFactoryCreatorAware) {
ProxyFactoryCreatorAware spa = (ProxyFactoryCreatorAware) bean;
spa.setProxyFactoryCreator(serviceProxyFactoryCreator);
}
return bean;
}