for (Intent excluded : intent.getExcludedIntents()) {
if (component.getRequiredIntents().contains(excluded)) {
component.getRequiredIntents().remove(excluded);
}
for (Iterator i = component.getPolicySets().iterator(); i.hasNext(); ) {
PolicySet cmpPolicySet = (PolicySet) i.next();
if (cmpPolicySet.getProvidedIntents().contains(excluded)) {
i.remove();
}
}
}
}
for (PolicySet policySet : ((PolicySetAttachPoint)implementation).getPolicySets()) {
for (Intent intent : policySet.getProvidedIntents()) {
for (Intent excluded : intent.getExcludedIntents()) {
if (component.getRequiredIntents().contains(excluded)) {
component.getRequiredIntents().remove(excluded);
}
for (Iterator i = component.getPolicySets().iterator(); i.hasNext(); ) {
PolicySet cmpPolicySet = (PolicySet) i.next();
if (cmpPolicySet.getProvidedIntents().contains(excluded)) {
i.remove();
}
}
}
}
}
}
component.getRequiredIntents().addAll(((PolicySetAttachPoint)implementation).getRequiredIntents());
component.getPolicySets().addAll(((PolicySetAttachPoint)implementation).getPolicySets());
component.getApplicablePolicySets().addAll(((PolicySetAttachPoint)implementation).getApplicablePolicySets());
if ( implementation instanceof OperationsConfigurator ) {
boolean notFound;
List<ConfiguredOperation> opsFromImplementation = new ArrayList<ConfiguredOperation>();
List<ConfiguredOperation> implConfOperations =
new ArrayList<ConfiguredOperation>(((OperationsConfigurator)implementation).getConfiguredOperations());
for ( ConfiguredOperation implConfOp : implConfOperations ) {
notFound = true;
for ( ConfiguredOperation compConfOp : ((OperationsConfigurator)component).getConfiguredOperations() ) {
if ( implConfOp.getName().equals(compConfOp.getName()) ) {
notFound = false;
if (clearImplSettings) {
for (Intent intent : implConfOp.getRequiredIntents()) {
for (Intent excluded : intent.getExcludedIntents()) {
if (compConfOp.getRequiredIntents().contains(excluded)) {
compConfOp.getRequiredIntents().remove(excluded);
}
}
}
for (PolicySet policySet : implConfOp.getPolicySets()) {
for (Intent intent : policySet.getProvidedIntents()) {
for (Intent excluded : intent.getExcludedIntents()) {
if (compConfOp.getRequiredIntents().contains(excluded)) {
compConfOp.getRequiredIntents().remove(excluded);
}
for (Iterator i = compConfOp.getPolicySets().iterator(); i.hasNext(); ) {
PolicySet cmpPolicySet = (PolicySet) i.next();
if (cmpPolicySet.getProvidedIntents().contains(excluded)) {
i.remove();
}
}
}
}