MethodPermissionNodepublic class MethodPermissionNode extends com.sun.enterprise.deployment.node.DeploymentDescriptorNode This class handles all the method-permission xml tag
information |
Fields Summary |
---|
private com.sun.enterprise.deployment.MethodPermissionDescriptor | descriptor |
Constructors Summary |
---|
public MethodPermissionNode()Creates new MethodPermissionNode
super();
registerElementHandler(new XMLElement(EjbTagNames.METHOD),
MethodNode.class, "addMethod");
|
Methods Summary |
---|
public java.lang.Object | getDescriptor()
if (descriptor==null) {
descriptor = (MethodPermissionDescriptor) DescriptorFactory.getDescriptor(getXMLPath());
}
return descriptor;
| public void | setElementValue(com.sun.enterprise.deployment.node.XMLElement element, java.lang.String value)receives notiification of the value for a particular tag
if (EjbTagNames.ROLE_NAME.equals(element.getQName())) {
Role role = new Role(value);
descriptor.addMethodPermission(new MethodPermission(role));
} else {
super.setElementValue(element, value);
}
| public void | startElement(com.sun.enterprise.deployment.node.XMLElement element, org.xml.sax.Attributes attributes)SAX Parser API implementation, we don't really care for now.
if (EjbTagNames.UNCHECKED.equals(element.getQName())) {
descriptor.addMethodPermission(MethodPermission.getUncheckedMethodPermission());
} else
super.startElement(element, attributes);
| public org.w3c.dom.Node | writeDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.MethodPermissionDescriptor descriptor, com.sun.enterprise.deployment.EjbDescriptor ejb)write the descriptor class to a DOM tree and return it
Node subNode = super.writeDescriptor(parent, nodeName, descriptor);
return writeDescriptorInNode(subNode, descriptor, ejb);
| public org.w3c.dom.Node | writeDescriptorInNode(org.w3c.dom.Node subNode, com.sun.enterprise.deployment.MethodPermissionDescriptor descriptor, com.sun.enterprise.deployment.EjbDescriptor ejb)Write the descriptor in a DOM tree which root element is provided
writeLocalizedDescriptions(subNode, descriptor);
MethodPermission[] mps = descriptor.getMethodPermissions();
if (mps.length==0)
return null;
if (!mps[0].isExcluded()) {
if (mps[0].isUnchecked()) {
appendChild(subNode, EjbTagNames.UNCHECKED);
} else {
for (int i=0;i<mps.length;i++) {
appendTextChild(subNode, EjbTagNames.ROLE_NAME, mps[i].getRole().getName());
}
}
}
MethodDescriptor[] methods = descriptor.getMethods();
MethodNode mn = new MethodNode();
for (int i=0;i<methods.length;i++) {
String ejbName = ejb.getName();
mn.writeDescriptor(subNode, EjbTagNames.METHOD, methods[i], ejbName);
}
return subNode;
|
|