Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMElement.addAttribute()


                    entry.addAttribute(TYPE, BYTEARRAY, attrNS);
                    OMText text = fac.createOMText(new DataHandler(
                            new ByteArrayDataSource((byte[]) o)), true);
                    entry.addChild(text);
                } else if (o instanceof Float) {
                    entry.addAttribute(TYPE, FLOAT, attrNS);
                    entry.setText(o.toString());
                } else if (o instanceof Double) {
                    entry.addAttribute(TYPE, DOUBLE, attrNS);
                    entry.setText(o.toString());
                } else if (o instanceof Long) {
View Full Code Here


                    entry.addChild(text);
                } else if (o instanceof Float) {
                    entry.addAttribute(TYPE, FLOAT, attrNS);
                    entry.setText(o.toString());
                } else if (o instanceof Double) {
                    entry.addAttribute(TYPE, DOUBLE, attrNS);
                    entry.setText(o.toString());
                } else if (o instanceof Long) {
                    entry.addAttribute(TYPE, LONG, attrNS);
                    entry.setText(o.toString());
                } else if (o instanceof Short) {
View Full Code Here

                    entry.setText(o.toString());
                } else if (o instanceof Double) {
                    entry.addAttribute(TYPE, DOUBLE, attrNS);
                    entry.setText(o.toString());
                } else if (o instanceof Long) {
                    entry.addAttribute(TYPE, LONG, attrNS);
                    entry.setText(o.toString());
                } else if (o instanceof Short) {
                    entry.addAttribute(TYPE, SHORT, attrNS);
                    entry.setText(o.toString());
                } else if (o instanceof Integer) {
View Full Code Here

                    entry.setText(o.toString());
                } else if (o instanceof Long) {
                    entry.addAttribute(TYPE, LONG, attrNS);
                    entry.setText(o.toString());
                } else if (o instanceof Short) {
                    entry.addAttribute(TYPE, SHORT, attrNS);
                    entry.setText(o.toString());
                } else if (o instanceof Integer) {
                    entry.addAttribute(TYPE, INTEGER, attrNS);
                    entry.setText(o.toString());
                }
View Full Code Here

                    entry.setText(o.toString());
                } else if (o instanceof Short) {
                    entry.addAttribute(TYPE, SHORT, attrNS);
                    entry.setText(o.toString());
                } else if (o instanceof Integer) {
                    entry.addAttribute(TYPE, INTEGER, attrNS);
                    entry.setText(o.toString());
                }

            } else {
                // shouldn't be any non-string keys. Ignore!
View Full Code Here

        saveTracingState(samplerElem, mediator);

        SamplingThrottleMediator samplingThrottleMediator = (SamplingThrottleMediator) mediator;

        if (samplingThrottleMediator.getId() != null) {
            samplerElem.addAttribute("id", samplingThrottleMediator.getId(), nullNS);
        }
        samplerElem.addAttribute("rate",
                Integer.toString(samplingThrottleMediator.getSamplingRate()), nullNS);
        samplerElem.addAttribute("unitTime",
                Long.toString(samplingThrottleMediator.getUnitTime()), nullNS);
View Full Code Here

        SamplingThrottleMediator samplingThrottleMediator = (SamplingThrottleMediator) mediator;

        if (samplingThrottleMediator.getId() != null) {
            samplerElem.addAttribute("id", samplingThrottleMediator.getId(), nullNS);
        }
        samplerElem.addAttribute("rate",
                Integer.toString(samplingThrottleMediator.getSamplingRate()), nullNS);
        samplerElem.addAttribute("unitTime",
                Long.toString(samplingThrottleMediator.getUnitTime()), nullNS);

        if (samplingThrottleMediator.isMessageQueueExplicitlySet()) {
View Full Code Here

        if (samplingThrottleMediator.getId() != null) {
            samplerElem.addAttribute("id", samplingThrottleMediator.getId(), nullNS);
        }
        samplerElem.addAttribute("rate",
                Integer.toString(samplingThrottleMediator.getSamplingRate()), nullNS);
        samplerElem.addAttribute("unitTime",
                Long.toString(samplingThrottleMediator.getUnitTime()), nullNS);

        if (samplingThrottleMediator.isMessageQueueExplicitlySet()) {
            OMElement messageQueueElem = fac.createOMElement("messageQueue", synNS);
            messageQueueElem.addAttribute("class",
View Full Code Here

        samplerElem.addAttribute("unitTime",
                Long.toString(samplingThrottleMediator.getUnitTime()), nullNS);

        if (samplingThrottleMediator.isMessageQueueExplicitlySet()) {
            OMElement messageQueueElem = fac.createOMElement("messageQueue", synNS);
            messageQueueElem.addAttribute("class",
                    samplingThrottleMediator.getMessageQueue().getClass().getName(), nullNS);
            samplerElem.addChild(messageQueueElem);
        }

        if (samplingThrottleMediator.getTarget() != null) {
View Full Code Here

    public static void serializeResourceMap(OMElement parent, ResourceMap resourceMap) {
        if (resourceMap != null) {
          for (Map.Entry<String,String> entry : resourceMap.getResources().entrySet()) {
                OMElement resource = fac.createOMElement("resource",
                    SynapseConstants.SYNAPSE_OMNAMESPACE);
                resource.addAttribute("location", (String)entry.getKey(), null);
                resource.addAttribute("key", (String)entry.getValue(), null);
                parent.addChild(resource);
            }
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.