Package org.mapfish.print.servlet.registry

Examples of org.mapfish.print.servlet.registry.Registry


                    ThreadPoolJobManager.this.executor.purge();
                }

                if (printJob.getReportFuture().isDone()) {
                    submittedJobs.remove();
                    final Registry registryRef = ThreadPoolJobManager.this.registry;
                    try {
                        printJob.getReportFuture().get().store(registryRef, this.assertionPersister);
                        registryRef.incrementInt(NB_PRINT_DONE, 1);
                        registryRef.incrementLong(TOTAL_PRINT_TIME, printJob.getTimeSinceStart());
                    } catch (InterruptedException e) {
                        // if this happens, the timer task was interrupted. restore the interrupted
                        // status to not lose the information.
                        Thread.currentThread().interrupt();
                    } catch (ExecutionException e) {
                        // TODO check if in this case the job remains in the registry with status pending!
                        registryRef.incrementInt(LAST_PRINT_COUNT, 1);
                    } catch (JSONException e) {
                        registryRef.incrementInt(LAST_PRINT_COUNT, 1);
                    } catch (CancellationException e) {
                        try {
                            final FailedPrintJob failedJob = new FailedPrintJob(
                                    printJob.getReportRef(), printJob.getAppId(), new Date(), "", "task canceled (timeout)",
                                    printJob.getAccessAssertion());
                            failedJob.store(registryRef, this.assertionPersister);
                            registryRef.incrementInt(NB_PRINT_DONE, 1);
                            registryRef.incrementLong(TOTAL_PRINT_TIME, printJob.getTimeSinceStart());
                        } catch (JSONException e1) {
                            registryRef.incrementInt(LAST_PRINT_COUNT, 1);
                        }
                    }
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.mapfish.print.servlet.registry.Registry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.