com.atlassian.scheduler.core.status
Class UnusableJobDetails

java.lang.Object
  extended by com.atlassian.scheduler.core.status.AbstractJobDetails
      extended by com.atlassian.scheduler.core.status.UnusableJobDetails
All Implemented Interfaces:
JobDetails

public class UnusableJobDetails
extends AbstractJobDetails

Concrete implementation of JobDetails that always throws an exception when the parameters are accessed. This can be used when the JobRunner is unavailable or an exception occurs while trying to deserialize the parameters.

Since:
v1.0

Field Summary
 
Fields inherited from class com.atlassian.scheduler.core.status.AbstractJobDetails
jobId, jobRunnerKey, runMode, schedule
 
Constructor Summary
UnusableJobDetails(JobId jobId, JobRunnerKey jobRunnerKey, RunMode runMode, Schedule schedule, Date nextRunTime, byte[] parameters, Throwable cause)
           
 
Method Summary
protected  void appendToStringDetails(StringBuilder sb)
           
 Map<String,Serializable> getParameters()
          The parameters are not available because the map could not be reconstructed.
 boolean isRunnable()
          Returns true if this job could be successfully run at this time.
 
Methods inherited from class com.atlassian.scheduler.core.status.AbstractJobDetails
getJobId, getJobRunnerKey, getNextRunTime, getRawParameters, getRunMode, getSchedule, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnusableJobDetails

public UnusableJobDetails(JobId jobId,
                          JobRunnerKey jobRunnerKey,
                          RunMode runMode,
                          Schedule schedule,
                          Date nextRunTime,
                          byte[] parameters,
                          Throwable cause)
Parameters:
cause - the reason the parameters are unavailable. If left null, then it is assumed that the JobRunner is not available.
Method Detail

getParameters

@Nonnull
public Map<String,Serializable> getParameters()
The parameters are not available because the map could not be reconstructed.

Returns:
never returns normally
Throws:
SchedulerRuntimeException - Unconditionally. The exception's cause will be either a JobRunnerNotRegisteredException or the error that occurred during deserialization.

isRunnable

public boolean isRunnable()
Description copied from interface: JobDetails
Returns true if this job could be successfully run at this time. This requires it to have a registered JobRunner whose class loader can successfully reconstruct the job's parameter map.

Returns:
true if this job is currently runnable; false otherwise

appendToStringDetails

protected void appendToStringDetails(StringBuilder sb)
Specified by:
appendToStringDetails in class AbstractJobDetails


Copyright © 2014 Atlassian. All Rights Reserved.