mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Filesystem changes.
a) Fixed bug if IOControlHandler threw IOControlNotImplementedException b) Cluster cache initialisation for all filesystem contexts. c) Don't attempt to start the filesystem if the cluster config fails. d) addition of new property for cluster debug (filesystem.cluster.debugFlags) e) Changed the property name from filesystem.cluster.config to filesystem.cluster.configFile git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29946 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -20,8 +20,9 @@ package org.alfresco.filesys.repo;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.jlan.server.SrvSession;
|
||||
import org.alfresco.jlan.server.core.DeviceContextException;
|
||||
import org.alfresco.jlan.server.filesys.IOControlNotImplementedException;
|
||||
import org.alfresco.jlan.smb.SMBException;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
@@ -29,7 +30,16 @@ import org.aopalliance.intercept.MethodInterceptor;
|
||||
import org.aopalliance.intercept.MethodInvocation;
|
||||
|
||||
/**
|
||||
* An advice wrapper for an AlfrescoDiskDriver.
|
||||
* An advice wrapper for an AlfrescoDiskDriver. Wraps the method call with a
|
||||
* RetryingTransactionHandler.
|
||||
* <p>
|
||||
* Needs to let the checked exceptions that are specified on the JLAN interfaces through.
|
||||
* In particular must avoid wrapping JLAN's checked exceptions with an AlfrescoRuntimeException
|
||||
* (so must throw IOException etc)
|
||||
* <p>
|
||||
* @See DiskInterface
|
||||
* @See IOControlHandler
|
||||
*
|
||||
*/
|
||||
public class FilesystemTransactionAdvice implements MethodInterceptor
|
||||
{
|
||||
@@ -68,11 +78,23 @@ public class FilesystemTransactionAdvice implements MethodInterceptor
|
||||
{
|
||||
return methodInvocation.proceed();
|
||||
}
|
||||
catch (SMBException e)
|
||||
{
|
||||
throw new PropagatingException(e);
|
||||
}
|
||||
catch (IOControlNotImplementedException e)
|
||||
{
|
||||
throw new PropagatingException(e);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
// Ensure original checked IOExceptions get propagated
|
||||
throw new PropagatingException(e);
|
||||
}
|
||||
catch (DeviceContextException e)
|
||||
{
|
||||
throw new PropagatingException(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -85,8 +107,17 @@ public class FilesystemTransactionAdvice implements MethodInterceptor
|
||||
}
|
||||
catch(PropagatingException pe)
|
||||
{
|
||||
// Unwrap checked exceptions
|
||||
throw (IOException) pe.getCause();
|
||||
Throwable t = pe.getCause();
|
||||
if(t != null)
|
||||
{
|
||||
if(t instanceof IOException)
|
||||
{
|
||||
// Unwrap checked exceptions
|
||||
throw (IOException) pe.getCause();
|
||||
}
|
||||
throw t;
|
||||
}
|
||||
throw pe;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -105,16 +136,6 @@ public class FilesystemTransactionAdvice implements MethodInterceptor
|
||||
}
|
||||
}
|
||||
|
||||
// public void setDriver(AlfrescoDiskDriver driver)
|
||||
// {
|
||||
// this.driver = driver;
|
||||
// }
|
||||
//
|
||||
// public AlfrescoDiskDriver getDriver()
|
||||
// {
|
||||
// return driver;
|
||||
// }
|
||||
|
||||
public void setTransactionService(TransactionService transactionService)
|
||||
{
|
||||
this.transactionService = transactionService;
|
||||
|
Reference in New Issue
Block a user