类com.google.inject.Inject源码实例Demo

下面列出了怎么用com.google.inject.Inject的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: arcusplatform   文件: SessionHeartBeater.java
@Inject
public SessionHeartBeater(
   Partitioner partitioner,
   IntraServiceMessageBus intraServiceBus,
   Supplier<Stream<PartitionedSession>> sessionSupplier
) {
   this.sessionSupplier = sessionSupplier;
   this.partitioner = partitioner;
   this.intraServiceBus = intraServiceBus;
   this.executor = Executors
      .newSingleThreadScheduledExecutor(
         ThreadPoolBuilder
            .defaultFactoryBuilder()
            .setNameFormat("ipcd-session-heartbeat")
            .build()
      );
   this.heartbeatTimer = IrisMetrics.metrics("bridge.ipcd").timer("heartbeat");
}
 
源代码2 项目: arcusplatform   文件: AlexaPlatformService.java
@Inject
public AlexaPlatformService(AlexaPlatformServiceConfig config, PlatformMessageBus bus) {
   this.bus = bus;
   workerPool = new ThreadPoolBuilder()
      .withMaxPoolSize(config.getMaxListenerThreads())
      .withKeepAliveMs(config.getListenerThreadKeepAliveMs())
      .withNameFormat(DISPATCHER_POOL_NAME + "-%d")
      .withBlockingBacklog()
      .withMetrics("alexa.bridge")
      .build();
   timeoutPool = new HashedWheelTimer(new ThreadFactoryBuilder()
      .setDaemon(true)
      .setNameFormat(TIMEOUT_POOL_NAME + "-%d")
      .setUncaughtExceptionHandler(new LoggingUncaughtExceptionHandler(logger))
      .build());
   defaultTimeoutSecs = config.getDefaultTimeoutSecs();
}
 
源代码3 项目: arcusplatform   文件: PlaceDeleter.java
@Inject
public PlaceDeleter(
      AccountDAO accountDao,
      PlaceDAO placeDao,
      PersonDAO personDao,
      AuthorizationGrantDAO grantDao,
      PreferencesDAO preferencesDao,
      SubscriptionUpdater subscriptionUpdater,
      PersonDeleter personDeleter,
      PlatformMessageBus bus
) {
   this.accountDao = accountDao;
   this.placeDao = placeDao;
   this.personDao = personDao;
   this.grantDao = grantDao;
   this.preferencesDao = preferencesDao;
   this.subscriptionUpdater = subscriptionUpdater;
   this.personDeleter = personDeleter;
   this.bus = bus;
}
 
源代码4 项目: arcusplatform   文件: PlatformServiceDispatcher.java
@Inject
public PlatformServiceDispatcher(
      PlatformServiceConfig config,
      PlatformMessageBus bus,
      Set<PlatformService> services
  ) {
	this.bus = bus;
	this.services = IrisCollections.toUnmodifiableMap(services, (service) -> service.getAddress());
	this.executor =
	      new ThreadPoolBuilder()
	         .withMaxPoolSize(config.getThreads())
	         .withKeepAliveMs(config.getKeepAliveMs())
	         .withBlockingBacklog()
	         .withNameFormat("platform-service-%d")
	         .withMetrics("platform.service")
	         .build();
	         
}
 
源代码5 项目: arcusplatform   文件: CreateRequestHandler.java
@Inject
public CreateRequestHandler(
		ContextLoader loader,
      PlatformMessageBus platformBus,
      PlaceExecutorRegistry registry,
      PlaceDAO placeDao, 
      SceneDao sceneDao,
      BeanAttributesTransformer<SceneDefinition> transformer
) {
	this.loader = loader;
   this.platformBus = platformBus;
   this.registry = registry;
   this.placeDao = placeDao;
   this.sceneDao = sceneDao;
   this.transformer = transformer;
}
 
源代码6 项目: arcusplatform   文件: CommandExecutor.java
@Inject
public CommandExecutor(
   PlatformMessageBus bus,
   @Named(VoiceConfig.NAME_EXECUTOR) ExecutorService executor,
   VoiceConfig config,
   @Named(VoiceConfig.NAME_TIMEOUT_TIMER) HashedWheelTimer timeoutTimer,
   ResponseCompleter responseCompleter,
   PlacePopulationCacheManager populationCacheMgr
) {
   this.executor = executor;
   this.config = config;
   this.timeoutTimer = timeoutTimer;
   this.responseCompleter = responseCompleter;
   this.populationCacheMgr = populationCacheMgr;
   this.busClient = new PlatformBusClient(bus, executor, ImmutableSet.of(AddressMatchers.equals(Address.platformService(VoiceService.NAMESPACE))));
}
 
@Inject
public VideoMetadataV2FavoriteTable(String ts, Session session) {
	super(ts, session);
	this.deleteField =
			CassandraQueryBuilder
				.delete(getTableName())
				.addWhereColumnEquals(COL_RECORDINGID)
				.addWhereColumnEquals(COL_FIELD)
				.prepare(session);
	this.insertField =
			CassandraQueryBuilder
				.insert(getTableName())
				.addColumns(COLUMNS)
				.withRetryPolicy(new LoggingRetryPolicy(DowngradingConsistencyRetryPolicy.INSTANCE))
				.prepare(session);
}
 
@Inject
public PersonSetAttributesHandler(
      CapabilityRegistry capabilityRegistry,
      BeanAttributesTransformer<Person> personTransformer,
      AccountDAO accountDao,
      PersonDAO personDao,
      PersonPlaceAssocDAO personPlaceAssocDao,
      BillingClient client,
      PlatformMessageBus platformBus,
      PlacePopulationCacheManager populationCacheMgr
) {
   super(capabilityRegistry, personTransformer, platformBus, populationCacheMgr);
   this.accountDao = accountDao;
   this.personDao = personDao;
   this.client = client;
   this.personPlaceAssocDao = personPlaceAssocDao;
}
 
源代码9 项目: arcusplatform   文件: HistoryTable.java
@Inject
public DetailedHubTable(@Named(CassandraHistory.NAME) Session session, HistoryAppenderConfig config) {
   super(
         CassandraQueryBuilder
            .insert(TABLE_NAME)
            .addColumns(Columns.HUB_ID, Columns.TIMESTAMP, Columns.MESSAGE_KEY, Columns.PARAMS, Columns.SUBJECT_ADDRESS)
            .withTtlSec(TimeUnit.HOURS.toSeconds(config.getDetailedHubTtlHours()))
            .prepare(session),
         CassandraQueryBuilder
            .select(TABLE_NAME)
            .addColumns(Columns.HUB_ID, Columns.TIMESTAMP, Columns.MESSAGE_KEY, Columns.PARAMS, Columns.SUBJECT_ADDRESS)
            .addWhereColumnEquals(Columns.HUB_ID)
            .withConsistencyLevel(ConsistencyLevel.LOCAL_ONE)
            .prepare(session),
         CassandraQueryBuilder
            .select(TABLE_NAME)
            .addColumns(Columns.HUB_ID, Columns.TIMESTAMP, Columns.MESSAGE_KEY, Columns.PARAMS, Columns.SUBJECT_ADDRESS)
            .where(Columns.HUB_ID + " = ? AND " + Columns.TIMESTAMP + " <= ?")
            .withConsistencyLevel(ConsistencyLevel.LOCAL_ONE)
            .prepare(session)
   );
}
 
源代码10 项目: arcusplatform   文件: ProtocolBusServiceImpl.java
@Inject
public ProtocolBusServiceImpl(
      ProtocolMessageBus protocolBus,
      BridgeMetrics bridgeMetrics,
      Set<ProtocolBusListener> listeners
) {
   super(protocolBus, ADDRESSES, bridgeMetrics);
   for(ProtocolBusListener listener: listeners) {
      addProtocolListener(listener);
   }
}
 
@Inject
public PersistenceShutdownHookInstaller(
        final @NotNull ShutdownHooks shutdownHooks, final @NotNull PersistenceShutdownHook persistenceShutdownHook,
        final @NotNull PersistenceStartup persistenceStartup) {
    this.shutdownHooks = shutdownHooks;
    this.persistenceShutdownHook = persistenceShutdownHook;
    this.persistenceStartup = persistenceStartup;
}
 
源代码12 项目: arcusplatform   文件: AppFallbackHandler.java
@Inject
public AppFallbackHandler(
		AlwaysAllow authorizer, 
		BridgeMetrics metrics,
		BounceConfig config
) {
	super(authorizer, new HttpSender(WebRunHandler.class, metrics));
	this.androidStoreUrl = config.getAndroidStoreUrl();
	this.appleStoreUrl = config.getAppleStoreUrl();
	this.helpUrl = config.getHelpUrl();
}
 
源代码13 项目: arcusplatform   文件: VideoRecordingServer.java
@Inject
public VideoRecordingServer(
      PlaceDAO placeDao,
      VideoRecordingManager dao,
      RecordingEventPublisher eventPublisher,
      VideoStorage videoStorage,
      VideoRecordingServerConfig videoConfig,
      VideoSessionRegistry registry,
      BridgeServerTlsContext serverTlsContext,
      Provider<TrafficHandler> trafficHandlerProvider,
      @Named("videoBossGroup") EventLoopGroup videoBossGroup,
      @Named("videoWorkerGroup") EventLoopGroup videoWorkerGroup,
      @Named("videoTcpChannelOptions") Map<ChannelOption<?>, Object> videoChildChannelOptions,
      @Named("videoTcpParentChannelOptions") Map<ChannelOption<?>, Object> videoParentChannelOptions,
      @Named("bridgeEventLoopProvider") BridgeServerEventLoopProvider eventLoopProvider,
      VideoTtlResolver ttlResolver
 ) {
   this.placeDao = placeDao;
   this.dao = dao;
   this.eventPublisher = eventPublisher;
   this.videoStorage = videoStorage;
   this.videoConfig = videoConfig;
   this.registry = registry;
   this.videoBossGroup = videoBossGroup;
   this.videoWorkerGroup = videoWorkerGroup;
   this.serverTlsContext = serverTlsContext;
   this.videoChildChannelOptions = videoChildChannelOptions;
   this.videoParentChannelOptions = videoParentChannelOptions;
   this.trafficHandlerProvider = trafficHandlerProvider;
   this.eventLoopProvider = eventLoopProvider;
   this.ttlResolver = ttlResolver;
}
 
@Inject
public GetProductsByCategoryRESTHandler(AlwaysAllow alwaysAllow, BridgeMetrics metrics,
		ProductCatalogManager manager, PopulationDAO populationDao, PlaceDAO placeDao, HubDAO hubDao,
		BeanAttributesTransformer<ProductCatalogEntry> transformer, @Named("UseChunkedSender") RESTHandlerConfig restHandlerConfig) {
	super(alwaysAllow, new HttpSender(GetProductsByCategoryRESTHandler.class, metrics), manager, populationDao, placeDao, hubDao, restHandlerConfig);
	this.listTransformer = new BeanListTransformer<ProductCatalogEntry>(transformer);
}
 
源代码15 项目: plugins   文件: AbyssMinimapOverlay.java
@Inject
AbyssMinimapOverlay(Client client, RunecraftPlugin plugin, RunecraftConfig config, ItemManager itemManager)
{
	setPosition(OverlayPosition.DYNAMIC);
	setLayer(OverlayLayer.ABOVE_WIDGETS);
	this.client = client;
	this.plugin = plugin;
	this.config = config;
	this.itemManager = itemManager;
}
 
源代码16 项目: arcusplatform   文件: UpdateBillingInfoCCHandler.java
@Inject
public UpdateBillingInfoCCHandler(
      AccountDAO accountDao,
      PersonDAO personDao,
      BillingClient client,
      PlatformMessageBus platformBus) {

   this.accountDao = accountDao;
   this.personDao = personDao;
   this.client = client;
   this.platformBus = platformBus;
}
 
源代码17 项目: plugins   文件: BankGridOverlay.java
@Inject
private BankGridOverlay(InventoryGridConfig config, Client client, ItemManager itemManager, InventoryGridPlugin plugin)
{
	this.plugin = plugin;
	this.itemManager = itemManager;
	this.client = client;
	this.config = config;

	setPosition(OverlayPosition.DYNAMIC);
	setLayer(OverlayLayer.ABOVE_WIDGETS);
}
 
源代码18 项目: plugins   文件: FarmingTracker.java
@Inject
private FarmingTracker(Client client, ItemManager itemManager, ConfigManager configManager, TimeTrackingConfig config, FarmingWorld farmingWorld)
{
	this.client = client;
	this.itemManager = itemManager;
	this.configManager = configManager;
	this.config = config;
	this.farmingWorld = farmingWorld;
}
 
源代码19 项目: arcusplatform   文件: HttpHealthCheckServer.java
@Inject 
public HttpHealthCheckServer(
      HealthCheckServerConfig config,
      BridgeMetrics metrics,
      @Named(HealthCheckServerConfig.NAME_HEALTHCHECK_RESOURCES)
      Set<HttpResource> resources
) {
   this.initializer = new HttpServerChannelInitializer();
   this.initializer.setMaxRequestSizeBytes(config.getMaxRequestSizeBytes());
   this.initializer.setHandler(new HttpRequestHandler(resources, metrics));
   this.initializer.setClientFactory(new NoAuthClientRegistry());
   this.port = config.getPort();
}
 
@Inject
public DefinitionTransformCapabilityRegistry(DefinitionRegistry registry) {
	capabilitiesByName = new HashMap<String, CapabilityDefinition>();
	capabilitiesByNamespace = new HashMap<String, CapabilityDefinition>();
	capabilities = new ArrayList<>();
	ingest(registry.getCapabilities());
}
 
源代码21 项目: arcusplatform   文件: HubHeartbeatListener.java
/**
 * 
 */
@Inject
public HubHeartbeatListener(
      PlatformMessageBus platformBus,
      HubRegistry hubs,
      Partitioner partitioner
) {
   super(platformBus);
   this.hubs = hubs;
   this.partitioner = partitioner;
}
 
源代码22 项目: arcusplatform   文件: SetSecurityAnswersHandler.java
@Inject
public SetSecurityAnswersHandler(
      PersonDAO personDao,
      @Named(NAME_RESOURCE_BUNDLE) ResourceBundle securityQuestionBundle,
      PlatformMessageBus platformBus
) {
   this.personDao = personDao;
   this.securityQuestionBundle = securityQuestionBundle;
   this.platformBus = platformBus;
}
 
源代码23 项目: arcusplatform   文件: AccountActivateHandler.java
@Inject
public AccountActivateHandler(AccountDAO accountDao, 
		PersonDAO personDao, 
		PlatformMessageBus platformBus,
		PlacePopulationCacheManager populationCacheMgr) {
   this.accountDao = accountDao;
   this.personDao = personDao;
   this.platformBus = platformBus;
   this.populationCacheMgr = populationCacheMgr;
}
 
源代码24 项目: arcusplatform   文件: ForceRemoveRequestHandler.java
@Inject
public ForceRemoveRequestHandler(
      DeviceDAO deviceDao,
      PlatformMessageBus platformBus,
      Set<GroovyDriverPlugin> plugins,
      DeviceService service
) {
   super(deviceDao, platformBus, plugins);
   this.service = service;
}
 
源代码25 项目: arcusplatform   文件: DirectMessageExecutor.java
@Inject
public DirectMessageExecutor(Set<DirectMessageHandler> handlers) {
   if (handlers != null) {
      handlers.forEach((h) -> this.handlers.put(h.supportsMessageType(), h));
   }

   this.refuseConnection = new RefuseConnectionException();
}
 
源代码26 项目: arcusplatform   文件: RemoveRequestHandler.java
@Inject
public RemoveRequestHandler(
		PlatformMessageBus bus,
		ProductLoader loader
) {
	this.bus = bus;
	this.loader = loader;
}
 
源代码27 项目: presto   文件: KinesisMetadata.java
@Inject
public KinesisMetadata(
        KinesisConfig kinesisConfig,
        Supplier<Map<SchemaTableName, KinesisStreamDescription>> tableDescriptionSupplier,
        Set<KinesisInternalFieldDescription> internalFieldDescriptions)
{
    requireNonNull(kinesisConfig, "kinesisConfig is null");
    isHideInternalColumns = kinesisConfig.isHideInternalColumns();
    this.tableDescriptionSupplier = requireNonNull(tableDescriptionSupplier);
    this.internalFieldDescriptions = requireNonNull(internalFieldDescriptions, "internalFieldDescriptions is null");
}
 
源代码28 项目: presto   文件: KinesisTableDescriptionSupplier.java
@Inject
public KinesisTableDescriptionSupplier(
        KinesisConfig kinesisConfig,
        JsonCodec<KinesisStreamDescription> streamDescriptionCodec,
        S3TableConfigClient s3TableConfigClient)
{
    this.kinesisConfig = requireNonNull(kinesisConfig, "kinesisConfig is null");
    this.streamDescriptionCodec = requireNonNull(streamDescriptionCodec, "streamDescriptionCodec is null");
    this.s3TableConfigClient = requireNonNull(s3TableConfigClient, "S3 table config client is null");
}
 
源代码29 项目: arcusplatform   文件: HttpRequestInitializer.java
@Inject
public HttpRequestInitializer(
   Provider<ChannelInboundHandler> channelInboundProvider,
   BridgeServerTlsContext tlsContext, 
   BridgeServerConfig serverConfig, 
   VideoConfig videoConfig,
   IrisNettyCorsConfig corsConfig
) {
   this.serverTlsContext = tlsContext;
   this.serverConfig = serverConfig;
   this.videoConfig = videoConfig;
   this.channelInboundProvider = channelInboundProvider;
   this.corsConfig = corsConfig;
}
 
源代码30 项目: arcusplatform   文件: GetProductsHandler.java
@Inject
public GetProductsHandler(BeanAttributesTransformer<ProductCatalogEntry> transformer,
      PopulationDAO populationDao,
      ProductCatalogManager manager) {
   super(populationDao, manager);
   listTransformer = new BeanListTransformer<ProductCatalogEntry>(transformer);
}
 
 类所在包
 类方法
 同包方法