mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Build fix - missing dependancy for previous build fix from DM ACL merge performance teaks
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@9058 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -24,6 +24,10 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.repo.security.permissions.impl;
|
package org.alfresco.repo.security.permissions.impl;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.concurrent.locks.ReadWriteLock;
|
||||||
|
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||||
|
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,6 +42,54 @@ public final class SimplePermissionReference extends AbstractPermissionReference
|
|||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = 637302438293417818L;
|
private static final long serialVersionUID = 637302438293417818L;
|
||||||
|
|
||||||
|
private static ReadWriteLock lock = new ReentrantReadWriteLock();
|
||||||
|
|
||||||
|
private static HashMap<QName, HashMap<String, SimplePermissionReference>> instances = new HashMap<QName, HashMap<String, SimplePermissionReference>>();
|
||||||
|
|
||||||
|
public static SimplePermissionReference getPermissionReference(QName qName, String name)
|
||||||
|
{
|
||||||
|
lock.readLock().lock();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
HashMap<String, SimplePermissionReference> typed = instances.get(qName);
|
||||||
|
if(typed != null)
|
||||||
|
{
|
||||||
|
SimplePermissionReference instance = typed.get(name);
|
||||||
|
if(instance != null)
|
||||||
|
{
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
lock.readLock().unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
lock.writeLock().lock();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
HashMap<String, SimplePermissionReference> typed = instances.get(qName);
|
||||||
|
if(typed == null)
|
||||||
|
{
|
||||||
|
typed = new HashMap<String, SimplePermissionReference>();
|
||||||
|
instances.put(qName, typed);
|
||||||
|
}
|
||||||
|
SimplePermissionReference instance = typed.get(name);
|
||||||
|
if(instance == null)
|
||||||
|
{
|
||||||
|
instance = new SimplePermissionReference(qName, name);
|
||||||
|
typed.put(name, instance);
|
||||||
|
}
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
lock.writeLock().unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The type
|
* The type
|
||||||
*/
|
*/
|
||||||
@@ -49,7 +101,7 @@ public final class SimplePermissionReference extends AbstractPermissionReference
|
|||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
|
||||||
public SimplePermissionReference(QName qName, String name)
|
protected SimplePermissionReference(QName qName, String name)
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
this.qName = qName;
|
this.qName = qName;
|
||||||
|
Reference in New Issue
Block a user