use of javax.inject.Named in project DevRing by LJYcoder.
the class MovieActivityModule method playingMovieFragment.
@ActivityScope
@Provides
@Named("playing")
MovieFragment playingMovieFragment() {
Bundle bundle = new Bundle();
bundle.putInt("type", MovieFragment.TYPE_PLAYING);
MovieFragment fragment = new MovieFragment();
fragment.setArguments(bundle);
return fragment;
}
use of javax.inject.Named in project verify-hub by alphagov.
the class SamlEngineModule method getVerifyMetadataHealthCheck.
@Provides
@Singleton
@Named(VERIFY_METADATA_HEALTH_CHECK)
private MetadataHealthCheck getVerifyMetadataHealthCheck(@Named("VerifyMetadataResolver") MetadataResolver metadataResolver, Environment environment, SamlEngineConfiguration configuration) {
MetadataHealthCheck metadataHealthCheck = new MetadataHealthCheck(metadataResolver, configuration.getMetadataConfiguration().getExpectedEntityId());
environment.healthChecks().register(VERIFY_METADATA_HEALTH_CHECK, metadataHealthCheck);
return metadataHealthCheck;
}
use of javax.inject.Named in project verify-hub by alphagov.
the class SamlProxyModule method getCountryMetadataHealthCheck.
@Provides
@Singleton
@Named(COUNTRY_METADATA_HEALTH_CHECK)
public Optional<MetadataHealthCheck> getCountryMetadataHealthCheck(@Named("CountryMetadataResolver") Optional<MetadataResolver> metadataResolver, Environment environment, SamlProxyConfiguration configuration) {
return metadataResolver.map(resolver -> {
MetadataHealthCheck metadataHealthCheck = new MetadataHealthCheck(metadataResolver.get(), configuration.getCountryConfiguration().get().getMetadataConfiguration().getExpectedEntityId());
environment.healthChecks().register(COUNTRY_METADATA_HEALTH_CHECK, metadataHealthCheck);
return metadataHealthCheck;
});
}
use of javax.inject.Named in project atlasdb by palantir.
the class KeyValueServiceModule method provideWrappedKeyValueService.
@Provides
@Singleton
@Named("kvs")
public KeyValueService provideWrappedKeyValueService(@Named("rawKvs") KeyValueService rawKvs, TimestampService tss, ServicesConfig config) {
KvsProfilingLogger.setSlowLogThresholdMillis(config.atlasDbConfig().getKvsSlowLogThresholdMillis());
KeyValueService kvs = ProfilingKeyValueService.create(rawKvs);
kvs = TracingKeyValueService.create(kvs);
kvs = AtlasDbMetrics.instrument(KeyValueService.class, kvs);
kvs = ValidatingQueryRewritingKeyValueService.create(kvs);
SweepConfig sweepConfig = config.atlasDbRuntimeConfig().sweep();
kvs = SweepStatsKeyValueService.create(kvs, tss, sweepConfig::writeThreshold, sweepConfig::writeSizeThreshold);
TransactionTables.createTables(kvs);
ImmutableSet<Schema> schemas = ImmutableSet.<Schema>builder().add(SweepSchema.INSTANCE.getLatestSchema()).add(CompactSchema.INSTANCE.getLatestSchema()).addAll(config.schemas()).build();
for (Schema schema : schemas) {
Schemas.createTablesAndIndexes(schema, kvs);
}
return kvs;
}
use of javax.inject.Named in project core by weld.
the class CodeFragmentManagerImpl method getRecentCodeFragments.
@Produces
@Named
public List<CodeFragment> getRecentCodeFragments() {
Query query = entityManager.createQuery("SELECT c FROM CodeFragment c WHERE c.hash=null ORDER BY datetime DESC ");
query.setMaxResults(MAX_RECENT_FRAGMENTS);
@SuppressWarnings("unchecked") List<CodeFragment> codes = query.getResultList();
return codes;
}
Aggregations