Package org.apache.synapse.mediators.builtin

Examples of org.apache.synapse.mediators.builtin.EnqueueMediator


    protected OMElement serializeSpecificMediator(Mediator m) {
        assert m instanceof EnqueueMediator :
                "Unsupported mediator passed in for serialization : " + m.getType();

        EnqueueMediator mediator = (EnqueueMediator) m;
        OMElement enqueue = fac.createOMElement("enqueue", synNS);
        saveTracingState(enqueue, mediator);

        if (mediator.getExecutorName() != null) {
            enqueue.addAttribute(fac.createOMAttribute(
                    "executor", nullNS, mediator.getExecutorName()));
        } else {
            handleException("Invalid enqueue mediator. queue is required");
        }

        if (mediator.getSequenceName() != null) {
            enqueue.addAttribute(fac.createOMAttribute(
                    "sequence", nullNS, mediator.getSequenceName()));
        else {
            handleException("Invalid enqueue mediator. sequence is required");
        }

        enqueue.addAttribute(fac.createOMAttribute(
                "priority", nullNS, mediator.getPriority() + ""));

        return enqueue;
    }
View Full Code Here


    public static final QName SEQUENCE_ATT = new QName("sequence");
    public static final QName PRIORITY_ATT = new QName("priority");
    public static final QName QUEUE_ATT = new QName("executor");

    protected Mediator createSpecificMediator(OMElement elem, Properties properties) {
        EnqueueMediator mediator = new EnqueueMediator();

        OMAttribute seqAtt = elem.getAttribute(SEQUENCE_ATT);
        if (seqAtt != null && !"".equals(seqAtt.getAttributeValue())) {
            mediator.setSequenceName(seqAtt.getAttributeValue());
        } else {
            handleException("sequence is a required attribue");
        }

        OMAttribute priorityAtt = elem.getAttribute(PRIORITY_ATT);
        if (priorityAtt != null && !"".equals(priorityAtt.getAttributeValue())) {
            mediator.setPriority(Integer.parseInt(priorityAtt.getAttributeValue()));
        }

        OMAttribute queueAtt = elem.getAttribute(QUEUE_ATT);
        if (queueAtt != null && !"".equals(queueAtt.getAttributeValue())) {
            mediator.setExecutorName(queueAtt.getAttributeValue());
        } else {
            handleException("Queue is a required attribue");
        }

        return mediator;
View Full Code Here

    public OMElement serializeSpecificMediator(Mediator m) {
        assert m instanceof EnqueueMediator :
                "Unsupported mediator passed in for serialization : " + m.getType();

        EnqueueMediator mediator = (EnqueueMediator) m;
        OMElement enqueue = fac.createOMElement("enqueue", synNS);
        saveTracingState(enqueue, mediator);

        if (mediator.getExecutorName() != null) {
            enqueue.addAttribute(fac.createOMAttribute(
                    "executor", nullNS, mediator.getExecutorName()));
        } else {
            handleException("Invalid enqueue mediator. queue is required");
        }

        if (mediator.getSequenceName() != null) {
            enqueue.addAttribute(fac.createOMAttribute(
                    "sequence", nullNS, mediator.getSequenceName()));
        else {
            handleException("Invalid enqueue mediator. sequence is required");
        }

        enqueue.addAttribute(fac.createOMAttribute(
                "priority", nullNS, mediator.getPriority() + ""));

        return enqueue;
    }
View Full Code Here

    public static final QName SEQUENCE_ATT = new QName("sequence");
    public static final QName PRIORITY_ATT = new QName("priority");
    public static final QName QUEUE_ATT = new QName("executor");

    public Mediator createSpecificMediator(OMElement elem, Properties properties) {
        EnqueueMediator mediator = new EnqueueMediator();

        OMAttribute seqAtt = elem.getAttribute(SEQUENCE_ATT);
        if (seqAtt != null && !"".equals(seqAtt.getAttributeValue())) {
            mediator.setSequenceName(seqAtt.getAttributeValue());
        } else {
            handleException("sequence is a required attribue");
        }

        OMAttribute priorityAtt = elem.getAttribute(PRIORITY_ATT);
        if (priorityAtt != null && !"".equals(priorityAtt.getAttributeValue())) {
            mediator.setPriority(Integer.parseInt(priorityAtt.getAttributeValue()));
        }

        OMAttribute queueAtt = elem.getAttribute(QUEUE_ATT);
        if (queueAtt != null && !"".equals(queueAtt.getAttributeValue())) {
            mediator.setExecutorName(queueAtt.getAttributeValue());
        } else {
            handleException("Queue is a required attribue");
        }

        return mediator;
View Full Code Here

TOP

Related Classes of org.apache.synapse.mediators.builtin.EnqueueMediator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.