- initialize();
- refresh();
- service.insertRuleAfter(aIndex, aRule);
- save();
- }
-
- /**
- * Refreshes the state of the service through hibernate.
- */
- private synchronized void refresh() {
- long time = System.currentTimeMillis();
-
- if ((time - lastRefreshTime) > refreshInterval) {
- refreshByReload();
- lastRefreshTime = time;
- }
- }
-
- /**
- * Saves any changes to the service state if necessary.
- */
- private void save() {
- AuthorizationService merged = entityManager.merge(service);
- entityManager.flush();
- JpaMergeSupport.merge(merged, service);
+ AuthorizationService svc = refreshByReload();
+ svc.insertRuleAfter(aIndex, aRule);
+ service.set(null);