public void addXmlEntity(XmlEntity xmlEntity,String[] groups) throws Exception {
  Region<String,Configuration> configRegion=getConfigurationRegion();
  if (groups == null || groups.length == 0) {
    groups=new String[]{SharedConfiguration.CLUSTER_CONFIG};
  }
  for (  String group : groups) {
    Configuration configuration=(Configuration)configRegion.get(group);
    if (configuration == null) {
      configuration=new Configuration(group);
    }
    String xmlContent=configuration.getCacheXmlContent();
    if (xmlContent == null || xmlContent.isEmpty()) {
      StringWriter sw=new StringWriter();
      PrintWriter pw=new PrintWriter(sw);
      CacheXmlGenerator.generateDefault(pw);
      xmlContent=sw.toString();
    }
    final Document doc=createAndUpgradeDocumentFromXml(xmlContent);
    XmlUtils.addNewNode(doc,xmlEntity);
    configuration.setCacheXmlContent(XmlUtils.prettyXml(doc));
    configRegion.put(group,configuration);
    writeConfig(configuration);
  }
}

public void addXmlEntity ( XmlEntity xmlEntity , String [ ] groups ) throws Exception { Region < String , Configuration > configRegion = getConfigurationRegion ( ) ; if ( groups == null || groups . length == 0 ) { groups = new String [ ] { SharedConfiguration . CLUSTER_CONFIG } ; } for ( String group : groups ) { Configuration configuration = ( Configuration ) configRegion . get ( group ) ; if ( configuration == null ) { configuration = new Configuration ( group ) ; } String xmlContent = configuration . getCacheXmlContent ( ) ; if ( xmlContent == null || xmlContent . isEmpty ( ) ) { StringWriter sw = new StringWriter ( ) ; PrintWriter pw = new PrintWriter ( sw ) ; CacheXmlGenerator . generateDefault ( pw ) ; xmlContent = sw . toString ( ) ; } final Document doc = createAndUpgradeDocumentFromXml ( xmlContent ) ; XmlUtils . addNewNode ( doc , xmlEntity ) ; configuration . setCacheXmlContent ( XmlUtils . prettyXml ( doc ) ) ; configRegion . put ( group , configuration ) ; writeConfig ( configuration ) ; } }
adds / replaces the xml entity in the shared configuration
