// <reference><interface>
if (contract != null) {
contract.setInterfaceContract((InterfaceContract)extension);
} else {
if (name.getNamespaceURI().equals(SCA10_NS)) {
throw new ContributionReadException(
"Unexpected <interface> element found. It should appear inside a <service> or <reference> element");
} else {
composite.getExtensions().add(extension);
}
}
} else if (extension instanceof Binding) {
// <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(SCA10_NS)) {
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) {
// <component><implementation>
if (component != null) {
component.setImplementation((Implementation)extension);
} else {
if (name.getNamespaceURI().equals(SCA10_NS)) {
throw new ContributionReadException(
"Unexpected <implementation> element found. It should appear inside a <component> element");
} else {
composite.getExtensions().add(extension);
}
}