composite.getExtensions().add(extension);
}
}
} else if (extension instanceof Binding) {
if (extension instanceof PolicySubject) {
ExtensionType bindingType = intentAttachPointTypeFactory.createBindingType();
bindingType.setType(name);
bindingType.setUnresolved(true);
((PolicySubject)extension).setExtensionType(bindingType);
}
// <service><binding> and
// <reference><binding>
if (callback != null) {
callback.getBindings().add((Binding)extension);
} else {
if (contract != null) {
contract.getBindings().add((Binding)extension);
} else {
if (name.getNamespaceURI().equals(SCA11_NS)) {
error(monitor, "UnexpectedBindingElement", extension);
//throw new ContributionReadException("Unexpected <binding> element found. It should appear inside a <service> or <reference> element");
} else {
composite.getExtensions().add(extension);
}
}
}
} else if (extension instanceof Implementation) {
if (extension instanceof PolicySubject) {
ExtensionType implType =
intentAttachPointTypeFactory.createImplementationType();
implType.setType(name);
implType.setUnresolved(true);
((PolicySubject)extension).setExtensionType(implType);
}
// <component><implementation>
if (component != null) {
component.setImplementation((Implementation)extension);