Search in sources :

Example 1 with RuntimeNameValuePairNode

use of com.sun.enterprise.deployment.node.runtime.common.RuntimeNameValuePairNode in project Payara by payara.

the class WebServiceEndpointRuntimeNode method writeDescriptor.

/**
 * write the descriptor class to a DOM tree and return it
 *
 * @param parent node for the DOM tree
 * @param node name for the descriptor
 * @param the descriptor to write
 * @return the DOM tree top node
 */
public Node writeDescriptor(Node parent, String nodeName, WebServiceEndpoint endpoint) {
    Node endpointNode = super.writeDescriptor(parent, nodeName, endpoint);
    appendTextChild(endpointNode, WebServicesTagNames.PORT_COMPONENT_NAME, endpoint.getEndpointName());
    appendTextChild(endpointNode, WebServicesTagNames.ENDPOINT_ADDRESS_URI, endpoint.getEndpointAddressUri());
    // this info is described in web application itself.
    if (endpoint.implementedByEjbComponent() && endpoint.hasAuthMethod()) {
        Node loginConfigNode = appendChild(endpointNode, RuntimeTagNames.LOGIN_CONFIG);
        appendTextChild(loginConfigNode, RuntimeTagNames.AUTH_METHOD, endpoint.getAuthMethod());
        appendTextChild(loginConfigNode, RuntimeTagNames.REALM, endpoint.getRealm());
    }
    // message-security-binding
    MessageSecurityBindingDescriptor messageSecBindingDesc = endpoint.getMessageSecurityBinding();
    if (messageSecBindingDesc != null) {
        MessageSecurityBindingNode messageSecBindingNode = new MessageSecurityBindingNode();
        messageSecBindingNode.writeDescriptor(endpointNode, WebServicesTagNames.MESSAGE_SECURITY_BINDING, messageSecBindingDesc);
    }
    appendTextChild(endpointNode, WebServicesTagNames.TRANSPORT_GUARANTEE, endpoint.getTransportGuarantee());
    QName serviceName = endpoint.getServiceName();
    if (serviceName != null) {
        Node serviceQnameNode = appendChild(endpointNode, WebServicesTagNames.SERVICE_QNAME);
        appendTextChild(serviceQnameNode, WebServicesTagNames.NAMESPACE_URI, serviceName.getNamespaceURI());
        appendTextChild(serviceQnameNode, WebServicesTagNames.LOCAL_PART, serviceName.getLocalPart());
    }
    appendTextChild(endpointNode, WebServicesTagNames.TIE_CLASS, endpoint.getTieClassName());
    if (endpoint.implementedByWebComponent() && (endpoint.getServletImplClass() != null)) {
        appendTextChild(endpointNode, WebServicesTagNames.SERVLET_IMPL_CLASS, endpoint.getServletImplClass());
    }
    // debugging-enabled?
    appendTextChild(endpointNode, WebServicesTagNames.DEBUGGING_ENABLED, endpoint.getDebugging());
    // property*
    Iterator properties = endpoint.getProperties();
    if (properties != null) {
        RuntimeNameValuePairNode propNode = new RuntimeNameValuePairNode();
        while (properties.hasNext()) {
            NameValuePairDescriptor aProp = (NameValuePairDescriptor) properties.next();
            propNode.writeDescriptor(endpointNode, RuntimeTagNames.PROPERTY, aProp);
        }
    }
    return endpointNode;
}
Also used : MessageSecurityBindingDescriptor(com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor) NameValuePairDescriptor(com.sun.enterprise.deployment.NameValuePairDescriptor) QName(javax.xml.namespace.QName) MessageSecurityBindingNode(com.sun.enterprise.deployment.node.runtime.common.MessageSecurityBindingNode) DeploymentDescriptorNode(com.sun.enterprise.deployment.node.DeploymentDescriptorNode) Node(org.w3c.dom.Node) RuntimeNameValuePairNode(com.sun.enterprise.deployment.node.runtime.common.RuntimeNameValuePairNode) MessageSecurityBindingNode(com.sun.enterprise.deployment.node.runtime.common.MessageSecurityBindingNode) Iterator(java.util.Iterator) RuntimeNameValuePairNode(com.sun.enterprise.deployment.node.runtime.common.RuntimeNameValuePairNode)

Example 2 with RuntimeNameValuePairNode

use of com.sun.enterprise.deployment.node.runtime.common.RuntimeNameValuePairNode in project Payara by payara.

the class ResourceAdapterNode method writeDescriptor.

/**
 * write the descriptor class to a DOM tree and return it
 *
 * @param parent node for the DOM tree
 * @param node name for the descriptor
 * @param the descriptor to write
 * @return the DOM tree top node
 */
public Node writeDescriptor(Node parent, String nodeName, ResourceAdapter descriptor) {
    Element raNode = (Element) super.writeDescriptor(parent, nodeName, descriptor);
    appendTextChild(raNode, RuntimeTagNames.DESCRIPTION, descriptor.getDescription());
    setAttribute(raNode, RuntimeTagNames.JNDI_NAME, (String) descriptor.getValue(ResourceAdapter.JNDI_NAME));
    setAttribute(raNode, RuntimeTagNames.MAX_POOL_SIZE, (String) descriptor.getValue(ResourceAdapter.MAX_POOL_SIZE));
    setAttribute(raNode, RuntimeTagNames.STEADY_POOL_SIZE, (String) descriptor.getValue(ResourceAdapter.STEADY_POOL_SIZE));
    setAttribute(raNode, RuntimeTagNames.MAX_WAIT_TIME_IN_MILLIS, (String) descriptor.getValue(ResourceAdapter.MAX_WAIT_TIME_IN_MILLIS));
    setAttribute(raNode, RuntimeTagNames.IDLE_TIMEOUT_IN_SECONDS, (String) descriptor.getValue(ResourceAdapter.IDLE_TIMEOUT_IN_SECONDS));
    // properties...
    NameValuePairDescriptor[] properties = descriptor.getPropertyElement();
    if (properties != null && properties.length > 0) {
        RuntimeNameValuePairNode subNode = new RuntimeNameValuePairNode();
        for (int i = 0; i < properties.length; i++) {
            subNode.writeDescriptor(raNode, RuntimeTagNames.PROPERTY, properties[i]);
        }
    }
    return raNode;
}
Also used : NameValuePairDescriptor(com.sun.enterprise.deployment.NameValuePairDescriptor) Element(org.w3c.dom.Element) XMLElement(com.sun.enterprise.deployment.node.XMLElement) RuntimeNameValuePairNode(com.sun.enterprise.deployment.node.runtime.common.RuntimeNameValuePairNode)

Example 3 with RuntimeNameValuePairNode

use of com.sun.enterprise.deployment.node.runtime.common.RuntimeNameValuePairNode in project Payara by payara.

the class EnterpriseBeansRuntimeNode method writeDescriptor.

/**
 * write the descriptor class to a DOM tree and return it
 *
 * @param parent node for the DOM tree
 * @param the descriptor to write
 * @return the DOM tree top node
 */
public Node writeDescriptor(Node parent, String nodeName, EjbBundleDescriptorImpl bundleDescriptor) {
    Node ejbs = super.writeDescriptor(parent, nodeName, bundleDescriptor);
    // NOTE : unique-id is no longer written out to sun-ejb-jar.xml.  It is persisted via
    // domain.xml deployment context properties instead.
    // ejb*
    EjbNode ejbNode = new EjbNode();
    for (Iterator ejbIterator = bundleDescriptor.getEjbs().iterator(); ejbIterator.hasNext(); ) {
        EjbDescriptor ejbDescriptor = (EjbDescriptor) ejbIterator.next();
        ejbNode.writeDescriptor(ejbs, RuntimeTagNames.EJB, ejbDescriptor);
    }
    // pm-descriptors?
    PMDescriptorsNode pmsNode = new PMDescriptorsNode();
    pmsNode.writeDescriptor(ejbs, RuntimeTagNames.PM_DESCRIPTORS, bundleDescriptor);
    // cmpresource?
    ResourceReferenceDescriptor rrd = bundleDescriptor.getCMPResourceReference();
    if (rrd != null) {
        CmpResourceNode crn = new CmpResourceNode();
        crn.writeDescriptor(ejbs, RuntimeTagNames.CMP_RESOURCE, rrd);
    }
    // message-destination*
    writeMessageDestinationInfo(ejbs, bundleDescriptor);
    // webservice-description*
    WebServiceRuntimeNode webServiceNode = new WebServiceRuntimeNode();
    webServiceNode.writeWebServiceRuntimeInfo(ejbs, bundleDescriptor);
    for (NameValuePairDescriptor p : bundleDescriptor.getEnterpriseBeansProperties()) {
        RuntimeNameValuePairNode nameValNode = new RuntimeNameValuePairNode();
        nameValNode.writeDescriptor(ejbs, RuntimeTagNames.PROPERTY, p);
    }
    return ejbs;
}
Also used : NameValuePairDescriptor(com.sun.enterprise.deployment.NameValuePairDescriptor) MessageDestinationRuntimeNode(com.sun.enterprise.deployment.node.runtime.MessageDestinationRuntimeNode) RuntimeNameValuePairNode(com.sun.enterprise.deployment.node.runtime.common.RuntimeNameValuePairNode) WebServiceRuntimeNode(com.sun.enterprise.deployment.node.runtime.WebServiceRuntimeNode) Node(org.w3c.dom.Node) RuntimeDescriptorNode(com.sun.enterprise.deployment.node.runtime.RuntimeDescriptorNode) Iterator(java.util.Iterator) RuntimeNameValuePairNode(com.sun.enterprise.deployment.node.runtime.common.RuntimeNameValuePairNode) ResourceReferenceDescriptor(com.sun.enterprise.deployment.ResourceReferenceDescriptor) WebServiceRuntimeNode(com.sun.enterprise.deployment.node.runtime.WebServiceRuntimeNode) EjbDescriptor(org.glassfish.ejb.deployment.descriptor.EjbDescriptor)

Example 4 with RuntimeNameValuePairNode

use of com.sun.enterprise.deployment.node.runtime.common.RuntimeNameValuePairNode in project Payara by payara.

the class CmpResourceNode method writeDescriptor.

@Override
public Node writeDescriptor(Node parent, String nodeName, ResourceReferenceDescriptor descriptor) {
    Node cmp = super.writeDescriptor(parent, nodeName, descriptor);
    appendTextChild(cmp, RuntimeTagNames.JNDI_NAME, descriptor.getJndiName());
    if (descriptor.getResourcePrincipal() != null) {
        DefaultResourcePrincipalNode drpNode = new DefaultResourcePrincipalNode();
        drpNode.writeDescriptor(cmp, RuntimeTagNames.DEFAULT_RESOURCE_PRINCIPAL, descriptor.getResourcePrincipal());
    }
    // properties*
    Iterator properties = descriptor.getProperties();
    if (properties != null) {
        RuntimeNameValuePairNode propNode = new RuntimeNameValuePairNode();
        while (properties.hasNext()) {
            NameValuePairDescriptor aProp = (NameValuePairDescriptor) properties.next();
            propNode.writeDescriptor(cmp, RuntimeTagNames.PROPERTY, aProp);
        }
    }
    // createTableAtDeploy, dropTableAtUndeploy
    if (descriptor.isCreateTablesAtDeploy()) {
        appendTextChild(cmp, RuntimeTagNames.CREATE_TABLES_AT_DEPLOY, RuntimeTagNames.TRUE);
    }
    if (descriptor.isDropTablesAtUndeploy()) {
        appendTextChild(cmp, RuntimeTagNames.DROP_TABLES_AT_UNDEPLOY, RuntimeTagNames.TRUE);
    }
    // database vendor name
    appendTextChild(cmp, RuntimeTagNames.DATABASE_VENDOR_NAME, descriptor.getDatabaseVendorName());
    // schema-generator-properties?
    Properties schemaGeneratorProps = descriptor.getSchemaGeneratorProperties();
    if (schemaGeneratorProps != null) {
        PropertiesNode pn = new PropertiesNode();
        pn.writeDescriptor(cmp, RuntimeTagNames.SCHEMA_GENERATOR_PROPERTIES, schemaGeneratorProps);
    }
    return cmp;
}
Also used : NameValuePairDescriptor(com.sun.enterprise.deployment.NameValuePairDescriptor) PropertiesNode(com.sun.enterprise.deployment.node.PropertiesNode) RuntimeNameValuePairNode(com.sun.enterprise.deployment.node.runtime.common.RuntimeNameValuePairNode) Node(org.w3c.dom.Node) RuntimeDescriptorNode(com.sun.enterprise.deployment.node.runtime.RuntimeDescriptorNode) DefaultResourcePrincipalNode(com.sun.enterprise.deployment.node.runtime.DefaultResourcePrincipalNode) DefaultResourcePrincipalNode(com.sun.enterprise.deployment.node.runtime.DefaultResourcePrincipalNode) Iterator(java.util.Iterator) RuntimeNameValuePairNode(com.sun.enterprise.deployment.node.runtime.common.RuntimeNameValuePairNode) Properties(java.util.Properties) PropertiesNode(com.sun.enterprise.deployment.node.PropertiesNode)

Aggregations

NameValuePairDescriptor (com.sun.enterprise.deployment.NameValuePairDescriptor)4 RuntimeNameValuePairNode (com.sun.enterprise.deployment.node.runtime.common.RuntimeNameValuePairNode)4 Iterator (java.util.Iterator)3 Node (org.w3c.dom.Node)3 RuntimeDescriptorNode (com.sun.enterprise.deployment.node.runtime.RuntimeDescriptorNode)2 ResourceReferenceDescriptor (com.sun.enterprise.deployment.ResourceReferenceDescriptor)1 DeploymentDescriptorNode (com.sun.enterprise.deployment.node.DeploymentDescriptorNode)1 PropertiesNode (com.sun.enterprise.deployment.node.PropertiesNode)1 XMLElement (com.sun.enterprise.deployment.node.XMLElement)1 DefaultResourcePrincipalNode (com.sun.enterprise.deployment.node.runtime.DefaultResourcePrincipalNode)1 MessageDestinationRuntimeNode (com.sun.enterprise.deployment.node.runtime.MessageDestinationRuntimeNode)1 WebServiceRuntimeNode (com.sun.enterprise.deployment.node.runtime.WebServiceRuntimeNode)1 MessageSecurityBindingNode (com.sun.enterprise.deployment.node.runtime.common.MessageSecurityBindingNode)1 MessageSecurityBindingDescriptor (com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor)1 Properties (java.util.Properties)1 QName (javax.xml.namespace.QName)1 EjbDescriptor (org.glassfish.ejb.deployment.descriptor.EjbDescriptor)1 Element (org.w3c.dom.Element)1