/** * Examines the given <code>Cache</code> and from it generates XML * data that is written to the given <code>PrintWriter</code>. */ public static void generate(ClientCache cache, PrintWriter pw) { generate(cache, pw, false /* useSchema */); } /**
/** * Examines the given <code>Cache</code> and from it generates XML * data that is written to the given <code>PrintWriter</code>. */ public static void generate(Cache cache, PrintWriter pw) { generate(cache, pw, true /* useSchema */); }
/** * Examines the given <code>Cache</code> and from it generates XML * data that is written to the given <code>PrintWriter</code>. */ public static void generate(ClientCache cache, PrintWriter pw) { generate(cache, pw, true /* useSchema */); } /**
/** * Generates XML for a <code>Declarable</code>. Will handle the * config <code>Properties</code> for a {@link Declarable2}. */ private void generate(Declarable d) throws SAXException { generate(d, true); } private void generate(Declarable d, boolean includeDeclarable) throws SAXException {
/** * Generates XML for a <code>Declarable</code>. Will handle the * config <code>Properties</code> for a {@link Declarable2}. */ private void generate(Declarable d) throws SAXException { generate(d, true); } private void generate(Declarable d, boolean includeDeclarable) throws SAXException {
/** * Examines the given <code>Cache</code> and from it generates XML * data that is written to the given <code>PrintWriter</code>. */ public static void generate(Cache cache, PrintWriter pw) { generate(cache, pw, false /* useSchema */); }
/** * @param useSchema * Should the generated XML reference a schema (as opposed to * a DTD)? As of 8.1 this value is ignored and always true. * @param includeDefaults set to false to cause generated xml to not have defaults values. */ public static void generate(Cache cache, PrintWriter pw, boolean useSchema, boolean includeKeysValues, boolean includeDefaults) { (new CacheXmlGenerator(cache, true /*latest version always true*/, VERSION_LATEST, includeKeysValues, includeDefaults)).generate(pw); }
/** * @param includeDefaults set to false to cause generated xml to not have defaults values. */ public static void generate(Cache cache, PrintWriter pw, boolean useSchema, boolean includeKeysValues, boolean includeDefaults) { (new CacheXmlGenerator(cache, useSchema, VERSION_LATEST, includeKeysValues, includeDefaults)).generate(pw); }
private void generate(String kind, Declarable d, Properties p) throws SAXException { if (d == null) { return; } handler.startElement("", kind, kind, EMPTY); String className = d.getClass().getName(); handler.startElement("", CLASS_NAME, CLASS_NAME, EMPTY); handler.characters(className.toCharArray(), 0, className.length()); handler.endElement("", CLASS_NAME, CLASS_NAME); generate(p, null); handler.endElement("", kind, kind); }
/** * Writes a default cache.xml to pw. */ private static void generateDefault(PrintWriter pw) { (new CacheXmlGenerator()).generate(pw); }
private void generateGatewayEventFilter(GatewayEventFilter gef) throws SAXException { handler.startElement("", GATEWAY_EVENT_FILTER, GATEWAY_EVENT_FILTER, EMPTY); String className = gef.getClass().getName(); handler.startElement("", CLASS_NAME, CLASS_NAME, EMPTY); handler.characters(className.toCharArray(), 0, className.length()); handler.endElement("", CLASS_NAME, CLASS_NAME); Properties props = null; if (gef instanceof Declarable2) { props = ((Declarable2)gef).getConfig(); generate(props, null); } handler.endElement("", GATEWAY_EVENT_FILTER, GATEWAY_EVENT_FILTER); }
/** * Writes a default cache.xml to pw. */ public static void generateDefault(PrintWriter pw) { (new CacheXmlGenerator()).generate(pw); }
/** * Examines the given <code>Cache</code> and from it generates XML * data that is written to the given <code>PrintWriter</code>. The * schema/dtd for the current version of GemFire is used. * * @param useSchema * Should the generated XML reference a schema (as opposed to * a DTD)? As of 8.1 this value is ignored and always true. */ public static void generate(Cache cache, PrintWriter pw, boolean useSchema) { (new CacheXmlGenerator(cache, true /*latest version always true*/, VERSION_LATEST, true)).generate(pw); }
/** * Examines the given <code>ClientCache</code> and from it generates XML * data that is written to the given <code>PrintWriter</code>. The * schema/dtd for the current version of GemFire is used. * * @param useSchema * Should the generated XML reference a schema (as opposed to * a DTD)? */ public static void generate(ClientCache cache, PrintWriter pw, boolean useSchema) { (new CacheXmlGenerator(cache, useSchema, VERSION_LATEST, true)).generate(pw); }
public static void generateXml(Cache cache) throws Exception{ //File file = new File("SelfRolePlaying.xml"); File file = new File(xmlFileName); try { PrintWriter pw = new PrintWriter(new FileWriter(file), true); CacheXmlGenerator.generate(cache, pw); pw.close(); } catch (IOException ex) { Log.getLogWriter().info("IOException during cache.xml generation to " + file +" : "+ ex); throw ex; } }
/** * Use the CacheXmlGenerator to create XML from the entity associated with the * current cache. * * @return XML string representation of the entity. */ private final String loadXmlDefinition() { final Cache cache = CacheFactory.getAnyInstance(); final StringWriter stringWriter = new StringWriter(); final PrintWriter printWriter = new PrintWriter(stringWriter); CacheXmlGenerator.generate(cache, printWriter, true, false, false); printWriter.close(); return loadXmlDefinition(stringWriter.toString()); }
private void generateInitializer() throws SAXException { if (this.cache.getInitializer() != null) { generate(INITIALIZER, this.cache.getInitializer(), this.cache.getInitializerProps()); } }
private void generateInitializer() throws SAXException { if (this.cache.getInitializer() != null) { generate(INITIALIZER, this.cache.getInitializer(), this.cache.getInitializerProps()); } }