zanata/zanata-server — pull request #606 by carlosmunoz (2014-10-13 23:36:42+00:00)
Title: Async framework refactoring

This is the new async framework which lays the ground for the CDI version.
The previous version required the explicit use of `AsyncTask` to trigger these actions.
This new version simply requires that asynchrounous methods be marked with the `@Async` annotation and components holding these methods with `@ContainsAsyncMethods` (this part won't be necessary in CDI).
For example:
```java
public void asyncMethod(final String arg) {
asyncTaskManager.startTask( new AsyncTask() {
// Get the injected task handle
AsyncTaskHandle handle = AsyncUtils.getOutjectedHandle();
// Do some work
} );
}
```
would now become:
```java
@ContainsAsyncMethods
public class MyComponent {
...
@Async
public Future asyncMethod(String arg, AsyncTaskHandle handle) {
// Do some Work
}
...
}
```

Handles should now be passed to the method in question, and there is a new `AsyncTaskHandleManager` which can keep them all in a shared place for later retrieval.

Quartz has now been deprecated as the default async Thread manager, and the implementation may be changed without affecting the rest of the code.

Testing notes:
Every asynchronous task should be tested to verify this change. This includes (there may be others I missed):
- Downloading a zip file (from both JSF and GWT)
- Copy Trans
- Copy version
- Client Source and Translated doc push
- Translation Memory clear
- Index rebuilding