PolicyRegistry registry = bus.getExtension(PolicyEngine.class).getRegistry();
Policy resolved = registry.lookup(absoluteURI);
if (null != resolved) {
return resolved;
}
ReferenceResolver resolver = new ReferenceResolver() {
public Policy resolveReference(String uri) {
PolicyBean pb = (PolicyBean)context.getBean(uri);
if (null != pb) {
PolicyBuilder builder = bus.getExtension(PolicyBuilder.class);
return builder.getPolicy(pb.getElement());
}
return null;
}
};
resolved = resolver.resolveReference(uri);
if (null != resolved) {
ref.setURI(absoluteURI);
registry.register(absoluteURI, resolved);
}
return resolved;