public CloneMediatorSerializationTest() { super(CloneMediatorSerializationTest.class.getName()); cloneMediatorFactory = new CloneMediatorFactory(); cloneMediatorSerializer = new CloneMediatorSerializer(); }
/** * This method will implement the serializeMediator method of the MediatorSerializer interface * and implements the serialization of CloneMediator to its configuration * * @param m Mediator of the type CloneMediator which is subjected to the serialization * @return OMElement serialized in to xml from the given parameters */ public OMElement serializeSpecificMediator(Mediator m) { OMElement cloneElem = fac.createOMElement("clone", synNS); saveTracingState(cloneElem, m); CloneMediator clone = (CloneMediator) m; if (clone.isContinueParent()) { cloneElem.addAttribute("continueParent", Boolean.toString(true), nullNS); } if (clone.getId() != null) { cloneElem.addAttribute("id", clone.getId(), nullNS); } if (clone.isSequential()) { cloneElem.addAttribute("sequential", "true", nullNS); } for (Target o : clone.getTargets()) { cloneElem.addChild(TargetSerializer.serializeTarget(o)); } return cloneElem; }
/** * This method will implement the serializeMediator method of the MediatorSerializer interface * and implements the serialization of CloneMediator to its configuration * * @param m Mediator of the type CloneMediator which is subjected to the serialization * @return OMElement serialized in to xml from the given parameters */ public OMElement serializeSpecificMediator(Mediator m) { OMElement cloneElem = fac.createOMElement("clone", synNS); saveTracingState(cloneElem, m); CloneMediator clone = (CloneMediator) m; if (clone.isContinueParent()) { cloneElem.addAttribute("continueParent", Boolean.toString(true), nullNS); } if (clone.getId() != null) { cloneElem.addAttribute("id", clone.getId(), nullNS); } if (clone.isSequential()) { cloneElem.addAttribute("sequential", "true", nullNS); } for (Object o : clone.getTargets()) { if (o instanceof Target) { cloneElem.addChild(TargetSerializer.serializeTarget((Target) o)); } } return cloneElem; }