mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Lookup caching is working. It's fairly heavy handed in its invalidation
strategy, but seems to give a 10-20% performance boost. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@4426 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -28,6 +28,11 @@ import java.util.List;
|
||||
*/
|
||||
class Lookup
|
||||
{
|
||||
/**
|
||||
* Is this lookup valid?
|
||||
*/
|
||||
private boolean fValid;
|
||||
|
||||
/**
|
||||
* The AVMStore.
|
||||
*/
|
||||
@@ -86,13 +91,24 @@ class Lookup
|
||||
|
||||
public Lookup(Lookup other, AVMNodeDAO nodeDAO, AVMStoreDAO storeDAO)
|
||||
{
|
||||
fValid = true;
|
||||
fAVMStore = storeDAO.getByName(other.fAVMStore.getName());
|
||||
if (fAVMStore == null)
|
||||
{
|
||||
fValid = false;
|
||||
return;
|
||||
}
|
||||
fStoreName = fAVMStore.getName();
|
||||
fComponents = new ArrayList<LookupComponent>();
|
||||
fLayeredYet = other.fLayeredYet;
|
||||
if (other.fTopLayer != null)
|
||||
{
|
||||
fTopLayer = (LayeredDirectoryNode)nodeDAO.getByID(other.fTopLayer.getId());
|
||||
if (fTopLayer == null)
|
||||
{
|
||||
fValid = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
fPosition = other.fPosition;
|
||||
fTopLayerIndex = other.fTopLayerIndex;
|
||||
@@ -105,8 +121,18 @@ class Lookup
|
||||
newComp.setName(comp.getName());
|
||||
newComp.setIndirection(comp.getIndirection());
|
||||
newComp.setNode(nodeDAO.getByID(comp.getNode().getId()));
|
||||
if (newComp.getNode() == null)
|
||||
{
|
||||
fValid = false;
|
||||
return;
|
||||
}
|
||||
fComponents.add(newComp);
|
||||
}
|
||||
fFinalStore = storeDAO.getByName(other.fFinalStore.getName());
|
||||
if (fFinalStore == null)
|
||||
{
|
||||
fValid = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,6 +142,7 @@ class Lookup
|
||||
*/
|
||||
public Lookup(AVMStore store, String storeName)
|
||||
{
|
||||
fValid = true;
|
||||
fAVMStore = store;
|
||||
fStoreName = storeName;
|
||||
fComponents = new ArrayList<LookupComponent>();
|
||||
@@ -129,6 +156,14 @@ class Lookup
|
||||
fFinalStore = store;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this a valid lookup?
|
||||
*/
|
||||
public boolean isValid()
|
||||
{
|
||||
return fValid;
|
||||
}
|
||||
|
||||
// TODO This is badly in need of cleanup.
|
||||
/**
|
||||
* Add a new node to the lookup.
|
||||
|
Reference in New Issue
Block a user