class QueryCacheBean {

    @RolesAllowed({"Administrator", "JBossAdministrator"})
    @JmxManaged
    public String listRunningQueries() {
        RunningQueries rq = getRunningQueries();
        StringBuilder buf = new StringBuilder();
        for (String query : rq.getQueries()) {
            buf.append(query).append("\n");
        }
        return buf.toString();
    }

}