EjbRefNodepublic class EjbRefNode extends com.sun.enterprise.deployment.node.DeploymentDescriptorNode This node class is responsible for handling runtime deployment descriptors
for ejb-ref |
Fields Summary |
---|
com.sun.enterprise.deployment.types.EjbReference | descriptor |
Methods Summary |
---|
public java.lang.Object | getDescriptor()
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.
Map table = super.getDispatchTable();
table.put(RuntimeTagNames.JNDI_NAME, "setJndiName");
return table;
| public void | setElementValue(com.sun.enterprise.deployment.node.XMLElement element, java.lang.String value)receives notiification of the value for a particular tag
if (RuntimeTagNames.EJB_REFERENCE_NAME.equals(element.getQName())) {
Object parentDesc = getParentNode().getDescriptor();
if (parentDesc instanceof EjbReferenceContainer) {
try {
descriptor = ((EjbReferenceContainer) parentDesc).getEjbReference(value);
DOLUtils.getDefaultLogger().finer("Applying ref runtime to " + descriptor);
} catch (IllegalArgumentException iae) {
DOLUtils.getDefaultLogger().warning(iae.getMessage());
}
}
if (descriptor==null) {
DOLUtils.getDefaultLogger().log(Level.SEVERE, "enterprise.deployment.backend.addDescriptorFailure",
new Object[]{"ejb-ref" , value });
}
} else super.setElementValue(element, value);
| public org.w3c.dom.Node | writeDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.types.EjbReference ejbRef)write the descriptor class to a DOM tree and return it
Node ejbRefNode = appendChild(parent, nodeName);
appendTextChild(ejbRefNode, RuntimeTagNames.EJB_REFERENCE_NAME, ejbRef.getName());
appendTextChild(ejbRefNode, RuntimeTagNames.JNDI_NAME, ejbRef.getJndiName());
return ejbRefNode;
| public static void | writeEjbReferences(org.w3c.dom.Node parent, com.sun.enterprise.deployment.types.EjbReferenceContainer descriptor)writes all the runtime information for ejb references
// ejb-ref*
Iterator ejbRefs = descriptor.getEjbReferenceDescriptors().iterator();
if (ejbRefs.hasNext()) {
EjbRefNode refNode = new EjbRefNode();
while (ejbRefs.hasNext()) {
EjbReference ejbRef = (EjbReference) ejbRefs.next();
if (!ejbRef.isLocal()) {
refNode.writeDescriptor(parent, RuntimeTagNames.EJB_REFERENCE, ejbRef );
}
}
}
|
|