// Javadoc inherited.
public ActivatedPolicy fetchPolicy(RuntimePolicyReference reference) {
RuntimeProject project = (RuntimeProject) reference.getProject();
String name = reference.getName();
PolicyType expectedPolicyType = reference.getExpectedPolicyType();
ActivatedPolicy policy = null;
try {
// Look for the policy in the project.
policy = retriever.retrievePolicy(project, name);
// If a specific type was requested then make sure the one that was
// retrieved matches it. If it does not just ignore it.
if (policy != null) {
PolicyType actualPolicyType = policy.getPolicyType();
if (expectedPolicyType != null &&
actualPolicyType != expectedPolicyType) {
if (logger.isInfoEnabled()) {
logger.info("Expected " + expectedPolicyType +