/** * writes all the runtime information for JMS destination references * * @param parent node to add the runtime xml info * @param the J2EE component containing message destination references */ public static void writeMessageDestinationReferences(Node parent, MessageDestinationReferenceContainer descriptor) { // message-destination-ref* Iterator msgDestRefs = descriptor.getMessageDestinationReferenceDescriptors().iterator(); if (msgDestRefs.hasNext()) { MessageDestinationRefNode messageDestinationRefNode = new MessageDestinationRefNode(); while (msgDestRefs.hasNext()) { messageDestinationRefNode.writeDescriptor(parent, RuntimeTagNames.MESSAGE_DESTINATION_REFERENCE, (MessageDestinationReferenceDescriptor) msgDestRefs.next()); } } } }
@Override public Node writeDescriptor(Node parent, String nodeName, MessageDestinationReferenceDescriptor msgDestRef) { Node msgDestRefNode = super.writeDescriptor(parent, nodeName, msgDestRef); appendTextChild(msgDestRefNode, RuntimeTagNames.MESSAGE_DESTINATION_REFERENCE_NAME, msgDestRef.getName()); appendTextChild(msgDestRefNode, RuntimeTagNames.JNDI_NAME, msgDestRef.getJndiName()); return msgDestRefNode; }
/** * writes all information common to all J2EE components * * @param parent xml node parent to add the info to * @param descriptor the descriptor */ public static void writeCommonComponentInfo(Node parent, Descriptor descriptor) { if (descriptor instanceof EjbReferenceContainer) { EjbRefNode.writeEjbReferences(parent, (EjbReferenceContainer) descriptor); } if (descriptor instanceof ResourceReferenceContainer) { ResourceRefNode.writeResourceReferences(parent, (ResourceReferenceContainer) descriptor); } if (descriptor instanceof ResourceEnvReferenceContainer) { ResourceEnvRefNode.writeResoureEnvReferences(parent, (ResourceEnvReferenceContainer) descriptor); } if( descriptor instanceof JndiNameEnvironment ) { ServiceRefNode.writeServiceReferences (parent, (JndiNameEnvironment) descriptor); } if (descriptor instanceof MessageDestinationReferenceContainer) { MessageDestinationRefNode.writeMessageDestinationReferences(parent, (MessageDestinationReferenceContainer) descriptor); } }
@Override public void setElementValue(XMLElement element, String value) { if (TagNames.MESSAGE_DESTINATION_REFERENCE_NAME.equals(element.getQName())) { XMLNode parentNode = getParentNode(); Object parentDesc = null; // in case of web if (parentNode.getDescriptor() instanceof WebBundleDescriptor) { parentDesc = parentNode.getDescriptor(); // in case of appclient and ejb } else { parentDesc = getParentNode().getDescriptor(); } if (parentDesc instanceof MessageDestinationReferenceContainer) { try { descriptor = ((MessageDestinationReferenceContainer) parentDesc).getMessageDestinationReferenceByName(value); } catch (IllegalArgumentException iae) { DOLUtils.getDefaultLogger().warning(iae.getMessage()); } } } else super.setElementValue(element, value); }
/** * writes all information common to all J2EE components * * @param xml node parent to add the info to * @param the descriptor */ public static void writeCommonComponentInfo(Node parent, Descriptor descriptor) { if (descriptor instanceof EjbReferenceContainer) { EjbRefNode.writeEjbReferences(parent, (EjbReferenceContainer) descriptor); } if (descriptor instanceof ResourceReferenceContainer) { ResourceRefNode.writeResourceReferences(parent, (ResourceReferenceContainer) descriptor); } if (descriptor instanceof ResourceEnvReferenceContainer) { ResourceEnvRefNode.writeResoureEnvReferences(parent, (ResourceEnvReferenceContainer) descriptor); } if( descriptor instanceof JndiNameEnvironment ) { ServiceRefNode.writeServiceReferences (parent, (JndiNameEnvironment) descriptor); } if (descriptor instanceof MessageDestinationReferenceContainer) { MessageDestinationRefNode.writeMessageDestinationReferences(parent, (MessageDestinationReferenceContainer) descriptor); } }
/** * receives notiification of the value for a particular tag * * @param element the xml element * @param value it's associated value */ public void setElementValue(XMLElement element, String value) { if (RuntimeTagNames.MESSAGE_DESTINATION_REFERENCE_NAME.equals( element.getQName())) { Object parentNode = getParentNode(); Object parentDesc = null; // in case of web if (parentNode instanceof WebBundleRuntimeNode) { parentDesc = ((WebBundleRuntimeNode) parentNode).getWebBundleDescriptor(); // in case of appclient and ejb } else { parentDesc = getParentNode().getDescriptor(); } if (parentDesc instanceof MessageDestinationReferenceContainer) { try { descriptor = ((MessageDestinationReferenceContainer) parentDesc).getMessageDestinationReferenceByName(value); } catch (IllegalArgumentException iae) { DOLUtils.getDefaultLogger().warning(iae.getMessage()); } } } else super.setElementValue(element, value); }
/** * writes all the runtime information for JMS destination references * * @param parent node to add the runtime xml info * @param the J2EE component containing message destination references */ public static void writeMessageDestinationReferences(Node parent, MessageDestinationReferenceContainer descriptor) { // message-destination-ref* Iterator msgDestRefs = descriptor.getMessageDestinationReferenceDescriptors().iterator(); if (msgDestRefs.hasNext()) { MessageDestinationRefNode messageDestinationRefNode = new MessageDestinationRefNode(); while (msgDestRefs.hasNext()) { messageDestinationRefNode.writeDescriptor(parent, TagNames.MESSAGE_DESTINATION_REFERENCE, (MessageDestinationReferenceDescriptor) msgDestRefs.next()); } } } }
MessageDestinationRefNode.writeMessageDestinationReferences(web, bundleDescriptor);
/** * write the descriptor class to a DOM tree and return it * * @param parent node for the DOM tree * @param node name for the descriptor * @param the descriptor to write * @return the DOM tree top node */ public Node writeDescriptor(Node parent, String nodeName, MessageDestinationReferenceDescriptor msgDestRef) { Node msgDestRefNode = super.writeDescriptor(parent, nodeName, msgDestRef); appendTextChild(msgDestRefNode, RuntimeTagNames.MESSAGE_DESTINATION_REFERENCE_NAME, msgDestRef.getName()); appendTextChild(msgDestRefNode, RuntimeTagNames.JNDI_NAME, msgDestRef.getJndiName()); return msgDestRefNode; }