Search in sources :

Example 6 with InjectionTarget

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

the class EjbReferenceNode method writeDescriptor.

@Override
public Node writeDescriptor(Node parent, String nodeName, EjbReference descriptor) {
    Node ejbRefNode = appendChild(parent, nodeName);
    if (descriptor instanceof Descriptor) {
        Descriptor ejbRefDesc = (Descriptor) descriptor;
        writeLocalizedDescriptions(ejbRefNode, ejbRefDesc);
    }
    appendTextChild(ejbRefNode, TagNames.EJB_REFERENCE_NAME, descriptor.getName());
    appendTextChild(ejbRefNode, TagNames.EJB_REFERENCE_TYPE, descriptor.getType());
    if (descriptor.isLocal()) {
        appendTextChild(ejbRefNode, TagNames.LOCAL_HOME, descriptor.getEjbHomeInterface());
        appendTextChild(ejbRefNode, TagNames.LOCAL, descriptor.getEjbInterface());
    } else {
        appendTextChild(ejbRefNode, TagNames.HOME, descriptor.getEjbHomeInterface());
        appendTextChild(ejbRefNode, TagNames.REMOTE, descriptor.getEjbInterface());
    }
    appendTextChild(ejbRefNode, TagNames.EJB_LINK, descriptor.getLinkName());
    if (descriptor instanceof EnvironmentProperty) {
        EnvironmentProperty envProp = (EnvironmentProperty) descriptor;
        appendTextChild(ejbRefNode, TagNames.MAPPED_NAME, envProp.getMappedName());
    }
    if (descriptor.isInjectable()) {
        InjectionTargetNode ijNode = new InjectionTargetNode();
        for (InjectionTarget target : descriptor.getInjectionTargets()) {
            ijNode.writeDescriptor(ejbRefNode, TagNames.INJECTION_TARGET, target);
        }
    }
    if (descriptor.hasLookupName()) {
        appendTextChild(ejbRefNode, TagNames.LOOKUP_NAME, descriptor.getLookupName());
    }
    return ejbRefNode;
}
Also used : Node(org.w3c.dom.Node) EnvironmentProperty(com.sun.enterprise.deployment.EnvironmentProperty) EjbReferenceDescriptor(com.sun.enterprise.deployment.EjbReferenceDescriptor) Descriptor(org.glassfish.deployment.common.Descriptor) InjectionTarget(com.sun.enterprise.deployment.InjectionTarget)

Example 7 with InjectionTarget

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

the class EntityManagerFactoryReferenceNode method writeDescriptor.

/**
 * write the descriptor class to a DOM tree and return it
 *
 * @param parent node in the DOM tree
 * @param node name for the root element of this xml fragment
 * @param the descriptor to write
 * @return the DOM tree top node
 */
public Node writeDescriptor(Node parent, String nodeName, EntityManagerFactoryReferenceDescriptor descriptor) {
    Node entityMgrFactoryRefNode = appendChild(parent, nodeName);
    writeLocalizedDescriptions(entityMgrFactoryRefNode, descriptor);
    appendTextChild(entityMgrFactoryRefNode, TagNames.PERSISTENCE_UNIT_REF_NAME, descriptor.getName());
    appendTextChild(entityMgrFactoryRefNode, TagNames.PERSISTENCE_UNIT_NAME, descriptor.getUnitName());
    if (descriptor.isInjectable()) {
        InjectionTargetNode ijNode = new InjectionTargetNode();
        for (InjectionTarget target : descriptor.getInjectionTargets()) {
            ijNode.writeDescriptor(entityMgrFactoryRefNode, TagNames.INJECTION_TARGET, target);
        }
    }
    return entityMgrFactoryRefNode;
}
Also used : Node(org.w3c.dom.Node) InjectionTarget(com.sun.enterprise.deployment.InjectionTarget)

Example 8 with InjectionTarget

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

the class EntityManagerReferenceNode method writeDescriptor.

/**
 * write the descriptor class to a DOM tree and return it
 *
 * @param parent node in the DOM tree
 * @param nodeName name for the root element of this xml fragment
 * @param descriptor descriptor to write
 * @return the DOM tree top node
 */
public Node writeDescriptor(Node parent, String nodeName, EntityManagerReferenceDescriptor descriptor) {
    Node entityMgrRefNode = appendChild(parent, nodeName);
    writeLocalizedDescriptions(entityMgrRefNode, descriptor);
    appendTextChild(entityMgrRefNode, TagNames.PERSISTENCE_CONTEXT_REF_NAME, descriptor.getName());
    appendTextChild(entityMgrRefNode, TagNames.PERSISTENCE_UNIT_NAME, descriptor.getUnitName());
    PersistenceContextType contextType = descriptor.getPersistenceContextType();
    String contextTypeString = (contextType != null && PersistenceContextType.EXTENDED.equals(contextType)) ? EXTENDED : TRANSACTION;
    appendTextChild(entityMgrRefNode, TagNames.PERSISTENCE_CONTEXT_TYPE, contextTypeString);
    for (Map.Entry<String, String> property : descriptor.getProperties().entrySet()) {
        Node propertyNode = appendChild(entityMgrRefNode, TagNames.PERSISTENCE_PROPERTY);
        appendTextChild(propertyNode, TagNames.NAME_VALUE_PAIR_NAME, property.getKey());
        appendTextChild(propertyNode, TagNames.NAME_VALUE_PAIR_VALUE, property.getValue());
    }
    if (descriptor.isInjectable()) {
        InjectionTargetNode ijNode = new InjectionTargetNode();
        for (InjectionTarget target : descriptor.getInjectionTargets()) {
            ijNode.writeDescriptor(entityMgrRefNode, TagNames.INJECTION_TARGET, target);
        }
    }
    return entityMgrRefNode;
}
Also used : Node(org.w3c.dom.Node) PersistenceContextType(javax.persistence.PersistenceContextType) InjectionTarget(com.sun.enterprise.deployment.InjectionTarget) Map(java.util.Map)

Example 9 with InjectionTarget

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

the class EnvEntryNode method writeDescriptor.

@Override
public Node writeDescriptor(Node parent, String nodeName, EnvironmentProperty envProp) {
    Node envEntryNode = super.writeDescriptor(parent, nodeName, envProp);
    writeLocalizedDescriptions(envEntryNode, envProp);
    appendTextChild(envEntryNode, TagNames.ENVIRONMENT_PROPERTY_NAME, envProp.getName());
    appendTextChild(envEntryNode, TagNames.ENVIRONMENT_PROPERTY_TYPE, envProp.getType());
    appendTextChild(envEntryNode, TagNames.ENVIRONMENT_PROPERTY_VALUE, envProp.getValue());
    appendTextChild(envEntryNode, TagNames.MAPPED_NAME, envProp.getMappedName());
    if (envProp.isInjectable()) {
        InjectionTargetNode ijNode = new InjectionTargetNode();
        for (InjectionTarget target : envProp.getInjectionTargets()) {
            ijNode.writeDescriptor(envEntryNode, TagNames.INJECTION_TARGET, target);
        }
    }
    appendTextChild(envEntryNode, TagNames.LOOKUP_NAME, envProp.getLookupName());
    return envEntryNode;
}
Also used : Node(org.w3c.dom.Node) InjectionTarget(com.sun.enterprise.deployment.InjectionTarget)

Example 10 with InjectionTarget

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

the class ResourceRefNode method writeDescriptor.

@Override
public Node writeDescriptor(Node parent, String nodeName, ResourceReferenceDescriptor descriptor) {
    Node ejbResNode = appendChild(parent, nodeName);
    writeLocalizedDescriptions(ejbResNode, descriptor);
    appendTextChild(ejbResNode, TagNames.RESOURCE_REFERENCE_NAME, descriptor.getName());
    appendTextChild(ejbResNode, TagNames.RESOURCE_TYPE, descriptor.getType());
    appendTextChild(ejbResNode, TagNames.RESOURCE_AUTHORIZATION, descriptor.getAuthorization());
    appendTextChild(ejbResNode, TagNames.RESOURCE_SHARING_SCOPE, descriptor.getSharingScope());
    appendTextChild(ejbResNode, TagNames.MAPPED_NAME, descriptor.getMappedName());
    if (descriptor.isInjectable()) {
        InjectionTargetNode ijNode = new InjectionTargetNode();
        for (InjectionTarget target : descriptor.getInjectionTargets()) {
            ijNode.writeDescriptor(ejbResNode, TagNames.INJECTION_TARGET, target);
        }
    }
    appendTextChild(ejbResNode, TagNames.LOOKUP_NAME, descriptor.getLookupName());
    return ejbResNode;
}
Also used : Node(org.w3c.dom.Node) InjectionTarget(com.sun.enterprise.deployment.InjectionTarget)

Aggregations

InjectionTarget (com.sun.enterprise.deployment.InjectionTarget)24 Node (org.w3c.dom.Node)8 Field (java.lang.reflect.Field)6 Method (java.lang.reflect.Method)6 EntityManagerReferenceDescriptor (com.sun.enterprise.deployment.EntityManagerReferenceDescriptor)3 InjectionException (com.sun.enterprise.container.common.spi.util.InjectionException)2 EjbReferenceDescriptor (com.sun.enterprise.deployment.EjbReferenceDescriptor)2 EntityManagerFactoryReferenceDescriptor (com.sun.enterprise.deployment.EntityManagerFactoryReferenceDescriptor)2 InjectionCapable (com.sun.enterprise.deployment.InjectionCapable)2 ResourceReferenceDescriptor (com.sun.enterprise.deployment.ResourceReferenceDescriptor)2 EjbReference (com.sun.enterprise.deployment.types.EjbReference)2 Result (com.sun.enterprise.tools.verifier.Result)2 InjectionManager (com.sun.enterprise.container.common.spi.util.InjectionManager)1 EjbDescriptor (com.sun.enterprise.deployment.EjbDescriptor)1 EjbSessionDescriptor (com.sun.enterprise.deployment.EjbSessionDescriptor)1 EnvironmentProperty (com.sun.enterprise.deployment.EnvironmentProperty)1 MessageDestinationReferenceDescriptor (com.sun.enterprise.deployment.MessageDestinationReferenceDescriptor)1 ResourceEnvReferenceDescriptor (com.sun.enterprise.deployment.ResourceEnvReferenceDescriptor)1 ServiceRefPortInfo (com.sun.enterprise.deployment.ServiceRefPortInfo)1 ServiceReferenceDescriptor (com.sun.enterprise.deployment.ServiceReferenceDescriptor)1