First cut of Hazelcast cache initialisation

need to set filesystem.cluster.enabled=true
                      filesystem.cluster.config=c:\\temp\\hazelcastConfig.xml
ALF-9966 - Locking wrong with OpLockManager and LockManager ContentDiskDriver error.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29922 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2011-08-19 13:21:53 +00:00
parent 5084d3612f
commit 021a93f5c3
20 changed files with 525 additions and 214 deletions

View File

@@ -42,6 +42,8 @@ import org.alfresco.jlan.server.filesys.SrvDiskInfo;
import org.alfresco.jlan.server.filesys.TreeConnection;
import org.alfresco.jlan.server.filesys.cache.FileState;
import org.alfresco.jlan.server.filesys.cache.FileStateCache;
import org.alfresco.jlan.server.locking.FileLockingInterface;
import org.alfresco.jlan.server.locking.LockManager;
import org.alfresco.jlan.server.locking.OpLockInterface;
import org.alfresco.jlan.server.locking.OpLockManager;
import org.alfresco.jlan.smb.SMBException;
@@ -63,8 +65,18 @@ import org.springframework.extensions.config.ConfigElement;
* Decorates ContentDiskDriver with a performance cache of some frequently used
* results. In particular for getFileInformation and fileExists
*/
/*
* MER - this class is also acting as a proxy to gather together the different interfaces
* and present them to JLAN. This was not the intention and is a short term hack. It
* should be possible to un-spring the buffering, however that's not possible at the moment.
*/
public class BufferedContentDiskDriver implements ExtendedDiskInterface,
DiskInterface, DiskSizeInterface, IOCtlInterface, OpLockInterface, NodeServicePolicies.OnDeleteNodePolicy,
DiskInterface,
DiskSizeInterface,
IOCtlInterface,
OpLockInterface,
FileLockingInterface,
NodeServicePolicies.OnDeleteNodePolicy,
NodeServicePolicies.OnMoveNodePolicy
{
// Logging
@@ -78,6 +90,8 @@ public class BufferedContentDiskDriver implements ExtendedDiskInterface,
private OpLockInterface opLockInterface;
private FileLockingInterface fileLockingInterface;
private PolicyComponent policyComponent;
public void init()
@@ -86,7 +100,9 @@ public class BufferedContentDiskDriver implements ExtendedDiskInterface,
PropertyCheck.mandatory(this, "diskSizeInterface", diskSizeInterface);
PropertyCheck.mandatory(this, "ioctltInterface", ioctlInterface);
PropertyCheck.mandatory(this, "fileInfoCache", fileInfoCache);
PropertyCheck.mandatory(this, "fileLockingInterface", getFileLockingInterface());
PropertyCheck.mandatory(this, "opLockInterface", getOpLockInterface());
PropertyCheck.mandatory(this, "fileLockingInterface", fileLockingInterface);
PropertyCheck.mandatory(this, "policyComponent", getPolicyComponent());
getPolicyComponent().bindClassBehaviour( NodeServicePolicies.OnDeleteNodePolicy.QNAME,
@@ -95,8 +111,6 @@ public class BufferedContentDiskDriver implements ExtendedDiskInterface,
this, new JavaBehaviour(this, "onMoveNode"));
}
/**
* FileInfo Cache for path to FileInfo
*/
@@ -477,10 +491,10 @@ public class BufferedContentDiskDriver implements ExtendedDiskInterface,
}
@Override
public void registerContext(DeviceContext ctx, ServerConfigurationBean scb)
public void registerContext(DeviceContext ctx)
throws DeviceContextException
{
diskInterface.registerContext(ctx, scb);
diskInterface.registerContext(ctx);
}
public void setDiskInterface(ExtendedDiskInterface diskInterface)
@@ -565,5 +579,23 @@ public class BufferedContentDiskDriver implements ExtendedDiskInterface,
{
return opLockInterface.isOpLocksEnabled(sess, tree);
}
@Override
public LockManager getLockManager(SrvSession sess, TreeConnection tree)
{
return getFileLockingInterface().getLockManager(sess, tree);
}
public void setFileLockingInterface(FileLockingInterface fileLockingInterface)
{
this.fileLockingInterface = fileLockingInterface;
}
public FileLockingInterface getFileLockingInterface()
{
return fileLockingInterface;
}
}