log.debug("Attaching policy " + p.getResourceName() + " (" + p.getResourceId() + ") to resource "
+ resource.getResourceName() + "(id=" + resource.getResourceId() + ", type="
+ resource.getResourceType() + ")");
try {
attachResourceToPolicy(resource, p, idx++, session.getUser().getRealm());
CoreServlet.getServlet().fireCoreEvent(new ResourceAttachedToPolicyEvent(this, resource, p, session, CoreEvent.STATE_SUCCESSFUL));
}
catch(Exception e) {
CoreServlet.getServlet().fireCoreEvent(new ResourceAttachedToPolicyEvent(this, resource, p, session, CoreEvent.STATE_UNSUCCESSFUL));
throw e;
}
}
}
}