public void resolve(Object bean, ModelResolver resolver) throws ContributionResolveException {
// Resolve and merge the component type associated with an
// implementation model
if (bean instanceof Implementation) {
Implementation implementation = (Implementation)bean;
String uri = implementation.getURI();
if (uri != null) {
int d = uri.lastIndexOf('.');
if (d != -1) {
uri = uri.substring(0, d) + ".componentType";
// Resolve the component type
ComponentType componentType = assemblyFactory.createComponentType();
componentType.setURI(uri);
componentType.setUnresolved(true);
componentType = resolver.resolveModel(ComponentType.class, componentType);
if (componentType != null && !componentType.isUnresolved()) {
// We found a component type, merge it into the implementation model
implementation.getServices().addAll(componentType.getServices());
implementation.getReferences().addAll(componentType.getReferences());
implementation.getProperties().addAll(componentType.getProperties());
implementation.setConstrainingType(componentType.getConstrainingType());
if (implementation instanceof PolicySetAttachPoint &&
componentType instanceof PolicySetAttachPoint ) {
PolicySetAttachPoint policiedImpl = (PolicySetAttachPoint)implementation;
PolicySetAttachPoint policiedCompType = (PolicySetAttachPoint)componentType;