EjbRelationNodepublic class EjbRelationNode extends com.sun.enterprise.deployment.node.DeploymentDescriptorNode
Fields Summary |
---|
com.sun.enterprise.deployment.RelationRoleDescriptor | source | com.sun.enterprise.deployment.RelationRoleDescriptor | sink | com.sun.enterprise.deployment.RelationshipDescriptor | descriptor |
Constructors Summary |
---|
public EjbRelationNode()
super();
registerElementHandler(new XMLElement(EjbTagNames.EJB_RELATIONSHIP_ROLE),
EjbRelationshipRoleNode.class);
|
Methods Summary |
---|
public void | addDescriptor(java.lang.Object newDescriptor)Adds a new DOL descriptor instance to the descriptor instance associated with
this XMLNode
if (newDescriptor instanceof RelationRoleDescriptor) {
if (source==null) {
source = (RelationRoleDescriptor) newDescriptor;
} else {
sink = (RelationRoleDescriptor) newDescriptor;
descriptor.setSource(source);
source.setPartner(sink);
source.setRelationshipDescriptor(descriptor);
descriptor.setSink(sink);
sink.setPartner(source);
sink.setRelationshipDescriptor(descriptor);
if ( source.getCMRField() != null && sink.getCMRField() != null )
descriptor.setIsBidirectional(true);
else
descriptor.setIsBidirectional(false);
}
}
| public java.lang.Object | getDescriptor()
if (descriptor==null) {
descriptor = (RelationshipDescriptor) DescriptorFactory.getDescriptor(getXMLPath());
}
return descriptor;
| protected java.util.Map | getDispatchTable()all sub-implementation of this class can use a dispatch table to map xml element to
method name on the descriptor class for setting the element value.
// no need to be synchronized for now
Map table = super.getDispatchTable();
table.put(EjbTagNames.EJB_RELATION_NAME, "setName");
return table;
| public org.w3c.dom.Node | writeDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.RelationshipDescriptor descriptor)write the relationships descriptor class to a DOM tree and return it
Node ejbRelationNode = super.writeDescriptor(parent, nodeName, descriptor);
writeLocalizedDescriptions(ejbRelationNode, descriptor);
appendTextChild(ejbRelationNode, EjbTagNames.EJB_RELATION_NAME, descriptor.getName());
EjbRelationshipRoleNode roleNode = new EjbRelationshipRoleNode();
roleNode.writeDescriptor(ejbRelationNode, EjbTagNames.EJB_RELATIONSHIP_ROLE, descriptor.getSource());
roleNode.writeDescriptor(ejbRelationNode, EjbTagNames.EJB_RELATIONSHIP_ROLE, descriptor.getSink());
return ejbRelationNode;
|
|