Search in sources :

Example 6 with ResourceEnvReferenceDescriptor

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

the class EjbDescriptor method addResourceEnvReferenceDescriptor.

@Override
public final void addResourceEnvReferenceDescriptor(ResourceEnvReferenceDescriptor resourceEnvReference) {
    try {
        ResourceEnvReferenceDescriptor existing = getResourceEnvReferenceByName(resourceEnvReference.getName());
        for (InjectionTarget next : resourceEnvReference.getInjectionTargets()) {
            existing.addInjectionTarget(next);
        }
    } catch (IllegalArgumentException e) {
        if (env != null)
            env.addResourceEnvReferenceDescriptor(resourceEnvReference);
        else
            resourceEnvReferences.add(resourceEnvReference);
    }
}
Also used : ResourceEnvReferenceDescriptor(com.sun.enterprise.deployment.ResourceEnvReferenceDescriptor) InjectionTarget(com.sun.enterprise.deployment.InjectionTarget)

Example 7 with ResourceEnvReferenceDescriptor

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

the class ResourceEnvDescriptionNode 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 ResourceEnvReferenceContainer) {
        ResourceEnvReferenceContainer resourceEnvReferenceContainer = (ResourceEnvReferenceContainer) parentDesc;
        // resource-env-description*
        Set<ResourceEnvReferenceDescriptor> resourceEnvReferenceDescriptors = resourceEnvReferenceContainer.getResourceEnvReferenceDescriptors();
        for (ResourceEnvReferenceDescriptor resourceEnvReferenceDescriptor : resourceEnvReferenceDescriptors) {
            writeDescriptor(parent, nodeName, resourceEnvReferenceDescriptor);
        }
    }
    return parent;
}
Also used : ResourceEnvReferenceDescriptor(com.sun.enterprise.deployment.ResourceEnvReferenceDescriptor) ResourceEnvReferenceContainer(com.sun.enterprise.deployment.types.ResourceEnvReferenceContainer)

Example 8 with ResourceEnvReferenceDescriptor

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

the class WebBundleDescriptorImpl method combineResourceEnvReferenceDescriptors.

@Override
protected void combineResourceEnvReferenceDescriptors(JndiNameEnvironment env) {
    for (Object ojdRef : env.getResourceEnvReferenceDescriptors()) {
        ResourceEnvReferenceDescriptor jdRef = (ResourceEnvReferenceDescriptor) ojdRef;
        ResourceEnvReferenceDescriptor jdr = _getResourceEnvReferenceByName(jdRef.getName());
        if (jdr != null) {
            combineInjectionTargets(jdr, jdRef);
        } else {
            if (env instanceof WebBundleDescriptor && ((WebBundleDescriptor) env).isConflictResourceEnvReference()) {
                throw new IllegalArgumentException(localStrings.getLocalString("web.deployment.exceptionconflictresourceenvref", "There are more than one resource env references defined in web fragments with the same name, but not overrided in web.xml"));
            } else {
                addResourceEnvReferenceDescriptor(jdRef);
            }
        }
    }
}
Also used : WebBundleDescriptor(com.sun.enterprise.deployment.WebBundleDescriptor) ResourceEnvReferenceDescriptor(com.sun.enterprise.deployment.ResourceEnvReferenceDescriptor)

Aggregations

ResourceEnvReferenceDescriptor (com.sun.enterprise.deployment.ResourceEnvReferenceDescriptor)8 ResourceReferenceDescriptor (com.sun.enterprise.deployment.ResourceReferenceDescriptor)5 EjbReference (com.sun.enterprise.deployment.types.EjbReference)4 Iterator (java.util.Iterator)3 Set (java.util.Set)3 MethodDescriptor (com.sun.enterprise.deployment.MethodDescriptor)2 ServiceReferenceDescriptor (com.sun.enterprise.deployment.ServiceReferenceDescriptor)2 MessageDestinationReferencer (com.sun.enterprise.deployment.types.MessageDestinationReferencer)2 EjbCMPEntityDescriptor (org.glassfish.ejb.deployment.descriptor.EjbCMPEntityDescriptor)2 PersistenceDescriptor (org.glassfish.ejb.deployment.descriptor.PersistenceDescriptor)2 EnvironmentProperty (com.sun.enterprise.deployment.EnvironmentProperty)1 InjectionCapable (com.sun.enterprise.deployment.InjectionCapable)1 InjectionTarget (com.sun.enterprise.deployment.InjectionTarget)1 MethodPermission (com.sun.enterprise.deployment.MethodPermission)1 RoleReference (com.sun.enterprise.deployment.RoleReference)1 WebBundleDescriptor (com.sun.enterprise.deployment.WebBundleDescriptor)1 WebComponentDescriptor (com.sun.enterprise.deployment.WebComponentDescriptor)1 XMLElement (com.sun.enterprise.deployment.node.XMLElement)1 EjbRefNode (com.sun.enterprise.deployment.node.runtime.EjbRefNode)1 MessageDestinationRefNode (com.sun.enterprise.deployment.node.runtime.MessageDestinationRefNode)1