* Authorization service with persistent storage.
* This is a wrapper for {@link org.wamblee.security.authorization.DefaultAuthorizationService}
* which refreshes the state of the service at certain time intervals.
* Authorization service with persistent storage.
* This is a wrapper for {@link org.wamblee.security.authorization.DefaultAuthorizationService}
* which refreshes the state of the service at certain time intervals.
*/
public class PersistentAuthorizationService extends AbstractPersistent
implements AuthorizationService {
*/
public class PersistentAuthorizationService extends AbstractPersistent
implements AuthorizationService {
public PersistentAuthorizationService(String aName,
HibernateTemplate aTemplate, UserAccessor aAccessor,
long aRefreshInterval) {
public PersistentAuthorizationService(String aName,
HibernateTemplate aTemplate, UserAccessor aAccessor,
long aRefreshInterval) {
- _template = aTemplate;
- _refreshInterval = aRefreshInterval;
- _lastRefreshTime = System.currentTimeMillis();
- _userAccessor = aAccessor;
- _name = aName;
+ template = aTemplate;
+ refreshInterval = aRefreshInterval;
+ lastRefreshTime = System.currentTimeMillis();
+ userAccessor = aAccessor;
+ name = aName;
- _service = new DefaultAuthorizationService(_userAccessor, _name);
- _template.persist(_service);
+ service = new DefaultAuthorizationService(userAccessor, name);
+ template.persist(service);
- if ( time - _lastRefreshTime > _refreshInterval ) {
- _template.refresh(_service);
- _lastRefreshTime = time;
+ if ( time - lastRefreshTime > refreshInterval ) {
+ template.refresh(service);
+ lastRefreshTime = time;