-
1. Re: Seam & Rich Faces Progress bar
notify Apr 26, 2012 6:04 PM (in response to notify)I fixed this by;
Annotating the "long process" with the Seam @Asynchronous (org.jboss.seam.annotations.async.Asynchronous) and all the methods that the method calls and removing the "@Begin(join = true)".
EJB 1.
@Asynchronous
public final void sendToDevice() {
......
convertPDFLocal.extractPageContentImages( ..... ) // Call to method in EJB 2
}
EJB 2
@Asynchronous
public void extractPageContentImages(final String fileName) throws IOException {
double percentage = (dCount / dNumberPages) * ONE_HUNDRED;
progressBarBean.setPercentageComplete((new Double(percentage)).longValue());
}
The ProgressBean is injected into each EJB so;
@In(create = true)
private ProgressBarBean progressBarBean;
The ProgressBarBean;
@Name("progressBarBean")
@Scope(ScopeType.SESSION)
public class ProgressBarBean implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@Logger
private Log log;
private boolean buttonRendered = true;
private boolean enabled = true;
private Long percentageComplete = new Long(-1);
public ProgressBarBean() {
}
public Long getPercentageComplete() {
......
}
public void setPercentageComplete(Long percentageComplete) {
this.percentageComplete = percentageComplete;
}
}