本文整理汇总了Java中aQute.bnd.annotation.metatype.Configurable类的典型用法代码示例。如果您正苦于以下问题:Java Configurable类的具体用法?Java Configurable怎么用?Java Configurable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Configurable类属于aQute.bnd.annotation.metatype包,在下文中一共展示了Configurable类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: activate
import aQute.bnd.annotation.metatype.Configurable; //导入依赖的package包/类
@Activate
void activate(Map<String,Object> args) {
Config config = Configurable.createConfigurable(Config.class, args);
salt = config.salt();
if (salt == null || salt.length == 0) {
salt = new byte[] {
0x2f, 0x68, (byte) 0xcb, 0x75, 0x6c, (byte) 0xf1, 0x74, (byte) 0x84, 0x2a, (byte) 0xef
};
}
algorithm = config.algorithm();
if (algorithm == null) {
algorithm = Algorithm.PBKDF2WithHmacSHA1;
}
iterations = config.iterations();
if (iterations < 100)
iterations = 997;
root = config._root();
if (root != null && root.trim().isEmpty())
root = null;
}
开发者ID:osgi,项目名称:bundles,代码行数:25,代码来源:UserAdminAuthenticator.java
示例2: activate
import aQute.bnd.annotation.metatype.Configurable; //导入依赖的package包/类
@Activate
void activate(Map<String,Object> properties) {
Configuration config = Configurable.createConfigurable(Configuration.class, properties);
int coreSize = config.coreSize();
int maxSize = config.maximumPoolSize();
long keepAlive = config.keepAliveTime();
int cores = Runtime.getRuntime().availableProcessors();
if (coreSize < 10 * cores)
coreSize = 30;
if (maxSize <= coreSize)
maxSize = coreSize * 4;
if (keepAlive < 10 || keepAlive > 1000)
keepAlive = 300;
es = new ThreadPoolExecutor(coreSize, maxSize, keepAlive, TimeUnit.SECONDS, queue, //
new ThreadPoolExecutor.CallerRunsPolicy());
}
开发者ID:osgi,项目名称:bundles,代码行数:22,代码来源:ExecutorImpl.java
示例3: activate
import aQute.bnd.annotation.metatype.Configurable; //导入依赖的package包/类
@Activate
void activate(Map<String,Object> properties) {
Config config = Configurable.createConfigurable(Config.class, properties);
es = new ThreadPoolExecutor( //
Math.max(config.coreSize(), 10), //
Math.max(Runtime.getRuntime().availableProcessors() * 2, config.maximumPoolSize()),//
Math.max(config.keepAliveTime(), 10), //
TimeUnit.SECONDS, //
queue, //
new ThreadPoolExecutor.CallerRunsPolicy());
}
开发者ID:osgi,项目名称:bundles,代码行数:14,代码来源:ExecutorImpl.java
示例4: activate
import aQute.bnd.annotation.metatype.Configurable; //导入依赖的package包/类
@Activate
public synchronized void activate(BundleContext context, Map<String, Object> props)
throws InvalidSyntaxException {
this.context = context;
// parse configuration
this.config = Configurable.createConfigurable(Config.class, props);
// listen for changes in matching services
context.addServiceListener(this, this.config.filter());
// lookup services matching to new filter
Set<ServiceReference> matchingServices = this.matchingServices();
try {
switch (this.config.multiplicity()) {
case SINGLETON: {
// create the singleton configuration
this.updateSingletonConfiguration(matchingServices);
break;
}
case ONE_FOR_EACH: {
// create configurations for all matched services
for (ServiceReference ref : matchingServices) {
this.createManagedConfiguration(ref);
}
break;
}
}
} catch (Exception e) {
this.logger.log(LogService.LOG_ERROR, "Couldn't create configuration", e);
}
}
开发者ID:frensjan,项目名称:osgi-autoconf,代码行数:34,代码来源:AutoConfigurator.java
示例5: activate
import aQute.bnd.annotation.metatype.Configurable; //导入依赖的package包/类
@Activate
@Modified
protected void activate(Map<String, Object> properties) {
this.serviceConfig = Configurable.createConfigurable(FlashlightSearchServiceConfiguration.class, properties);
}
开发者ID:savoirfairelinux,项目名称:flashlight-search,代码行数:6,代码来源:DLFileEntrySearchResultProcessor.java
示例6: modified
import aQute.bnd.annotation.metatype.Configurable; //导入依赖的package包/类
@Modified
protected void modified(Map<String, Object> map) {
this.config = Configurable.createConfigurable(Config.class, map);
}
开发者ID:WASdev,项目名称:sample.opentracing.zipkintracer,代码行数:5,代码来源:OpentracingZipkinTracerFactory.java
示例7: activate
import aQute.bnd.annotation.metatype.Configurable; //导入依赖的package包/类
@Activate
@Modified
protected void activate(Map<Object, Object> properties) {
_DummyFactoryConfiguration = Configurable.createConfigurable(DummyFactoryConfiguration.class, properties);
}
开发者ID:yasuflatland-lf,项目名称:liferay-dummy-factory,代码行数:6,代码来源:DummyFactoryConfigurationAction.java
示例8: activate
import aQute.bnd.annotation.metatype.Configurable; //导入依赖的package包/类
@Activate
@Modified
protected void activate(Map<Object, Object> properties) {
_categoryConfig = Configurable.createConfigurable(MBConfig.class, properties);
}
开发者ID:Azilen,项目名称:Discussion-Board-Liferay,代码行数:6,代码来源:MBConfigAction.java
示例9: activate
import aQute.bnd.annotation.metatype.Configurable; //导入依赖的package包/类
/**
* Component lifecycle callback for reading configuration.
*
* @param properties
* Map of configurations.
*/
@Activate
@Modified
protected void activate(Map<String, Object> properties) {
_configuration = Configurable.createConfigurable(HystrixDemoConfiguration.class, properties);
}
开发者ID:fassmus,项目名称:liferay-devcon-2016-hystrix,代码行数:12,代码来源:HystrixDemoPortlet.java
注:本文中的aQute.bnd.annotation.metatype.Configurable类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论