public static class PermissionManager.Implementation extends Object implements PermissionManager
PermissionManager
default implementation that uses a shared synchronization lock.PermissionManager.Implementation
Modifier and Type | Method and Description |
---|---|
Object |
lockPermissionRegistry()
Returns the lock instance that is internally used by this registry instance.
|
Permission |
permission(Resource resource,
Integer factor)
Looks up the
Permission instance representing the passed Resource instance with the passed
factor value. |
Permission |
providePermission(Resource resource,
Integer factor)
Provides a permission for the passed
Resource instance and the passed factor. |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
New, New, New, providePermission
New, New, New, New, permission
public Permission providePermission(Resource resource, Integer factor)
Resource
instance and the passed factor.
Providing means to either return a suitable existing Permission
instance of create, register and then
return a new one.providePermission
in interface PermissionManager
providePermission
in interface PermissionProvider
resource
- the Resource
instance to be associated.factor
- the factor of the access to the passed Resource
instance.Permission
instance satisfiying the specified values.PermissionManager.providePermission(Resource)
public Permission permission(Resource resource, Integer factor)
Permission
instance representing the passed Resource
instance with the passed
factor value. If no suitable Permission
instance can be found, null is returned.permission
in interface PermissionRegistry
resource
- the Resource
instance for which the associated Permission
instance shall be
returned.factor
- the factor value of the Resource
instance for which the associated Permission
instance shall be returned.Permission
instance specified by the passed values.public final Object lockPermissionRegistry()
lockPermissionRegistry
in interface PermissionRegistry