use of org.alfresco.jlan.smb.SMBException in project alfresco-repository by Alfresco.
the class FilesystemTransactionAdvice method invoke.
public Object invoke(final MethodInvocation methodInvocation) throws IOException, SMBException, Throwable {
RetryingTransactionHelper tran = transactionService.getRetryingTransactionHelper();
RetryingTransactionCallback<Object> callback = new RetryingTransactionHelper.RetryingTransactionCallback<Object>() {
public Object execute() throws Throwable {
try {
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);
}
}
};
try {
return tran.doInTransaction(callback, readOnly);
} catch (PropagatingException pe) {
Throwable t = pe.getCause();
if (t != null) {
if (t instanceof IOException) {
throw (IOException) t;
}
if (t instanceof IOControlNotImplementedException) {
throw (IOControlNotImplementedException) t;
}
if (t instanceof SMBException) {
throw (SMBException) t;
}
if (t instanceof DeviceContextException) {
throw t;
}
throw t;
}
throw pe;
}
}
Aggregations