FileDocCategorySizeDatePackage
WSDDDocument.javaAPI DocApache Axis 1.44709Sat Apr 22 18:57:28 BST 2006org.apache.axis.deployment.wsdd

WSDDDocument

public class WSDDDocument extends WSDDConstants
represents a WSDD Document (this is the top level object in this object model) Only one of {@link #deployment} and {@link #undeployment} should be valid.

Fields Summary
protected static Log
log
private Document
doc
owner doc
private WSDDDeployment
deployment
deployment tree. may be null
private WSDDUndeployment
undeployment
undeployment tree. may be null
Constructors Summary
public WSDDDocument()
empty constructor


           
     
    
    
public WSDDDocument(Document document)
create and bind to a document

param
document (Document) XXX

        setDocument(document);
    
public WSDDDocument(Element e)
bind to a sub-element in a document.

param
e (Element) XXX

        doc = e.getOwnerDocument();
        if (ELEM_WSDD_UNDEPLOY.equals(e.getLocalName())) {
            undeployment = new WSDDUndeployment(e);
        } else {
            deployment = new WSDDDeployment(e);
        }
    
Methods Summary
public voiddeploy(WSDDDeployment registry)
do a deploy and/or undeploy, depending on what is in the document. If both trees are set, then undeploy follows deploy.

param
registry
throws
ConfigurationException

        if (deployment != null) {
            deployment.deployToRegistry(registry);
        }
        if (undeployment != null) {
            undeployment.undeployFromRegistry(registry);
        }
    
public org.w3c.dom.DocumentgetDOMDocument()
get the deployment as a DOM. Requires that the deployment member variable is not null.

return
throws
ConfigurationException

        StringWriter writer = new StringWriter();
        SerializationContext context = new SerializationContext(writer);
        context.setPretty(true);
        try {
            deployment.writeToContext(context);
        } catch (Exception e) {
            log.error(Messages.getMessage("exception00"), e);
        }
        try {
            writer.close();
            return XMLUtils.newDocument(new InputSource(new StringReader(writer.getBuffer().toString())));
        } catch (Exception e) {
            return null;
        }
    
public WSDDDeploymentgetDeployment()
Get the deployment. If there is no deployment, create an empty one

return
the deployment document

        if (deployment == null) {
            deployment = new WSDDDeployment();
        }
        return deployment;
    
public voidsetDocument(org.w3c.dom.Document document)
Bind to a new document, setting the undeployment nodes if it is an undeployment, the deployment tree if it is anything else.

param
document XXX

        this.doc = document;
        Element docEl = doc.getDocumentElement();
        if (ELEM_WSDD_UNDEPLOY.equals(docEl.getLocalName())) {
            undeployment = new WSDDUndeployment(docEl);
        } else {
            deployment = new WSDDDeployment(docEl);
        }
    
public voidwriteToContext(org.apache.axis.encoding.SerializationContext context)
write the deployment to the supplied serialization context.

param
context
throws
IOException

        getDeployment().writeToContext(context);