Replication/Transfer tidy up:

- TransferFailureException: TransferEndEvent getEndEvent() -> TransferEventError getErrorEvent()
- Client cancel only processed on first request from client

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22406 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2010-09-10 15:47:42 +00:00
parent b1350014c8
commit fc0821820a
2 changed files with 8 additions and 6 deletions

View File

@@ -728,9 +728,8 @@ public class TransferServiceImpl2 implements TransferService2
logger.debug("TransferException - unable to transfer", failureException);
TransferEventError errorEvent = new TransferEventError();
errorEvent.setTransferState(TransferEvent.TransferState.ERROR);
TransferFailureException endException = new TransferFailureException(errorEvent);
errorEvent.setMessage(endException.getMessage());
errorEvent.setException(endException);
errorEvent.setException(failureException);
errorEvent.setMessage(failureException.getMessage());
endEventImpl = errorEvent;
}
else if (cancelled)
@@ -832,7 +831,7 @@ public class TransferServiceImpl2 implements TransferService2
if (endEvent instanceof TransferEventError)
{
TransferEventError endError = (TransferEventError)endEvent;
throw (TransferFailureException)endError.getException();
throw new TransferFailureException(endError);
}
return endEvent;
}
@@ -1044,8 +1043,9 @@ public class TransferServiceImpl2 implements TransferService2
TransferStatus status = transferMonitoring.get(transferHandle);
if(status != null)
{
if(status.cancelMe)
if(!status.cancelInProgress && status.cancelMe)
{
status.cancelInProgress = true;
throw new TransferCancelledException();
}
}
@@ -1394,6 +1394,7 @@ public class TransferServiceImpl2 implements TransferService2
private class TransferStatus
{
boolean cancelMe = false;
boolean cancelInProgress = false;
}