Package org.activemq.ws.notification.impl

Source Code of org.activemq.ws.notification.impl.XmlObjectResourceProperties

package org.activemq.ws.notification.impl;

import org.activemq.ws.resource.ResourceProperties;
import org.activemq.ws.xmlbeans.addressing.v2003_03.EndpointReferenceType;
import org.activemq.ws.xmlbeans.resource.properties.GetResourcePropertyDocument;
import org.activemq.ws.xmlbeans.resource.properties.GetResourcePropertyResponseDocument;
import org.activemq.ws.xmlbeans.resource.properties.GetResourcePropertyResponseDocument.GetResourcePropertyResponse;
import org.apache.xmlbeans.XmlCursor;
import org.apache.xmlbeans.XmlObject;

public class XmlObjectResourceProperties implements ResourceProperties {

    private final XmlObject resourceProperties;

    public XmlObjectResourceProperties(XmlObject resourceProperties) {
        this.resourceProperties = resourceProperties;       
    }
   
    public XmlObject getResourceProperties() {
        return resourceProperties;
    }
   
    public GetResourcePropertyResponseDocument getResourceProperty(EndpointReferenceType resource, GetResourcePropertyDocument request) {
        GetResourcePropertyResponseDocument responseDoc = GetResourcePropertyResponseDocument.Factory.newInstance();
        GetResourcePropertyResponse response = responseDoc.addNewGetResourcePropertyResponse();
        XmlCursor cursor = response.newCursor();
        cursor.toFirstContentToken();

        XmlObject[] objects = resourceProperties.selectChildren(request.getGetResourceProperty());
        for (int i = 0; i < objects.length; i++) {
            objects[i].newCursor().copyXml(cursor);
        }       
        return responseDoc;
    }
}
TOP

Related Classes of org.activemq.ws.notification.impl.XmlObjectResourceProperties

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.