private static Properties findAllC3P0Properties() { return MultiPropertiesConfig.readVmConfig().getPropertiesByPrefix("c3p0"); }
private static Properties findResourceProperties() { return MultiPropertiesConfig.readVmConfig().getPropertiesByResourcePath(PROPS_FILE_RSRC_PATH); }
public String getProperty( String key ) { for (int i = configs.length - 1; i >= 0; --i) { MultiPropertiesConfig config = configs[i]; String check = config.getProperty(key); if (check != null) return check; } return null; }
public static String getPropFileConfigProperty( String prop ) { return MultiPropertiesConfig.readVmConfig().getProperty( prop ); }
public static void dumpByPrefix( MultiPropertiesConfig mpc, String pfx ) { Properties props = mpc.getPropertiesByPrefix(pfx); Map m = new TreeMap(); m.putAll( props ); for ( Iterator ii = m.entrySet().iterator(); ii.hasNext(); ) { Map.Entry entry = (Map.Entry) ii.next(); System.err.println( entry.getKey() + " --> " + entry.getValue() ); } }
public Properties getPropertiesByResourcePath(String path) { for (int i = configs.length - 1; i >= 0; --i) { MultiPropertiesConfig config = configs[i]; Properties check = config.getPropertiesByResourcePath(path); if (check != null) return check; } return null; }
public static MultiPropertiesConfig readVmConfig(String[] defaultResources, String[] preemptingResources) { List l = new LinkedList(); if (defaultResources != null) l.add( read( defaultResources ) ); l.add( readVmConfig() ); if (preemptingResources != null) l.add( read( preemptingResources ) ); return combine( (MultiPropertiesConfig[]) l.toArray( new MultiPropertiesConfig[ l.size() ] ) ); }
CombinedMultiPropertiesConfig( MultiPropertiesConfig[] configs ) { this.configs = configs; List allPaths = new LinkedList(); for (int i = configs.length - 1; i >= 0; --i) { String[] rps = configs[i].getPropertiesResourcePaths(); for (int j = rps.length - 1; j >= 0; --j) { String rp = rps[j]; if (! allPaths.contains( rp ) ) allPaths.add(0, rp); } } this.resourcePaths = (String[]) allPaths.toArray( new String[ allPaths.size() ] ); List pms = new LinkedList(); for ( int i = 0, len = configs.length; i < len; ++i ) pms.addAll( configs[i].getDelayedLogItems() ); this.parseMessages = Collections.unmodifiableList( pms ); }
CombinedMultiPropertiesConfig( MultiPropertiesConfig[] configs ) { this.configs = configs; List allPaths = new LinkedList(); for (int i = configs.length - 1; i >= 0; --i) { String[] rps = configs[i].getPropertiesResourcePaths(); for (int j = rps.length - 1; j >= 0; --j) { String rp = rps[j]; if (! allPaths.contains( rp ) ) allPaths.add(0, rp); } } this.resourcePaths = (String[]) allPaths.toArray( new String[ allPaths.size() ] ); }
static HashMap findPropStyleExtensionsDefaultConfig() { HashMap extensions = new HashMap(); Properties props = MPCONFIG().getPropertiesByPrefix(PROP_STYLE_EXTENSIONS_PFX); for ( Iterator ii = props.keySet().iterator(); ii.hasNext(); ) // iterate through c3p0.extensions.xxx subproperties { String fullKey = (String) ii.next(); String extensionsKey = fullKey.substring( PROP_STYLE_EXTENSIONS_PFX_LEN + 1 ); extensions.put( extensionsKey, props.get( fullKey ) ); } return extensions; }
public static String getPropFileConfigProperty( String prop ) { return MultiPropertiesConfig.readVmConfig().getProperty( prop ); }
public Properties getPropertiesByResourcePath(String path) { for (int i = configs.length - 1; i >= 0; --i) { MultiPropertiesConfig config = configs[i]; Properties check = config.getPropertiesByResourcePath(path); if (check != null) return check; } return null; }
public static MultiPropertiesConfig readVmConfig(String[] defaultResources, String[] preemptingResources) { List l = new LinkedList(); if (defaultResources != null) l.add( read( defaultResources ) ); l.add( readVmConfig() ); if (preemptingResources != null) l.add( read( preemptingResources ) ); return combine( (MultiPropertiesConfig[]) l.toArray( new MultiPropertiesConfig[ l.size() ] ) ); }
CombinedMultiPropertiesConfig( MultiPropertiesConfig[] configs ) { this.configs = configs; List allPaths = new LinkedList(); for (int i = configs.length - 1; i >= 0; --i) { String[] rps = configs[i].getPropertiesResourcePaths(); for (int j = rps.length - 1; j >= 0; --j) { String rp = rps[j]; if (! allPaths.contains( rp ) ) allPaths.add(0, rp); } } this.resourcePaths = (String[]) allPaths.toArray( new String[ allPaths.size() ] ); }
static Properties findAllOneLevelC3P0Properties() { Properties out = MPCONFIG().getPropertiesByPrefix("c3p0"); for (Iterator ii = out.keySet().iterator(); ii.hasNext(); ) if (((String) ii.next()).lastIndexOf('.') > 4) ii.remove(); return out; }
public String getProperty( String key ) { for (int i = configs.length - 1; i >= 0; --i) { MultiPropertiesConfig config = configs[i]; String check = config.getProperty(key); if (check != null) return check; } return null; } }
String cfgFile = MultiPropertiesConfig.readVmConfig().getProperty( XML_CFG_FILE_KEY ); if (cfgFile == null)
private static Properties findResourceProperties() { return MultiPropertiesConfig.readVmConfig().getPropertiesByResourcePath(DEFAULT_CONFIG_RSRC_PATH); }
public Properties getPropertiesByResourcePath(String path) { // Not robust to overlapping resource paths // // for (int i = configs.length - 1; i >= 0; --i) // { // MultiPropertiesConfig config = configs[i]; // Properties check = config.getPropertiesByResourcePath(path); // if (check != null) // return check; // } // return null; Properties out = new Properties(); for ( int i = 0, len = configs.length; i < len; ++i ) { MultiPropertiesConfig config = configs[i]; Properties check = config.getPropertiesByResourcePath(path); if ( check != null ) out.putAll( check ); } return ( out.size() > 0 ? out : null ); }
private static Properties findAllC3P0Properties() { return MultiPropertiesConfig.readVmConfig().getPropertiesByPrefix("c3p0"); }