Package org.mapfish.print.servlet.job
Class Accounting.JobTracker
java.lang.Object
org.mapfish.print.servlet.job.Accounting.JobTracker
- Direct Known Subclasses:
HibernateAccounting.JobTracker
- Enclosing class:
Accounting
Do accounting for a job.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ConfigurationThe job configuration.protected final PrintJobEntryThe job description.protected final com.codahale.metrics.Timer.ContextThe timer to use in case of success. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJobTracker(PrintJobEntry entry, Configuration configuration) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidTo be called when a job is canceled.voidTo be called when a job is on error.longonJobSuccess(PrintJob.PrintResult printResult) To be called when a job is a success.
-
Field Details
-
entry
The job description. -
configuration
The job configuration. -
successTimer
protected final com.codahale.metrics.Timer.Context successTimerThe timer to use in case of success.
-
-
Constructor Details
-
JobTracker
Constructor.- Parameters:
entry- the job description.configuration- the job configuration
-
-
Method Details
-
onJobSuccess
To be called when a job is a success.- Parameters:
printResult- Output file size in bytes- Returns:
- the job duration in nanoseconds
-
onJobCancel
public void onJobCancel()To be called when a job is canceled. -
onJobError
public void onJobError()To be called when a job is on error.
-