AdministeredObjectDefinitionNode administeredObjectDefinitionNode = new AdministeredObjectDefinitionNode();
JMSConnectionFactoryDefinitionNode jmsConnectionFactoryDefinitionNode = new JMSConnectionFactoryDefinitionNode();
JMSDestinationDefinitionNode jmsDestinationDefinitionNode = new JMSDestinationDefinitionNode();
for(;descriptorIterator.hasNext();){
Descriptor descriptor = descriptorIterator.next();
if(descriptor.getResourceType().equals(JavaEEResourceType.DSD)) {
DataSourceDefinitionDescriptor next = (DataSourceDefinitionDescriptor)descriptor;
dataSourceDefinitionNode.writeDescriptor(parentNode, TagNames.DATA_SOURCE, next);
} else if(descriptor.getResourceType().equals(JavaEEResourceType.MSD)) {
MailSessionDescriptor next = (MailSessionDescriptor)descriptor;
mailSessionNode.writeDescriptor(parentNode, TagNames.MAIL_SESSION, next);
} else if(descriptor.getResourceType().equals(JavaEEResourceType.CRD)) {
ConnectorResourceDefinitionDescriptor next = (ConnectorResourceDefinitionDescriptor)descriptor;
connectorResourceDefinitionNode.writeDescriptor(parentNode, TagNames.CONNECTOR_RESOURCE, next);
} else if(descriptor.getResourceType().equals(JavaEEResourceType.AODD)) {
AdministeredObjectDefinitionDescriptor next = (AdministeredObjectDefinitionDescriptor)descriptor;
administeredObjectDefinitionNode.writeDescriptor(parentNode, TagNames.ADMINISTERED_OBJECT, next);
} else if(descriptor.getResourceType().equals(JavaEEResourceType.JMSCFDD)) {
JMSConnectionFactoryDefinitionDescriptor next = (JMSConnectionFactoryDefinitionDescriptor)descriptor;
jmsConnectionFactoryDefinitionNode.writeDescriptor(parentNode, TagNames.JMS_CONNECTION_FACTORY, next);
} else if(descriptor.getResourceType().equals(JavaEEResourceType.JMSDD)) {
JMSDestinationDefinitionDescriptor next = (JMSDestinationDefinitionDescriptor)descriptor;
jmsDestinationDefinitionNode.writeDescriptor(parentNode, TagNames.JMS_DESTINATION, next);
}
}
}