Code example for ThreadPoolExecutor

0
 
class Gpx10FileLogger implements IFileLogger 
{ 
    protected final static Object lock = new Object();
 
    private final static ThreadPoolExecutor EXECUTOR = new ThreadPoolExecutor(1, 1, 60, TimeUnit.SECONDS,
            new LinkedBlockingQueue<Runnable>(128), new RejectionHandler());
    private File gpxFile = null;
    private final boolean addNewTrackSegment;
    private final int satelliteCount;
    protected final String name = "GPX";
 
    Gpx10FileLogger(File gpxFile, boolean addNewTrackSegment, int satelliteCount)
    { 
        this.gpxFile = gpxFile;
        this.addNewTrackSegment = addNewTrackSegment;
        this.satelliteCount = satelliteCount;
    } 
 
 
    public void Write(Location loc) throws Exception