public class ParameterMapSerializer extends Object
byte[] and restoring it to its
original form.| Constructor and Description |
|---|
ParameterMapSerializer() |
| Modifier and Type | Method and Description |
|---|---|
protected ObjectInputStream |
createObjectInputStream(ClassLoader classLoader,
byte[] parameters) |
Map<String,Serializable> |
deserializeParameters(ClassLoader classLoader,
byte[] parameters)
Deserializes the parameters map from a byte array using the provided
ClassLoader. |
byte[] |
serializeParameters(Map<String,Serializable> parameters)
Serializes the parameters to a byte array.
|
@Nullable public byte[] serializeParameters(@Nullable Map<String,Serializable> parameters) throws SchedulerServiceException
SchedulerService
implementations use this serialization to make it possible to
AbstractJobDetailsFactory.buildJobDetails(JobId, Object, RunMode) reconstruct}
the JobDetails even when the JobRunner for it has not been registered.
Otherwise, it will be difficult to recover any information about the job at all.parameters - the parameters map to serialize; may be null as shorthand for an empty mapnull if parameters was either null or emptySchedulerServiceException - if the parameters map cannot be serialized, presumably
because it contains an object that cannot be serialized@Nonnull public Map<String,Serializable> deserializeParameters(ClassLoader classLoader, @Nullable byte[] parameters) throws ClassNotFoundException, IOException
ClassLoader.classLoader - the class loader to use for resolving classesparameters - the parameters to be deserialized; may be null, which results in an
empty mapClassNotFoundException - if ClassLoaderAwareObjectInputStream doesIOException - if ClassLoaderAwareObjectInputStream doesprotected ObjectInputStream createObjectInputStream(ClassLoader classLoader, byte[] parameters) throws IOException
IOExceptionCopyright © 2017 Atlassian. All rights reserved.