/** * Returns the name of a class to use to create an object. * The factory's <code>StringProperty</code> is gotten and * if it has a non-null value, then that is returned. Otherwise, * the <code>StringProperty</code>'s name (path) is used as the * name to probe the <code>Properties</code> object for a value. * This method is allowed to return null. * * @return <code>null</code> or a class name */ protected String getClassName(final Properties props) { final StringProperty stringProp = getStringProperty(); final String className = stringProp.get(); return (className != null) ? className : (props == null) ? null : props.getProperty(stringProp.getPath()); }
private List<String> getStatisticsProviderNames() { // Dialect-specific path, e.g. "mondrian.statistics.providers.MYSQL" final String path = MondrianProperties.instance().StatisticsProviders.getPath() + "." + getDatabaseProduct().name(); String nameList = MondrianProperties.instance().getProperty(path); if (nameList != null && nameList.length() > 0) { return Arrays.asList(nameList.split(",")); } // Generic property, "mondrian.statistics.providers" nameList = MondrianProperties.instance().StatisticsProviders.get(); if (nameList != null && nameList.length() > 0) { return Arrays.asList(nameList.split(",")); } return null; }
/** * Returns the instance of the {@link mondrian.spi.DataSourceResolver} * plugin. * * @return data source resolver */ private static synchronized DataSourceResolver getDataSourceResolver() { if (dataSourceResolver == null) { final StringProperty property = MondrianProperties.instance().DataSourceResolverClass; final String className = property.get( JndiDataSourceResolver.class.getName()); try { dataSourceResolver = ClassResolver.INSTANCE.instantiateSafe(className); } catch (ClassCastException e) { throw Util.newInternal( e, "Plugin class specified by property " + property.getPath() + " must implement " + DataSourceResolver.class.getName()); } } return dataSourceResolver; }