Java Reference
In-Depth Information
Once the configuration is complete, you can create a report task class, which is a class that implements Runnable
and is responsible for running the actual reports. The following class, org.javaee7.chapter11.ReporterTask , is an
example of such as class.
package org.javaee7.chapter11;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import javax.ejb.EJB;
import org.javaee7.entity.Jobs;
import org.javaee7.entity.Product;
import org.javaee7.jpa.session.JobsSession;
import org.javaee7.jpa.session.ProductSession;
* @author Juneau
public class ReporterTask implements Runnable {
String reportName;
private JobsSession jobsFacade;
private ProductSession productFacade;
public ReporterTask(String reportName) {
this.reportName = reportName;
public void run() {
// Run the named report
if ("JobsReport".equals(reportName)) {
} else if ("ProductReport".equals(reportName)) {
Search WWH ::

Custom Search