use of org.talend.dataprep.async.result.ResultUrlGenerator in project data-prep by Talend.
the class AsyncAspect method getResultUrl.
/**
* Return the URL used to get the result of the asynchronous method
* @param pjp pjp the proceeding join point.
* @return the URL used to get the result of the asynchronous method
*/
private AsyncExecutionResult getResultUrl(ProceedingJoinPoint pjp) {
MethodSignature ms = (MethodSignature) pjp.getSignature();
Method m = ms.getMethod();
final AsyncOperation asyncOperationAnnotation = m.getAnnotation(AsyncOperation.class);
Class<? extends ResultUrlGenerator> resultUrlClass = asyncOperationAnnotation.resultUrlGenerator();
final ResultUrlGenerator resultUrlGenerator = applicationContext.getBean(resultUrlClass);
Object[] args = AnnotationUtils.extractAsyncParameter(pjp);
return resultUrlGenerator.generateResultUrl(args);
}
Aggregations