public class SimpleQuartzSerializer implements StartupSerializer {
public OMElement serializeStartup(OMElement parent, Startup s) {
if (!(s instanceof SimpleQuartz)) {
throw new SynapseException("called TaskSerializer on some other " +
"kind of startup" + s.getClass().getName());
}
SimpleQuartz sq = (SimpleQuartz) s;
TaskDescription taskDescription = sq.getTaskDescription();
if (taskDescription != null) {
OMElement task = TaskDescriptionSerializer.serializeTaskDescription(
SynapseConstants.SYNAPSE_OMNAMESPACE, taskDescription);
if (task == null) {
throw new SynapseException("Task Element can not be null.");
}
if (parent != null) {
parent.addChild(task);
}
return task;
} else {
throw new SynapseException("Task Description is null");
}
}