package org.alfresco.filesys.repo; import java.io.IOException; 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; import org.aopalliance.intercept.MethodInterceptor; import org.aopalliance.intercept.MethodInvocation; /** * An advice wrapper for an AlfrescoDiskDriver. Wraps the method call with a * RetryingTransactionHandler. *
* 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) *
* @see org.alfresco.jlan.server.filesys.DiskInterface * @see org.alfresco.filesys.alfresco.IOControlHandler * */ public class FilesystemTransactionAdvice implements MethodInterceptor { private boolean readOnly; private TransactionService transactionService; public FilesystemTransactionAdvice() { readOnly = false; } public void setReadOnly(boolean readOnly) { this.readOnly = readOnly; } public Object invoke(final MethodInvocation methodInvocation) throws IOException, SMBException, Throwable { RetryingTransactionHelper tran = transactionService.getRetryingTransactionHelper(); RetryingTransactionCallback