protected void computePolicies(Composite composite, Monitor monitor) {
// compute policies recursively
for (Component component : composite.getComponents()) {
Implementation implementation = component.getImplementation();
if (implementation instanceof Composite) {
computePolicies((Composite)implementation, monitor);
}
}
for (Component component : composite.getComponents()) {
// Inherit default policies from the component to component-level contracts.
// This must be done BEFORE computing implementation policies because the
// implementation policy computer removes from the component any
// intents and policy sets that don't apply to implementations.
PolicyConfigurationUtil.inheritDefaultPolicies(component, component.getServices());
PolicyConfigurationUtil.inheritDefaultPolicies(component, component.getReferences());
Implementation implemenation = component.getImplementation();
try {
PolicyConfigurationUtil.computeImplementationIntentsAndPolicySets(implemenation, component);
} catch ( Exception e ) {
error(monitor, "PolicyRelatedException", implemenation, e);
//throw new RuntimeException(e);