EjbNodepublic abstract class EjbNode extends com.sun.enterprise.deployment.node.DisplayableComponentNode This class is responsible for handling all common information
shared by all types of entreprise beans (MDB, session, entity) |
Constructors Summary |
---|
public EjbNode()Creates new EjbNode
super();
registerElementHandler(new XMLElement(TagNames.ENVIRONMENT_PROPERTY),
EnvEntryNode.class, "addEnvironmentProperty");
registerElementHandler(new XMLElement(EjbTagNames.EJB_REFERENCE), EjbReferenceNode.class);
registerElementHandler(new XMLElement(EjbTagNames.EJB_LOCAL_REFERENCE), EjbLocalReferenceNode.class);
registerElementHandler(new XMLElement(WebServicesTagNames.SERVICE_REF), ServiceReferenceNode.class, "addServiceReferenceDescriptor");
registerElementHandler(new XMLElement(EjbTagNames.RESOURCE_REFERENCE),
ResourceRefNode.class, "addResourceReferenceDescriptor");
registerElementHandler(new XMLElement(EjbTagNames.SECURITY_IDENTITY),
SecurityIdentityNode.class);
registerElementHandler(new XMLElement(TagNames.RESOURCE_ENV_REFERENCE),
ResourceEnvRefNode.class, "addJmsDestinationReferenceDescriptor");
registerElementHandler(new XMLElement(TagNames.MESSAGE_DESTINATION_REFERENCE), MessageDestinationRefNode.class);
registerElementHandler(new XMLElement(TagNames.PERSISTENCE_CONTEXT_REF), EntityManagerReferenceNode.class, "addEntityManagerReferenceDescriptor");
registerElementHandler(new XMLElement(TagNames.PERSISTENCE_UNIT_REF), EntityManagerFactoryReferenceNode.class, "addEntityManagerFactoryReferenceDescriptor");
|
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 EjbReference) {
if (DOLUtils.getDefaultLogger().isLoggable(Level.FINE)) {
DOLUtils.getDefaultLogger().fine("Adding ejb ref " + newDescriptor);
}
getEjbDescriptor().addEjbReferenceDescriptor(
(EjbReference) newDescriptor);
} else if (newDescriptor instanceof RunAsIdentityDescriptor) {
if (DOLUtils.getDefaultLogger().isLoggable(Level.FINE)) {
DOLUtils.getDefaultLogger().fine("Adding security-identity" + newDescriptor);
}
getEjbDescriptor().setUsesCallerIdentity(false);
getEjbDescriptor().setRunAsIdentity((RunAsIdentityDescriptor) newDescriptor);
} else if( newDescriptor instanceof
MessageDestinationReferenceDescriptor ) {
MessageDestinationReferenceDescriptor msgDestRef =
(MessageDestinationReferenceDescriptor) newDescriptor;
EjbBundleDescriptor ejbBundle = (EjbBundleDescriptor)
getParentNode().getDescriptor();
// EjbBundle might not be set yet on EjbDescriptor, so set it
// explicitly here.
msgDestRef.setReferringBundleDescriptor(ejbBundle);
getEjbDescriptor().addMessageDestinationReferenceDescriptor
(msgDestRef);
} else {
super.addDescriptor(newDescriptor);
}
| public java.lang.Object | getDescriptor()
return getEjbDescriptor();
| 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_NAME, "setName");
table.put(EjbTagNames.EJB_CLASS, "setEjbClassName");
table.put(TagNames.MAPPED_NAME, "setMappedName");
return table;
| public abstract com.sun.enterprise.deployment.EjbDescriptor | getEjbDescriptor()
| protected void | writeCommonHeaderEjbDescriptor(org.w3c.dom.Node ejbNode, com.sun.enterprise.deployment.Descriptor descriptor)write the common descriptor info to a DOM tree and return it
EjbDescriptor ejbDescriptor = (EjbDescriptor)descriptor;
appendTextChild(ejbNode, EjbTagNames.EJB_NAME, descriptor.getName());
appendTextChild(ejbNode, TagNames.MAPPED_NAME, ejbDescriptor.getMappedName());
| protected void | writeSecurityIdentityDescriptor(org.w3c.dom.Node parent, com.sun.enterprise.deployment.EjbDescriptor descriptor)write the security identity information about an EJB
if (!descriptor.getUsesCallerIdentity() && descriptor.getRunAsIdentity()==null)
return;
SecurityIdentityNode node = new SecurityIdentityNode();
node.writeDescriptor(parent, EjbTagNames.SECURITY_IDENTITY, descriptor);
|
|