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
public class Accounting.JobTracker extends java.lang.Object
Do accounting for a job.
-
-
Field Summary
Fields Modifier and Type Field Description protected Configuration
configuration
The job configuration.protected PrintJobEntry
entry
The job description.protected com.codahale.metrics.Timer.Context
successTimer
The timer to use in case of success.
-
Constructor Summary
Constructors Modifier Constructor Description protected
JobTracker(PrintJobEntry entry, Configuration configuration)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onJobCancel()
To be called when a job is canceled.void
onJobError()
To be called when a job is on error.long
onJobSuccess(PrintJob.PrintResult printResult)
To be called when a job is a success.
-
-
-
Field Detail
-
entry
protected final PrintJobEntry entry
The job description.
-
configuration
protected final Configuration configuration
The job configuration.
-
successTimer
protected final com.codahale.metrics.Timer.Context successTimer
The timer to use in case of success.
-
-
Constructor Detail
-
JobTracker
protected JobTracker(PrintJobEntry entry, Configuration configuration)
Constructor.- Parameters:
entry
- the job description.configuration
- the job configuration
-
-
Method Detail
-
onJobSuccess
public long onJobSuccess(PrintJob.PrintResult printResult)
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.
-
-