Package com.sun.enterprise.deployment.node

Examples of com.sun.enterprise.deployment.node.MethodNode


     * @param the descriptor to write
     * @return the DOM tree top node
     */
    public Node writeDescriptor(Node parent, String nodeName, EjbInitInfo initMethod) {
        Node initNode = appendChild(parent, nodeName);       
        MethodNode methodNode = new MethodNode();

        methodNode.writeJavaMethodDescriptor
            (initNode, EjbTagNames.INIT_CREATE_METHOD,
             initMethod.getCreateMethod());

        methodNode.writeJavaMethodDescriptor
            (initNode, EjbTagNames.INIT_BEAN_METHOD,
             initMethod.getBeanMethod());

        return initNode;
    }
View Full Code Here


        Node queryNode = super.writeDescriptor(parent, nodeName, descriptor);

        writeLocalizedDescriptions(queryNode, descriptor);
               
        // query-method
        MethodNode methodNode = new MethodNode();
        methodNode.writeQueryMethodDescriptor(queryNode, EjbTagNames.QUERY_METHOD,
                                                                         descriptor.getQueryMethodDescriptor());
       
        if (descriptor.getHasRemoteReturnTypeMapping()) {           
            appendTextChild(queryNode, EjbTagNames.QUERY_RESULT_TYPE_MAPPING,
                                                    EjbTagNames.QUERY_REMOTE_TYPE_MAPPING);    
View Full Code Here

                }       
            }
        }
               
        MethodDescriptor[] methods = descriptor.getMethods();
        MethodNode mn = new MethodNode();
        for (int i=0;i<methods.length;i++) {           
            String ejbName = ejb.getName();
            mn.writeDescriptor(subNode, EjbTagNames.METHOD, methods[i], ejbName);
        }           
        return subNode;
    }
View Full Code Here

        ConcurrentMethodDescriptor desc = (ConcurrentMethodDescriptor) descriptor;

        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);
View Full Code Here

            }
        } catch (Exception e) {
            DOLUtils.getDefaultLogger().log(Level.WARNING, e.getMessage(), e);
        }

        MethodNode methodNode = new MethodNode();

        methodNode.writeJavaMethodDescriptor(timerNode, EjbTagNames.TIMEOUT_METHOD,
                 desc.getTimeoutMethod());
       
        appendTextChild(timerNode, EjbTagNames.TIMER_PERSISTENT,
            Boolean.toString(desc.getPersistent()));
View Full Code Here

     * @return the DOM tree top node
     */
    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()));
View Full Code Here

            timeoutValueNode.writeDescriptor(ejbNode, EjbTagNames.STATEFUL_TIMEOUT,
                    timeoutDesc);

        }

        MethodNode methodNode = new MethodNode();

        if (ejbDesc.isTimedObject()) {
            if (ejbDesc.getEjbTimeoutMethod() != null) {

                methodNode.writeJavaMethodDescriptor
                        (ejbNode, EjbTagNames.TIMEOUT_METHOD,
                                ejbDesc.getEjbTimeoutMethod());
            }

            for (ScheduledTimerDescriptor timerDesc : ejbDesc.getScheduledTimerDescriptors()) {
                ScheduledTimerNode timerNode = new ScheduledTimerNode();
                timerNode.writeDescriptor(ejbNode, EjbTagNames.TIMER, timerDesc);
            }
        }

        if (ejbDesc.isSingleton()) {
            appendTextChild(ejbNode, EjbTagNames.INIT_ON_STARTUP,
                    Boolean.toString(ejbDesc.getInitOnStartup()));
        }

        if (!ejbDesc.isStateless()) {
            appendTextChild(ejbNode, EjbTagNames.CONCURRENCY_MANAGEMENT_TYPE,
                    ejbDesc.getConcurrencyManagementType().toString());
        }

        for (EjbSessionDescriptor.AccessTimeoutHolder next : ejbDesc.getAccessTimeoutInfo()) {
            ConcurrentMethodDescriptor cDesc = new ConcurrentMethodDescriptor();
            cDesc.setConcurrentMethod(next.method);
            TimeoutValueDescriptor timeoutDesc = new TimeoutValueDescriptor();
            timeoutDesc.setValue(next.value);
            timeoutDesc.setUnit(next.unit);
            cDesc.setAccessTimeout(timeoutDesc);

            ConcurrentMethodNode cNode = new ConcurrentMethodNode();
            cNode.writeDescriptor(ejbNode, EjbTagNames.CONCURRENT_METHOD, cDesc);
        }

        for (MethodDescriptor nextReadLock : ejbDesc.getReadLockMethods()) {
            ConcurrentMethodDescriptor cDesc = new ConcurrentMethodDescriptor();
            cDesc.setConcurrentMethod(nextReadLock);
            cDesc.setWriteLock(false);
            ConcurrentMethodNode cNode = new ConcurrentMethodNode();
            cNode.writeDescriptor(ejbNode, EjbTagNames.CONCURRENT_METHOD, cDesc);
        }

        if (ejbDesc.hasDependsOn()) {
            Node dependsOnNode = appendChild(ejbNode, EjbTagNames.DEPENDS_ON);
            for (String depend : ejbDesc.getDependsOn()) {
                appendTextChild(dependsOnNode, EjbTagNames.EJB_NAME, depend);
            }
        }

        if (ejbDesc.hasInitMethods()) {
            EjbInitNode initNode = new EjbInitNode();
            for (EjbInitInfo next : ejbDesc.getInitMethods()) {
                initNode.writeDescriptor(ejbNode,
                        EjbTagNames.INIT_METHOD, next);
            }
        }

        if (ejbDesc.hasRemoveMethods()) {
            EjbRemoveNode removeNode = new EjbRemoveNode();
            for (EjbRemovalInfo next : ejbDesc.getAllRemovalInfo()) {
                removeNode.writeDescriptor(ejbNode,
                        EjbTagNames.REMOVE_METHOD, next);
            }
        }

        for (MethodDescriptor nextDesc : ejbDesc.getAsynchronousMethods()) {

            methodNode.writeDescriptor(ejbNode, EjbTagNames.ASYNC_METHOD, nextDesc,
                    ejbDesc.getName());

        }

        appendTextChild(ejbNode, EjbTagNames.TRANSACTION_TYPE, ejbDesc.getTransactionType());

        MethodDescriptor afterBeginMethod = ejbDesc.getAfterBeginMethod();
        if (afterBeginMethod != null) {
            methodNode.writeJavaMethodDescriptor(ejbNode, EjbTagNames.AFTER_BEGIN_METHOD,
                    afterBeginMethod);
        }

        MethodDescriptor beforeCompletionMethod = ejbDesc.getBeforeCompletionMethod();
        if (beforeCompletionMethod != null) {
            methodNode.writeJavaMethodDescriptor(ejbNode, EjbTagNames.BEFORE_COMPLETION_METHOD,
                    beforeCompletionMethod);
        }

        MethodDescriptor afterCompletionMethod = ejbDesc.getAfterCompletionMethod();
        if (afterCompletionMethod != null) {
            methodNode.writeJavaMethodDescriptor(ejbNode, EjbTagNames.AFTER_COMPLETION_METHOD,
                    afterCompletionMethod);
        }


        //around-invoke-method
View Full Code Here

     * @return the DOM tree top node
     */
    public Node writeDescriptor(Node parent, String nodeName, EjbDescriptor ejb) {   
       
        Map methodToTransactions = ejb.getMethodContainerTransactions();
        MethodNode mn = new MethodNode();
        for (Object o : methodToTransactions.entrySet()) {
            Map.Entry entry = (Map.Entry) o;
            MethodDescriptor md = (MethodDescriptor) entry.getKey();
            Node ctNode = super.writeDescriptor(parent, nodeName, ejb);           
            ContainerTransaction ct = (ContainerTransaction) entry.getValue();
            appendTextChild(ctNode, EjbTagNames.DESCRIPTION, ct.getDescription());
            mn.writeDescriptor(ctNode, EjbTagNames.METHOD, md, ejb.getName());
            appendTextChild(ctNode, EjbTagNames.TRANSACTION_ATTRIBUTE, ct.getTransactionAttribute());
        }
        return null;
    }
View Full Code Here

            timeoutValueNode.writeDescriptor(ejbNode, EjbTagNames.STATEFUL_TIMEOUT,
                    timeoutDesc);

        }

        MethodNode methodNode = new MethodNode();

        if (ejbDesc.isTimedObject()) {
            if (ejbDesc.getEjbTimeoutMethod() != null) {

                methodNode.writeJavaMethodDescriptor
                        (ejbNode, EjbTagNames.TIMEOUT_METHOD,
                                ejbDesc.getEjbTimeoutMethod());
            }

            for (ScheduledTimerDescriptor timerDesc : ejbDesc.getScheduledTimerDescriptors()) {
                ScheduledTimerNode timerNode = new ScheduledTimerNode();
                timerNode.writeDescriptor(ejbNode, EjbTagNames.TIMER, timerDesc);
            }
        }

        if (ejbDesc.isSingleton()) {
            appendTextChild(ejbNode, EjbTagNames.INIT_ON_STARTUP,
                    Boolean.toString(ejbDesc.getInitOnStartup()));
        }

        if (!ejbDesc.isStateless()) {
            appendTextChild(ejbNode, EjbTagNames.CONCURRENCY_MANAGEMENT_TYPE,
                    ejbDesc.getConcurrencyManagementType().toString());
        }

        for (EjbSessionDescriptor.AccessTimeoutHolder next : ejbDesc.getAccessTimeoutInfo()) {
            ConcurrentMethodDescriptor cDesc = new ConcurrentMethodDescriptor();
            cDesc.setConcurrentMethod(next.method);
            TimeoutValueDescriptor timeoutDesc = new TimeoutValueDescriptor();
            timeoutDesc.setValue(next.value);
            timeoutDesc.setUnit(next.unit);
            cDesc.setAccessTimeout(timeoutDesc);

            ConcurrentMethodNode cNode = new ConcurrentMethodNode();
            cNode.writeDescriptor(ejbNode, EjbTagNames.CONCURRENT_METHOD, cDesc);
        }

        for (MethodDescriptor nextReadLock : ejbDesc.getReadLockMethods()) {
            ConcurrentMethodDescriptor cDesc = new ConcurrentMethodDescriptor();
            cDesc.setConcurrentMethod(nextReadLock);
            cDesc.setWriteLock(false);
            ConcurrentMethodNode cNode = new ConcurrentMethodNode();
            cNode.writeDescriptor(ejbNode, EjbTagNames.CONCURRENT_METHOD, cDesc);
        }

        if (ejbDesc.hasDependsOn()) {
            Node dependsOnNode = appendChild(ejbNode, EjbTagNames.DEPENDS_ON);
            for (String depend : ejbDesc.getDependsOn()) {
                appendTextChild(dependsOnNode, EjbTagNames.EJB_NAME, depend);
            }
        }

        if (ejbDesc.hasInitMethods()) {
            EjbInitNode initNode = new EjbInitNode();
            for (EjbInitInfo next : ejbDesc.getInitMethods()) {
                initNode.writeDescriptor(ejbNode,
                        EjbTagNames.INIT_METHOD, next);
            }
        }

        if (ejbDesc.hasRemoveMethods()) {
            EjbRemoveNode removeNode = new EjbRemoveNode();
            for (EjbRemovalInfo next : ejbDesc.getAllRemovalInfo()) {
                removeNode.writeDescriptor(ejbNode,
                        EjbTagNames.REMOVE_METHOD, next);
            }
        }

        for (MethodDescriptor nextDesc : ejbDesc.getAsynchronousMethods()) {

            methodNode.writeDescriptor(ejbNode, EjbTagNames.ASYNC_METHOD, nextDesc,
                    ejbDesc.getName());

        }

        appendTextChild(ejbNode, EjbTagNames.TRANSACTION_TYPE, ejbDesc.getTransactionType());

        MethodDescriptor afterBeginMethod = ejbDesc.getAfterBeginMethod();
        if (afterBeginMethod != null) {
            methodNode.writeJavaMethodDescriptor(ejbNode, EjbTagNames.AFTER_BEGIN_METHOD,
                    afterBeginMethod);
        }

        MethodDescriptor beforeCompletionMethod = ejbDesc.getBeforeCompletionMethod();
        if (beforeCompletionMethod != null) {
            methodNode.writeJavaMethodDescriptor(ejbNode, EjbTagNames.BEFORE_COMPLETION_METHOD,
                    beforeCompletionMethod);
        }

        MethodDescriptor afterCompletionMethod = ejbDesc.getAfterCompletionMethod();
        if (afterCompletionMethod != null) {
            methodNode.writeJavaMethodDescriptor(ejbNode, EjbTagNames.AFTER_COMPLETION_METHOD,
                    afterCompletionMethod);
        }


        //around-invoke-method
View Full Code Here

    }

    @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;
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.node.MethodNode

Copyright © 2018 www.massapicom. 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.