if(descriptor==null ||
descriptor instanceof Application ||
descriptor instanceof ApplicationClientDescriptor ||
descriptor instanceof EjbBundleDescriptor ||
descriptor instanceof WebBundleDescriptor) {
return new PersistenceNode(new PersistenceUnitsDescriptor());
} else {
throw new IllegalArgumentException(descriptor.getClass().getName()+
"is not allowed to contain persistence.xml file");
}
}