final long start = System.currentTimeMillis();
final XQueryContext context = expression.getContext();
//check access to the query
final XACMLSource source = expression.getSource();
try {
final ExistPDP pdp = context.getPDP();
if(pdp != null) {
final RequestCtx request = pdp.getRequestHelper().createQueryRequest(context, source);
pdp.evaluate(request);
}
} catch(final PermissionDeniedException pde) {
throw new XPathException("Permission to execute query: " + source.createId() + " denied.", pde);
}
expression.reset();
if(resetContext) {
//context.setBroker(broker);