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 Configuration
The job configuration.protected final PrintJobEntry
The job description.protected final com.codahale.metrics.Timer.Context
The timer to use in case of success. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
JobTracker
(PrintJobEntry entry, Configuration configuration) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
To be called when a job is canceled.void
To be called when a job is on error.long
onJobSuccess
(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.
-