本文整理匯總了Java中com.google.inject.name.Names.bindProperties方法的典型用法代碼示例。如果您正苦於以下問題:Java Names.bindProperties方法的具體用法?Java Names.bindProperties怎麽用?Java Names.bindProperties使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.inject.name.Names
的用法示例。
在下文中一共展示了Names.bindProperties方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: configure
import com.google.inject.name.Names; //導入方法依賴的package包/類
@Override
protected final void configure() {
try {
if (properties == null) {
properties = ConfigurationHelper.loadPropertiesFromFile(fileName);
}
Names.bindProperties(binder(), properties);
} catch (IOException e) {
addError(e);
}
}
示例2: configure
import com.google.inject.name.Names; //導入方法依賴的package包/類
@Override
protected void configure() {
try {
Properties properties = new Properties();
ClassLoader classLoader = this.getClass().getClassLoader();
properties.load(classLoader.getResourceAsStream(propertiesFileName));
Names.bindProperties(binder(), properties);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
示例3: bindProperties
import com.google.inject.name.Names; //導入方法依賴的package包/類
protected final void bindProperties(Map<String, String> map) {
Names.bindProperties(binder(), map);
}
示例4: configure
import com.google.inject.name.Names; //導入方法依賴的package包/類
@Override
protected void configure() {
try {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
Properties properties = new Properties();
String configDirectory = System.getProperty("wayf.conf.dir");
if (configDirectory != null) {
String configFile = configDirectory + "/" + WAYF_CONFIG_FILE;
LOG.info("Loading wayf config file from location [{}]", configFile);
FileReader reader = new FileReader(configFile);
properties.load(reader);
} else {
LOG.info("Loading wayf config file from classpath");
properties.load(classLoader.getResourceAsStream(WAYF_CONFIG_FILE));
}
properties.load(classLoader.getResourceAsStream("dao/device-access-dao-db.properties"));
properties.load(classLoader.getResourceAsStream("dao/publisher-dao-db.properties"));
properties.load(classLoader.getResourceAsStream("dao/device-dao-db.properties"));
properties.load(classLoader.getResourceAsStream("dao/open-athens-entity-dao-db.properties"));
properties.load(classLoader.getResourceAsStream("dao/oauth-entity-dao-db.properties"));
properties.load(classLoader.getResourceAsStream("dao/device-identity-provider-blacklist-dao-db.properties"));
properties.load(classLoader.getResourceAsStream("dao/authorization-token-dao-db.properties"));
properties.load(classLoader.getResourceAsStream("dao/error-logger-dao-db.properties"));
properties.load(classLoader.getResourceAsStream("dao/publisher-registration-dao-db.properties"));
properties.load(classLoader.getResourceAsStream("dao/user-dao-db.properties"));
properties.load(classLoader.getResourceAsStream("dao/password-credentials-dao-db.properties"));
Names.bindProperties(binder(), properties);
bind(DeviceIdentityProviderBlacklistFacade.class).to(DeviceIdentityProviderBlacklistFacadeImpl.class);
bind(IdentityProviderUsageFacade.class).to(IdentityProviderUsageFacadeImpl.class);
bind(CryptFacade.class).to(CryptFacadeBcryptImpl.class);
bind(CacheManager.class).to(CacheManagerImpl.class);
bind(PasswordCredentialsFacade.class).to(PasswordCredentialsFacadeImpl.class);
bind(PasswordCredentialsDao.class).to(PasswordCredentialsDaoDbImpl.class);
bind(AuthorizationTokenFacade.class).to(AuthorizationTokenFacadeImpl.class);
bind(AuthorizationTokenFactory.class).to(AuthorizationTokenFactoryImpl.class);
bind(new TypeLiteral<AuthenticationCredentialsDao<PasswordCredentials>>(){}).to(PasswordCredentialsDaoDbImpl.class);
bind(new TypeLiteral<AuthenticationCredentialsDao<AuthorizationToken>>(){}).to(AuthorizationTokenDaoDbImpl.class);
bind(AuthenticationFacade.class).to(AuthenticationFacadeImpl.class);
bind(DeviceAccessFacade.class).to(DeviceAccessFacadeImpl.class);
bind(DeviceAccessDao.class).to(DeviceAccessDaoDbImpl.class);
bind(DeviceFacade.class).to(DeviceFacadeImpl.class);
bind(DeviceDao.class).to(DeviceDaoDbImpl.class);
bind(UserFacade.class).to(UserFacadeImpl.class);
bind(UserDao.class).to(UserDaoDbImpl.class);
bind(PublisherFacade.class).to(PublisherFacadeImpl.class);
bind(PublisherDao.class).to(PublisherDaoDbImpl.class);
bind(PublisherRegistrationDao.class).to(PublisherRegistrationDaoDbImpl.class);
bind(PublisherRegistrationFacade.class).to(PublisherRegistrationFacadeImpl.class);
bind(IdentityProviderFacade.class).to(IdentityProviderFacadeImpl.class);
bind(ErrorLoggerFacade.class).to(ErrorLoggerFacadeImpl.class);
bind(ErrorLoggerDao.class).to(ErrorLoggerDaoDbImpl.class);
bind(new TypeLiteral<InflationPolicyParser<String>>(){}).to(InflationPolicyParserQueryParamImpl.class);
bind(DeviceIdentityProviderBlacklistDao.class).to(DeviceIdentityProviderBlacklistDaoDbImpl.class);
bind(ClientJsFacade.class).to(ClientJsFacadeImpl.class);
} catch (Exception e) {
LOG.error("Error initializing Guice", e);
throw new RuntimeException(e);
}
}
示例5: configure
import com.google.inject.name.Names; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
@Override
protected void configure()
{
bind(QueryQueuingManager.class).in(Singleton.class);
bind(KairosDatastore.class).in(Singleton.class);
bind(AggregatorFactory.class).to(GuiceAggregatorFactory.class).in(Singleton.class);
bind(GroupByFactory.class).to(GuiceGroupByFactory.class).in(Singleton.class);
bind(QueryPluginFactory.class).to(GuiceQueryPluginFactory.class).in(Singleton.class);
bind(QueryParser.class).in(Singleton.class);
bind(CacheFileCleaner.class).in(Singleton.class);
bind(KairosDBScheduler.class).to(KairosDBSchedulerImpl.class).in(Singleton.class);
bind(KairosDBSchedulerImpl.class).in(Singleton.class);
bind(MemoryMonitor.class).in(Singleton.class);
bind(SumAggregator.class);
bind(MinAggregator.class);
bind(MaxAggregator.class);
bind(AvgAggregator.class);
bind(StdAggregator.class);
bind(RateAggregator.class);
bind(SamplerAggregator.class);
bind(LeastSquaresAggregator.class);
bind(PercentileAggregator.class);
bind(DivideAggregator.class);
bind(ScaleAggregator.class);
bind(CountAggregator.class);
bind(DiffAggregator.class);
bind(DataGapsMarkingAggregator.class);
bind(FirstAggregator.class);
bind(LastAggregator.class);
bind(SaveAsAggregator.class);
bind(TrimAggregator.class);
bind(SmaAggregator.class);
bind(FilterAggregator.class);
bind(ValueGroupBy.class);
bind(TimeGroupBy.class);
bind(TagGroupBy.class);
bind(BinGroupBy.class);
Names.bindProperties(binder(), m_props);
bind(Properties.class).toInstance(m_props);
String hostname = m_props.getProperty("kairosdb.hostname");
bindConstant().annotatedWith(Names.named("HOSTNAME")).to(hostname != null ? hostname: Util.getHostName());
bind(new TypeLiteral<List<DataPointListener>>()
{
}).toProvider(DataPointListenerProvider.class);
//bind datapoint default impls
bind(DoubleDataPointFactory.class)
.to(getClassForProperty(DATAPOINTS_FACTORY_DOUBLE)).in(Singleton.class);
//This is required in case someone overwrites our factory property
bind(DoubleDataPointFactoryImpl.class).in(Singleton.class);
bind(LongDataPointFactory.class)
.to(getClassForProperty(DATAPOINTS_FACTORY_LONG)).in(Singleton.class);
//This is required in case someone overwrites our factory property
bind(LongDataPointFactoryImpl.class).in(Singleton.class);
bind(LegacyDataPointFactory.class).in(Singleton.class);
bind(StringDataPointFactory.class).in(Singleton.class);
bind(StringDataPointFactory.class).in(Singleton.class);
bind(NullDataPointFactory.class).in(Singleton.class);
bind(KairosDataPointFactory.class).to(GuiceKairosDataPointFactory.class).in(Singleton.class);
String hostIp = m_props.getProperty("kairosdb.host_ip");
bindConstant().annotatedWith(Names.named("HOST_IP")).to(hostIp != null ? hostIp: InetAddresses.toAddrString(Util.findPublicIp()));
}
示例6: bindEnvironmentVariablesOrSkip
import com.google.inject.name.Names; //導入方法依賴的package包/類
/**
* Binds the environmental system variables from the given list of keys. If the variable is undefined for a key
* in the list, the variable will not be bound.
*
* @param keys the list of expected keys.
*/
protected final void bindEnvironmentVariablesOrSkip(List<String> keys) {
Names.bindProperties(binder(), ConfigurationHelper.getEnvironmentalVariablesFromKeys(keys));
}