class QueryCacheBean {

    @RolesAllowed({"Administrator", "JBossAdministrator"})
    @JmxManaged
    public String cancelUserQuery(String id) throws Exception {
        AbstractRunningQuery arq = cache.get(id);
        if (arq != null) {
            try {
                @SuppressWarnings("unused")
                VoidResponse response = query.cancel(id);
                return "Success.";
            } catch (Exception e) {
                return "Failed, check log.";
            }
        } else {
            return "No such query: " + id;
        }
    }

}