Search in sources :

Example 6 with MethodNode

use of com.sun.enterprise.deployment.node.MethodNode in project Payara by payara.

the class ConcurrentMethodNode method writeDescriptor.

@Override
public Node writeDescriptor(Node parent, String nodeName, ConcurrentMethodDescriptor desc) {
    Node concurrentNode = super.writeDescriptor(parent, nodeName, descriptor);
    MethodNode methodNode = new MethodNode();
    methodNode.writeJavaMethodDescriptor(concurrentNode, EjbTagNames.METHOD, desc.getConcurrentMethod());
    if (desc.hasLockMetadata()) {
        String lockType = desc.isWriteLocked() ? "Write" : "Read";
        appendTextChild(concurrentNode, EjbTagNames.CONCURRENT_LOCK, lockType);
    }
    if (desc.hasAccessTimeout()) {
        TimeoutValueNode timeoutValueNode = new TimeoutValueNode();
        TimeoutValueDescriptor timeoutDesc = new TimeoutValueDescriptor();
        timeoutDesc.setValue(desc.getAccessTimeoutValue());
        timeoutDesc.setUnit(desc.getAccessTimeoutUnit());
        timeoutValueNode.writeDescriptor(concurrentNode, EjbTagNames.CONCURRENT_ACCESS_TIMEOUT, timeoutDesc);
    }
    return concurrentNode;
}
Also used : MethodNode(com.sun.enterprise.deployment.node.MethodNode) Node(org.w3c.dom.Node) MethodNode(com.sun.enterprise.deployment.node.MethodNode) DeploymentDescriptorNode(com.sun.enterprise.deployment.node.DeploymentDescriptorNode) TimeoutValueDescriptor(org.glassfish.ejb.deployment.descriptor.TimeoutValueDescriptor)

Example 7 with MethodNode

use of com.sun.enterprise.deployment.node.MethodNode in project Payara by payara.

the class MessageNode method writeDescriptor.

/**
 * write the descriptor class to a DOM tree and return it
 *
 * @param parent node for the DOM tree
 * @param node name for
 * @param the descriptor to write
 * @return the DOM tree top node
 */
public Node writeDescriptor(Node parent, String nodeName, MessageDescriptor messageDesc) {
    Node messageNode = super.writeDescriptor(parent, nodeName, messageDesc);
    // to a method descriptor with "*" as name
    if (messageDesc.getOperationName() == null && messageDesc.getMethodDescriptor() == null) {
        MethodDescriptor allMethodDesc = new MethodDescriptor();
        allMethodDesc.setName(ALL_METHODS);
        messageDesc.setMethodDescriptor(allMethodDesc);
    }
    // java-method
    MethodDescriptor methodDesc = messageDesc.getMethodDescriptor();
    if (methodDesc != null) {
        MethodNode methodNode = new MethodNode();
        methodNode.writeJavaMethodDescriptor(messageNode, RuntimeTagNames.JAVA_METHOD, methodDesc);
    }
    // operation-name
    appendTextChild(messageNode, WebServicesTagNames.OPERATION_NAME, messageDesc.getOperationName());
    return messageNode;
}
Also used : MethodNode(com.sun.enterprise.deployment.node.MethodNode) XMLNode(com.sun.enterprise.deployment.node.XMLNode) Node(org.w3c.dom.Node) MethodNode(com.sun.enterprise.deployment.node.MethodNode) DeploymentDescriptorNode(com.sun.enterprise.deployment.node.DeploymentDescriptorNode)

Example 8 with MethodNode

use of com.sun.enterprise.deployment.node.MethodNode in project Payara by payara.

the class EjbRemoveNode method writeDescriptor.

@Override
public Node writeDescriptor(Node parent, String nodeName, EjbRemovalInfo descriptor) {
    Node removeNode = appendChild(parent, nodeName);
    MethodNode methodNode = new MethodNode();
    methodNode.writeJavaMethodDescriptor(removeNode, EjbTagNames.REMOVE_BEAN_METHOD, descriptor.getRemoveMethod());
    appendTextChild(removeNode, EjbTagNames.REMOVE_RETAIN_IF_EXCEPTION, Boolean.toString(descriptor.getRetainIfException()));
    return removeNode;
}
Also used : MethodNode(com.sun.enterprise.deployment.node.MethodNode) Node(org.w3c.dom.Node) MethodNode(com.sun.enterprise.deployment.node.MethodNode) DeploymentDescriptorNode(com.sun.enterprise.deployment.node.DeploymentDescriptorNode)

Example 9 with MethodNode

use of com.sun.enterprise.deployment.node.MethodNode in project Payara by payara.

the class InterceptorBindingNode method writeTotalOrdering.

private void writeTotalOrdering(Node parent, List<EjbInterceptor> interceptors, EjbDescriptor ejbDesc, MethodDescriptor method) {
    Node bindingNode = appendChild(parent, EjbTagNames.INTERCEPTOR_BINDING);
    appendTextChild(bindingNode, EjbTagNames.EJB_NAME, ejbDesc.getName());
    Node totalOrderingNode = appendChild(bindingNode, EjbTagNames.INTERCEPTOR_ORDER);
    for (EjbInterceptor next : interceptors) {
        appendTextChild(totalOrderingNode, EjbTagNames.INTERCEPTOR_CLASS, next.getInterceptorClassName());
    }
    if (method != null) {
        MethodNode methodNode = new MethodNode();
        // Write out method description. void methods will be written
        // out using an empty method-params element so they will not
        // be interpreted as overloaded when processed.
        methodNode.writeJavaMethodDescriptor(bindingNode, EjbTagNames.INTERCEPTOR_BUSINESS_METHOD, method, true);
    }
}
Also used : MethodNode(com.sun.enterprise.deployment.node.MethodNode) Node(org.w3c.dom.Node) MethodNode(com.sun.enterprise.deployment.node.MethodNode) DeploymentDescriptorNode(com.sun.enterprise.deployment.node.DeploymentDescriptorNode) EjbInterceptor(com.sun.enterprise.deployment.EjbInterceptor)

Example 10 with MethodNode

use of com.sun.enterprise.deployment.node.MethodNode in project Payara by payara.

the class InterceptorBindingNode method writeExclusionBinding.

private void writeExclusionBinding(Node parent, EjbDescriptor ejbDesc, MethodDescriptor method) {
    Node bindingNode = appendChild(parent, EjbTagNames.INTERCEPTOR_BINDING);
    appendTextChild(bindingNode, EjbTagNames.EJB_NAME, ejbDesc.getName());
    appendTextChild(bindingNode, EjbTagNames.EXCLUDE_CLASS_INTERCEPTORS, "true");
    MethodNode methodNode = new MethodNode();
    // Write out method description. void methods will be written
    // out using an empty method-params element so they will not
    // be interpreted as overloaded when processed.
    methodNode.writeJavaMethodDescriptor(bindingNode, EjbTagNames.INTERCEPTOR_BUSINESS_METHOD, method, true);
}
Also used : MethodNode(com.sun.enterprise.deployment.node.MethodNode) Node(org.w3c.dom.Node) MethodNode(com.sun.enterprise.deployment.node.MethodNode) DeploymentDescriptorNode(com.sun.enterprise.deployment.node.DeploymentDescriptorNode)

Aggregations

MethodNode (com.sun.enterprise.deployment.node.MethodNode)14 Node (org.w3c.dom.Node)13 DeploymentDescriptorNode (com.sun.enterprise.deployment.node.DeploymentDescriptorNode)12 MethodDescriptor (com.sun.enterprise.deployment.MethodDescriptor)6 ArrayList (java.util.ArrayList)3 Iterator (java.util.Iterator)2 TimeoutValueDescriptor (org.glassfish.ejb.deployment.descriptor.TimeoutValueDescriptor)2 EjbInterceptor (com.sun.enterprise.deployment.EjbInterceptor)1 MethodPermission (com.sun.enterprise.deployment.MethodPermission)1 DataSourceDefinitionNode (com.sun.enterprise.deployment.node.DataSourceDefinitionNode)1 LifecycleCallbackNode (com.sun.enterprise.deployment.node.LifecycleCallbackNode)1 MailSessionNode (com.sun.enterprise.deployment.node.MailSessionNode)1 XMLNode (com.sun.enterprise.deployment.node.XMLNode)1 GregorianCalendar (java.util.GregorianCalendar)1 Map (java.util.Map)1 DatatypeFactory (javax.xml.datatype.DatatypeFactory)1 XMLGregorianCalendar (javax.xml.datatype.XMLGregorianCalendar)1 ConcurrentMethodDescriptor (org.glassfish.ejb.deployment.descriptor.ConcurrentMethodDescriptor)1 ContainerTransaction (org.glassfish.ejb.deployment.descriptor.ContainerTransaction)1 EjbInitInfo (org.glassfish.ejb.deployment.descriptor.EjbInitInfo)1