} else if (String.class.equals(type)) {
objectFactory = new JavaComponentNameFactory(componentContextProvider);
} else {
boolean optional = resource.isOptional();
String mappedName = resource.getMappedName();
ResourceHost resourceHost = resource.getResourceHost();
objectFactory = createResourceObjectFactory(type, mappedName, optional, resourceHost);
}
}
componentContextProvider.addResourceFactory(name, objectFactory);
}