Search in sources :

Example 1 with EjbReferenceContainer

use of com.sun.enterprise.deployment.types.EjbReferenceContainer in project Payara by payara.

the class EjbReferenceDescriptionNode method writeDescriptors.

/**
 * write all occurrences of the descriptor corresponding to the current
 * node from the parent descriptor to an JAXP DOM node and return it
 *
 * This API will be invoked by the parent node when the parent node
 * writes out a mix of statically and dynamically registered sub nodes.
 *
 * This method should be overriden by the sub classes if it
 * needs to be called by the parent node.
 *
 * @param parent node in the DOM tree
 * @param nodeName the name of the node
 * @param parentDesc parent descriptor of the descriptor to be written
 * @return the JAXP DOM node
 */
@Override
public Node writeDescriptors(Node parent, String nodeName, Descriptor parentDesc) {
    if (parentDesc instanceof EjbReferenceContainer) {
        EjbReferenceContainer ejbReferenceContainer = (EjbReferenceContainer) parentDesc;
        // ejb-reference-description*
        Set<EjbReference> ejbReferences = ejbReferenceContainer.getEjbReferenceDescriptors();
        for (EjbReference ejbReference : ejbReferences) {
            writeDescriptor(parent, nodeName, ejbReference);
        }
    }
    return parent;
}
Also used : EjbReference(com.sun.enterprise.deployment.types.EjbReference) EjbReferenceContainer(com.sun.enterprise.deployment.types.EjbReferenceContainer)

Example 2 with EjbReferenceContainer

use of com.sun.enterprise.deployment.types.EjbReferenceContainer in project Payara by payara.

the class EjbReferenceDescriptionNode method setElementValue.

/**
 * receives notiification of the value for a particular tag
 *
 * @param element the xml element
 * @param value it's associated value
 */
@Override
public void setElementValue(XMLElement element, String value) {
    if (RuntimeTagNames.EJB_REFERENCE_NAME.equals(element.getQName())) {
        Object parentDesc = getParentNode().getDescriptor();
        Logger logger = DOLUtils.getDefaultLogger();
        if (parentDesc instanceof EjbReferenceContainer) {
            try {
                descriptor = ((EjbReferenceContainer) parentDesc).getEjbReference(value);
                if (logger.isLoggable(Level.FINER)) {
                    logger.finer("Applying ref runtime to " + descriptor);
                }
            } catch (IllegalArgumentException iae) {
                logger.warning(iae.getMessage());
            }
        }
        if (descriptor == null) {
            logger.log(Level.SEVERE, "enterprise.deployment.backend.addDescriptorFailure", new Object[] { "ejb-ref", value });
        }
    } else {
        super.setElementValue(element, value);
    }
}
Also used : Logger(java.util.logging.Logger) EjbReferenceContainer(com.sun.enterprise.deployment.types.EjbReferenceContainer)

Aggregations

EjbReferenceContainer (com.sun.enterprise.deployment.types.EjbReferenceContainer)2 EjbReference (com.sun.enterprise.deployment.types.EjbReference)1 Logger (java.util.logging.Logger)1