本文整理了Java中com.google.inject.name.Named
类的一些代码示例,展示了Named
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Named
类的具体详情如下:
包路径:com.google.inject.name.Named
类名称:Named
暂无
代码示例来源:origin: killbill/killbill
@Inject
public Redis107CacheManagerProvider(final MetricRegistry metricRegistry,
@Named(REDIS_CACHE_CLIENT) final RedissonClient redissonClient,
final Set<BaseCacheLoader> cacheLoaders) {
super(metricRegistry, redissonClient);
this.cacheLoaders = cacheLoaders;
}
代码示例来源:origin: com.google.inject/guice
@Override
public boolean equals(Object o) {
if (!(o instanceof Named)) {
return false;
}
Named other = (Named) o;
return value.equals(other.value());
}
代码示例来源:origin: apache/incubator-druid
public class DataSourceTaskIdHolder
{
public static final String DATA_SOURCE_BINDING = "druidDataSource";
public static final String TASK_ID_BINDING = "druidTaskId";
@Named(DATA_SOURCE_BINDING)
@Inject(optional = true)
String dataSource = null;
@Named(TASK_ID_BINDING)
@Inject(optional = true)
String taskId = null;
public String getDataSource()
{
return dataSource;
}
public String getTaskId()
{
return taskId;
}
}
代码示例来源:origin: killbill/killbill
@Provides
@Singleton
@Named(IDBISetup.MAIN_RO_IDBI_NAMED)
protected IDBI provideRoIDBIInAComplicatedWayBecauseOf627(final IDBI idbi) {
return idbi;
}
代码示例来源:origin: Netflix/conductor
@ProvidesIntoMap
@StringMapKey(CONDUCTOR_QUALIFIER)
@Singleton
@Named(EVENT_QUEUE_PROVIDERS_QUALIFIER)
public EventQueueProvider getDynoEventQueueProvider(QueueDAO queueDAO, Configuration configuration) {
return new DynoEventQueueProvider(queueDAO, configuration);
}
代码示例来源:origin: apache/incubator-druid
@Provides
@Named(AuthConfig.ALLOW_ALL_NAME)
public Authenticator getAuthenticator()
{
return new AllowAllAuthenticator();
}
}
代码示例来源:origin: apache/incubator-druid
@Inject
public void inject(Injector injector)
{
final List<Binding<Emitter>> emitterBindings = injector.findBindingsByType(new TypeLiteral<Emitter>(){});
emitter = findEmitter(emitterType, emitterBindings);
if (emitter == null) {
emitter = findEmitter(NoopEmitterModule.EMITTER_TYPE, emitterBindings);
}
if (emitter == null) {
List<String> knownTypes = new ArrayList<>();
for (Binding<Emitter> binding : emitterBindings) {
final Annotation annotation = binding.getKey().getAnnotation();
if (annotation != null) {
knownTypes.add(((Named) annotation).value());
}
}
throw new ISE("Unknown emitter type[%s]=[%s], known types[%s]", EMITTER_PROPERTY, emitterType, knownTypes);
}
}
代码示例来源:origin: Graylog2/graylog2-server
@Named("configuration") AdministrationFilter createConfigurationFilter(String configurationId);
@Named("os") AdministrationFilter createOsFilter(String os);
代码示例来源:origin: Netflix/conductor
@Inject
public EventQueues(@Named(EVENT_QUEUE_PROVIDERS_QUALIFIER) Map<String, EventQueueProvider> providers, ParametersUtils parametersUtils) {
this.providers = providers;
this.parametersUtils = parametersUtils;
}
代码示例来源:origin: killbill/killbill
@Provides
@Singleton
@Named(IDBISetup.MAIN_RO_IDBI_NAMED)
protected IDBI provideRoIDBI(final IDBI idbi) {
return idbi;
}
}
代码示例来源:origin: Netflix/conductor
@ProvidesIntoMap
@StringMapKey("nats")
@Singleton
@Named(EVENT_QUEUE_PROVIDERS_QUALIFIER)
public EventQueueProvider getNATSEventQueueProvider(Configuration configuration) {
return new NATSEventQueueProvider(configuration);
}
代码示例来源:origin: apache/incubator-druid
@Provides
@Named(AuthConfig.ALLOW_ALL_NAME)
public Authorizer getAuthorizer()
{
return new AllowAllAuthorizer();
}
}
代码示例来源:origin: Graylog2/graylog2-server
@Named("os") AdministrationFilter createOsFilter(String os);
@Named("status") AdministrationFilter createStatusFilter(int status);
代码示例来源:origin: killbill/killbill
@Inject
public RedisShiroManagerProvider(final SecurityManager securityManager,
final SubjectDAO subjectDAO,
final CacheManager eh107CacheManager,
final MetricRegistry metricRegistry,
@Named(REDIS_CACHE_CLIENT) final RedissonClient redissonClient) {
this.securityManager = securityManager;
this.subjectDAO = subjectDAO;
this.eh107CacheManager = eh107CacheManager;
this.metricRegistry = metricRegistry;
this.redissonClient = redissonClient;
}
代码示例来源:origin: kairosdb/kairosdb
@Inject
public WebServer(@Named(JETTY_ADDRESS_PROPERTY) String address,
@Named(JETTY_PORT_PROPERTY) int port,
@Named(JETTY_WEB_ROOT_PROPERTY) String webRoot)
throws UnknownHostException
{
checkNotNull(webRoot);
m_port = port;
m_webRoot = webRoot;
m_address = InetAddress.getByName(address);
}
代码示例来源:origin: jmxtrans/jmxtrans
@Provides
@Singleton
@Named("resultExecutorRepository")
ExecutorRepository resultExecutorRepository() throws MalformedObjectNameException {
int poolSize = configuration.getResultProcessorExecutorPoolSize();
int workQueueCapacity = configuration.getResultProcessorExecutorWorkQueueCapacity();
String executorAlias = "result";
return createExecutorRepository(poolSize, workQueueCapacity, executorAlias);
}
代码示例来源:origin: Netflix/conductor
@ProvidesIntoMap
@StringMapKey(TASK_TYPE_DECISION)
@Singleton
@Named(TASK_MAPPERS_QUALIFIER)
public TaskMapper getDecisionTaskMapper() {
return new DecisionTaskMapper();
}
代码示例来源:origin: kairosdb/kairosdb
@Provides
@Named(ROLLUP_EXECUTOR)
public ScheduledExecutorService getExecutorService()
{
return Executors.newSingleThreadScheduledExecutor(
new ThreadFactoryBuilder().setNameFormat("Roll-up-Modification-Checker-%s").build());
}
}
代码示例来源:origin: Graylog2/graylog2-server
@Named("collector") AdministrationFilter createCollectorFilter(String collectorId);
@Named("configuration") AdministrationFilter createConfigurationFilter(String configurationId);
代码示例来源:origin: jooby-project/jooby
private static String findName(final AnnotatedElement elem) {
Named named = elem.getAnnotation(Named.class);
if (named == null) {
com.google.inject.name.Named gnamed = elem
.getAnnotation(com.google.inject.name.Named.class);
if (gnamed == null) {
Header header = elem.getAnnotation(Header.class);
if (header == null) {
return null;
}
return Strings.emptyToNull(header.value());
}
return gnamed.value();
}
return Strings.emptyToNull(named.value());
}
内容来源于网络,如有侵权,请联系作者删除!