// May be the bean is already registered.
T bean = session.getRegisteredBean(rscID);
if (bean == null) {
// Create the bean object.
final ResourceDescriptor desc = forceGetDescriptor(beanType);
bean = ReflectUtils.createInstance(beanType, new Object[0]);
((ResourceBean) bean).setID(rscID);
// Register the bean object.
session.registerBean(bean);
// Set property values.
Collection<PropertyDescriptor> properties = desc.getProperties();
for (PropertyDescriptor propDesc : properties) {
this.setPropertyValue(rsc, bean, propDesc);
}
}