Made string constant RECIPIENT_FOR_CACHE_EMPTY final.

This commit is contained in:
Luke Taylor 2007-02-22 23:57:49 +00:00
parent b8a0f97fde
commit a1886bd1e0

View File

@ -36,18 +36,24 @@ import java.util.Map;
/** /**
* <P>Retrieves access control lists (ACL) entries for domain object instances from a data access object (DAO).</p> * Retrieves access control lists (ACL) entries for domain object instances from a data access object (DAO).
* <P>This implementation will provide ACL lookup services for any object that it can determine the {@link * <p>
* This implementation will provide ACL lookup services for any object that it can determine the {@link
* AclObjectIdentity} for by calling the {@link #obtainIdentity(Object)} method. Subclasses can override this method * AclObjectIdentity} for by calling the {@link #obtainIdentity(Object)} method. Subclasses can override this method
* if they only want the <code>BasicAclProvider</code> responding to particular domain object instances.</p> * if they only want the <code>BasicAclProvider</code> responding to particular domain object instances.
* <P><code>BasicAclProvider</code> will walk an inheritance hierarchy if a <code>BasicAclEntry</code> returned by * </p>
* the DAO indicates it has a parent. NB: inheritance occurs at a <I>domain instance object</I> level. It does not * <p>
* occur at an ACL recipient level. This means <B>all</B><code>BasicAclEntry</code>s for a given domain instance * <code>BasicAclProvider</code> will walk an inheritance hierarchy if a <code>BasicAclEntry</code> returned by
* object <B>must</B> have the <B>same</B> parent identity, or <B>all</B><code>BasicAclEntry</code>s must have * the DAO indicates it has a parent. NB: inheritance occurs at a <i>domain instance object</i> level. It does not
* <code>null</code> as their parent identity.</p> * occur at an ACL recipient level. This means <b>all</b><code>BasicAclEntry</code>s for a given domain instance
* <P>A cache should be used. This is provided by the {@link BasicAclEntryCache}. <code>BasicAclProvider</code> by * object <b>must</b> have the <b>same</b> parent identity, or <b>all</b><code>BasicAclEntry</code>s must have
* default is setup to use the {@link NullAclEntryCache}, which performs no caching.</p> * <code>null</code> as their parent identity.
* <P>To implement the {@link #getAcls(Object, Authentication)} method, <code>BasicAclProvider</code> requires a * </p>
* <p>
* A cache should be used. This is provided by the {@link BasicAclEntryCache}. <code>BasicAclProvider</code> by
* default is setup to use the {@link NullAclEntryCache}, which performs no caching.
* </p>
* <p>To implement the {@link #getAcls(Object, Authentication)} method, <code>BasicAclProvider</code> requires a
* {@link EffectiveAclsResolver} to be configured against it. By default the {@link * {@link EffectiveAclsResolver} to be configured against it. By default the {@link
* GrantedAuthorityEffectiveAclsResolver} is used.</p> * GrantedAuthorityEffectiveAclsResolver} is used.</p>
* *
@ -60,7 +66,7 @@ public class BasicAclProvider implements AclProvider, InitializingBean {
private static final Log logger = LogFactory.getLog(BasicAclProvider.class); private static final Log logger = LogFactory.getLog(BasicAclProvider.class);
/** Marker added to the cache to indicate an AclObjectIdentity has no corresponding BasicAclEntry[]s */ /** Marker added to the cache to indicate an AclObjectIdentity has no corresponding BasicAclEntry[]s */
private static String RECIPIENT_FOR_CACHE_EMPTY = "RESERVED_RECIPIENT_NOBODY"; private static final String RECIPIENT_FOR_CACHE_EMPTY = "RESERVED_RECIPIENT_NOBODY";
//~ Instance fields ================================================================================================ //~ Instance fields ================================================================================================
@ -237,7 +243,8 @@ public class BasicAclProvider implements AclProvider, InitializingBean {
Constructor constructor = defaultAclObjectIdentityClass.getConstructor(new Class[] {Object.class}); Constructor constructor = defaultAclObjectIdentityClass.getConstructor(new Class[] {Object.class});
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
logger.debug("domainInstance: " + domainInstance + " attempting to pass to constructor: " + constructor); logger.debug("domainInstance: " + domainInstance
+ " attempting to pass to constructor: " + constructor);
} }
return (AclObjectIdentity) constructor.newInstance(new Object[] {domainInstance}); return (AclObjectIdentity) constructor.newInstance(new Object[] {domainInstance});