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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations