Java 类javax.inject.Inject 实例源码

项目:hrrs    文件:RateLimitedExecutor.java   
@Inject
public RateLimitedExecutor(Config config) {

    // Check arguments.
    checkNotNull(config, "config");

    // Set class fields.
    this.executorService = createExecutorService(config.getThreadCount());
    this.rateLimiter = RateLimiter.create(
            config.getMaxRequestCountPerSecond(),
            config.getRampUpDurationSeconds(),
            TimeUnit.SECONDS);
    LOGGER.debug(
            "instantiated (threadCount={}, maxRequestCountPerSecond={}, rampUpDurationSeconds={})",
            config.getThreadCount(), config.getMaxRequestCountPerSecond(), config.getRampUpDurationSeconds());

}
项目:Equella    文件:TLEAclManagerImpl.java   
@Inject
public void setPluginService(PluginService pluginService)
{
    ownerHandlers = new PluginTracker<SecurityTargetHandler>(pluginService, "com.tle.core.security",
        "securityTargetHandler", "handlesOwnershipFor");
    ownerHandlers.setBeanKey("handler");

    labellingHandlers = new PluginTracker<SecurityTargetHandler>(pluginService, "com.tle.core.security",
        "securityTargetHandler", "handlesLabellingFor");
    labellingHandlers.setBeanKey("handler");

    transformHandlers = new PluginTracker<SecurityTargetHandler>(pluginService, "com.tle.core.security",
        "securityTargetHandler", "handlesTransformationOf");
    transformHandlers.setBeanKey("handler");

    postProcessors = new PluginTracker<SecurityPostProcessor>(pluginService, "com.tle.core.security", "securityPostProcessor",
        null).setBeanKey("bean");
}
项目:ProjectAres    文件:ServerTagger.java   
@Inject ServerTagger(Server server) {
    this.tags = Lazy.from(() -> {
        final TagSetBuilder builder = new TagSetBuilder();
        builder
            .add("server", server.slug())
            .add("datacenter", server.datacenter())
            .add("box", server.box())
            .add("network", server.network().name().toLowerCase())
            .add("role", server.role().name().toLowerCase())
            .add("visibility", server.visibility().name().toLowerCase())
            .add("family", server.family())
            .addAll("realm", server.realms());

        if(server.game_id() != null) {
            builder.add("game", server.game_id());
        }

        return builder.build();
    });
}
项目:fx-animation-editor    文件:AnimationEditorComponent.java   
@Inject
public AnimationEditorComponent(MenuBarComponent menuBar, AnimationEditorPresenter presenter, TimelineEditorComponent timelineEditor,
                                PropertyEditorComponent propertyEditor, SceneComponent scene, PlayerComponent player, PropertyStore propertyStore,
                                SaveDialogComponent saveDialogComponent, EventBus eventBus) {

    this.menuBar = menuBar;
    this.timelineEditor = timelineEditor;
    this.propertyEditor = propertyEditor;
    this.scene = scene;
    this.player = player;
    this.propertyStore = propertyStore;
    this.saveDialogComponent = saveDialogComponent;
    initUi();
    initPresenter(presenter);
    configureDividerPosition();
    subscribeToEvents(eventBus);
}
项目:hygene    文件:SimpleBookmarkStore.java   
/**
 * Create an instance of a {@link SimpleBookmarkStore}.
 * <p>
 * If it observed that the {@link org.dnacronym.hygene.parser.GfaFile} in {@link GraphStore} has changed, it will
 * clear all current {@link SimpleBookmark}s and load the {@link Bookmark}s associated with the new
 * {@link org.dnacronym.hygene.parser.GfaFile}.
 * <p>
 * It uses the {@link GraphDimensionsCalculator} as a reference for each internal {@link SimpleBookmark}.
 *
 * @param graphStore                the {@link GraphStore} to be observed by this class
 * @param graphVisualizer           the {@link GraphVisualizer} to be used by this class
 * @param graphDimensionsCalculator the {@link GraphDimensionsCalculator} to be used by this class
 * @param sequenceVisualizer        the {@link SequenceVisualizer} to be used by this class
 * @see SimpleBookmark
 */
@Inject
public SimpleBookmarkStore(final GraphStore graphStore, final GraphVisualizer graphVisualizer,
                           final GraphDimensionsCalculator graphDimensionsCalculator,
                           final SequenceVisualizer sequenceVisualizer) {
    this.graphDimensionsCalculator = graphDimensionsCalculator;
    this.graphVisualizer = graphVisualizer;
    this.sequenceVisualizer = sequenceVisualizer;

    simpleBookmarks = new ArrayList<>();
    observableSimpleBookmarks = FXCollections.observableList(simpleBookmarks);
    observableSimpleBookmarks.addListener((ListChangeListener<SimpleBookmark>) listener -> graphVisualizer.draw());

    graphStore.getGfaFileProperty().addListener((observable, oldValue, newValue) -> {
        try {
            fileBookmarks = new FileBookmarks(new FileDatabase(newValue.getFileName()));

            simpleBookmarks.clear();
            addBookmarks(fileBookmarks.getAll());
        } catch (final SQLException | IOException e) {
            LOGGER.error("Unable to load bookmarks from file.", e);
        }
    });
}
项目:AndroidSensors    文件:WifiMeasurementsGatherer.java   
@Inject
public WifiMeasurementsGatherer(SensorConfig sensorConfig,
                                WifiManager wifiManager,
                                @Named("wifiSensorEnableRequester")SensorEnableRequester sensorEnableRequester,
                                @Named("fineLocationPermissionChecker") PermissionChecker permissionChecker,
                                @Named("wifiSensorChecker")SensorChecker sensorChecker,
                                SensorRequirementChecker sensorRequirementChecker,
                                Context context){
    super(sensorConfig, sensorEnableRequester, permissionChecker, sensorChecker, sensorRequirementChecker);
    this.wifiManager = wifiManager;
    this.context = context;
}
项目:Re-Collector    文件:MessageBufferConfiguration.java   
@Inject
public MessageBufferConfiguration(Config config) {
    if (config.hasPath("message-buffer-size")) {
        this.size = config.getInt("message-buffer-size");
    } else {
        this.size = SIZE;
    }
}
项目:MDRXL    文件:GeraltWomanPhotosPresenter.java   
@Inject
GeraltWomanPhotosPresenter(final RxLoaderManager loaderManager,
                           final GeraltWomanPhotoLoaderFactory loaderFactory,
                           final CommandStarter commandStarter,
                           final MessageFactory messageFactory,
                           final ResourcesManager resourcesManager,
                           @WomanId final long womanId) {
    super(loaderManager);
    this.loaderFactory = loaderFactory;
    this.commandStarter = commandStarter;
    this.messageFactory = messageFactory;
    this.resourcesManager = resourcesManager;
    this.womanId = womanId;
}
项目:Nird2    文件:IntroducerManager.java   
@Inject
IntroducerManager(MessageSender messageSender, ClientHelper clientHelper,
        Clock clock, CryptoComponent cryptoComponent,
        IntroductionGroupFactory introductionGroupFactory) {

    this.messageSender = messageSender;
    this.clientHelper = clientHelper;
    this.clock = clock;
    this.cryptoComponent = cryptoComponent;
    this.introductionGroupFactory = introductionGroupFactory;
}
项目:gitplex-mit    文件:DefaultPullRequestReferenceManager.java   
@Inject
public DefaultPullRequestReferenceManager(Dao dao, UserManager userManager, 
        MarkdownManager markdownManager) {
    super(dao);
    this.markdownManager = markdownManager;
    this.userManager = userManager;
}
项目:eggs-android    文件:SplashInteractor.java   
@Inject
public SplashInteractor(@ApplicationContext Context context,
                        PreferencesHelper preferencesHelper,
                        ApiHelper apiHelper) {

    super(preferencesHelper, apiHelper);
    mContext = context;
}
项目:Nird2    文件:ForumControllerImpl.java   
@Inject
ForumControllerImpl(@DatabaseExecutor Executor dbExecutor,
        LifecycleManager lifecycleManager, IdentityManager identityManager,
        @CryptoExecutor Executor cryptoExecutor,
        ForumManager forumManager, ForumSharingManager forumSharingManager,
        EventBus eventBus, Clock clock, MessageTracker messageTracker,
        AndroidNotificationManager notificationManager) {
    super(dbExecutor, lifecycleManager, identityManager, cryptoExecutor,
            eventBus, clock, notificationManager, messageTracker);
    this.forumManager = forumManager;
    this.forumSharingManager = forumSharingManager;
}
项目:PicShow-zhaipin    文件:LoginPresenter.java   
@Inject
public LoginPresenter(LoginContract.Model model, LoginContract.View rootView
        , RxErrorHandler handler, Application application
        , ImageLoader imageLoader, AppManager appManager) {
    super(model, rootView);
    this.mErrorHandler = handler;
    this.mApplication = application;
    this.mImageLoader = imageLoader;
    this.mAppManager = appManager;
}
项目:ProjectAres    文件:MatchPlayerExecutor.java   
@Inject MatchPlayerExecutor(SyncExecutor syncExecutor, Match match, UUID uuid) {
    super(syncExecutor);
    this.uuid = uuid;

    if(!match.isUnloaded()) {
        this.match = match;
        this.match.registerEvents(this);
    }
}
项目:dagger-test-example    文件:TomorrowWeatherViewModel.java   
@Inject @Replaceable
public TomorrowWeatherViewModel(NavigationController navigation,
                                @RxObservable(PAGE) Observable<Integer> pageChangeObservable,
                                PermissionService permissionService,
                                LocationService locationService,
                                WeatherService weatherService,
                                TomorrowWeatherResponseFilter weatherParser,
                                @RxScheduler(MAIN) Scheduler androidScheduler) {
    super(navigation, pageChangeObservable, permissionService, locationService, weatherService, weatherParser, androidScheduler);
}
项目:OperatieBRP    文件:ReisdocumentStandaardMutatieVerwerker.java   
/**
 * Constructor.
 * @param mapper mapper
 * @param attribuutConverteerder attributen converteerder
 * @param historieNabewerking historie nabewerking
 */
@Inject
protected ReisdocumentStandaardMutatieVerwerker(
        final ReisdocumentMapper mapper,
        final BrpAttribuutConverteerder attribuutConverteerder,
        final PersoonReisdocumentHistorieNabewerking historieNabewerking) {
    super(mapper, new ReisdocumentConverteerder(attribuutConverteerder), attribuutConverteerder, historieNabewerking, ReisdocumentMapper.GROEP_ELEMENT,
            LOGGER);
}
项目:fernet-java8    文件:RedisKeyRepository.java   
/**
 * @param pool connection to Redis
 */
@Inject
public RedisKeyRepository(final JedisPool pool) {
    if (pool == null) {
        throw new IllegalArgumentException("pool cannot be null");
    }
    this.pool = pool;
}
项目:SimpleCalculator    文件:CalculatorPresenterImpl.java   
@Inject
CalculatorPresenterImpl(CalculateOperationsInteractor interactorCalculateOperations,
                        CharactersValidator validator,
                        StringTransformator transformator,
                        ParseInputInteractor interactorParseInput) {
    this.interactorCalculations = interactorCalculateOperations;
    this.interactorParseInput = interactorParseInput;
    this.validator = validator;
    this.transformator = transformator;
}
项目:Re-Collector    文件:DatabaseInputConfiguration.java   
@Inject
public DatabaseInputConfiguration(@Assisted String id,
                                  @Assisted Config config,
                                  DatabaseInput.Factory inputFactory) {
    super(id, config);
    this.inputFactory = inputFactory;
    if (config.hasPath("db-driver")) {
        this.dbDriver = config.getString("db-driver");
    }
    if (config.hasPath("db-connection-url")) {
        this.dbConnectionUrl = config.getString("db-connection-url");
    }
    if (config.hasPath("sql")) {
        this.sql = config.getString("sql");
    }
    if (config.hasPath("key-type")) {
        this.keytype = config.getString("key-type");
    }
    if (config.hasPath("id-field")) {
        this.idfield = config.getString("id-field");
    }
    if (config.hasPath("db-driver-path")) {
        this.dbDriverPath = config.getString("db-driver-path");
    }
    if (config.hasPath("init-sql")) {
        this.initSql = config.getString("init-sql");
    }
    if (config.hasPath("db-user")) {
        this.dbUser = config.getString("db-user");
    }
    if (config.hasPath("db-password")) {
        this.dbPassword = config.getString("db-password");
    }
    if (config.hasPath("db-sync-time")) {
        this.dbSyncTime = config.getInt("db-sync-time");
    } else {
        this.dbSyncTime = 1;
    }
}
项目:server-vot    文件:AddMachineRouter.java   
@Inject
public AddMachineRouter(ServiceResponse serviceResponse,
                        AddMachineService service, EndpointProtector protector) {
    super(serviceResponse);
    this.service = service;
    this.protector = protector;
}
项目:Lagerta    文件:SubscriberConsumer.java   
@Inject
public SubscriberConsumer(
    LeadService lead,
    Serializer serializer,
    Committer committer,
    TransactionsBuffer buffer,
    DoneNotifier doneNotifier,
    FullCommitHandler fullCommitHandler,
    DeserializerClosure deserializerClosure,
    BufferOverflowCondition bufferOverflowCondition,
    KafkaFactory kafkaFactory,
    DataRecoveryConfig dataRecoveryConfig,
    @Named(DataCapturerBusConfiguration.NODE_ID) UUID consumerId,
    OnKafkaStop onKafkaStop
) {
    this.lead = lead;
    this.serializer = serializer;
    this.committer = committer;
    this.buffer = buffer;
    this.doneNotifier = doneNotifier.setBuffer(buffer);
    this.fullCommitHandler = fullCommitHandler.setBuffer(buffer);
    this.deserializerClosure = deserializerClosure.setBuffer(buffer);
    this.bufferOverflowCondition = bufferOverflowCondition;
    consumer = kafkaFactory.consumer(dataRecoveryConfig.getConsumerConfig(), onKafkaStop);

    this.consumerId = consumerId;
    remoteTopic = dataRecoveryConfig.getRemoteTopic();
    reconciliationTopic = dataRecoveryConfig.getReconciliationTopic();
}
项目:ProjectAres    文件:MatchExecutor.java   
@Inject MatchExecutor(SyncExecutor executor, Match match) {
    super(executor);

    if(!match.isUnloaded()) {
        this.match = match;
        this.match.registerEvents(this);
    }
}
项目:ProjectAres    文件:DynamicScheduler.java   
@Inject DynamicScheduler(Match match, FeatureDefinitionContext fdc) {
    this.match = match;

    // Process dynamics in lexical order
    final Comparator<Dynamic> order = Comparator.comparing(Dynamic::getDefinition, fdc);
    this.clearQueue = new PriorityQueue<>(order);
    this.placeQueue = new PriorityQueue<>(order);
}
项目:mvvm-template    文件:FeedViewModel.java   
@Inject
public FeedViewModel(UserManager userManager, FeedRepo repo, UserRestService userRestService) {
    super(userManager);
    this.userRestService = userRestService;
    this.feedRepo = repo;
    refresh(300);
}
项目:fpm    文件:Maneuvers.java   
@Inject
public Maneuvers(MpDbf mpDbf, MnDbf mnDbf) {
    Map<Long, List<ManeuverPath>> mpById = mpDbf.paths().stream().sorted(Comparator.comparing(ManeuverPath::getSeqnr)).collect(groupingBy(ManeuverPath::getId));
    for (Maneuver maneuver : mnDbf.maneuvers()) {
        List<ManeuverPath> path = mpById.get(maneuver.getId());
        List<Long> segments = path.stream().map(ManeuverPath::getTrpelId).collect(toList());
        checkState(segments.size() > 1);
        restrictionRoadIds.addAll(segments);
        restrictions.add(new Restriction(segments, maneuver.getJunctionId()));
    }
    log.info("{} maneuvers found", restrictions.size());
}
项目:Equella    文件:BulkMoveContentOperation.java   
@Inject
public MoveContentOperationExecutor(@Assisted("courseId") String courseId,
    @Assisted("locationId") String locationId)
{
    this.courseId = courseId;
    this.locationId = locationId;
}
项目:ceidg-captcha    文件:CEIDGCaptchaMachineLearningRunner.java   
@Inject
public CEIDGCaptchaMachineLearningRunner(MultiLayerConfigurationFactory multiLayerConfigurationFactory,
                                         MachineLearningService machineLearningService,
                                         MultiLayerNetworkFactory multiLayerNetworkFactory,
                                         MultiLayerNetworkSaver multiLayerNetworkSaver) {
    this.multiLayerConfigurationFactory = multiLayerConfigurationFactory;
    this.machineLearningService = machineLearningService;
    this.multiLayerNetworkFactory = multiLayerNetworkFactory;
    this.multiLayerNetworkSaver = multiLayerNetworkSaver;
}
项目:dragoman    文件:VertxSubscriptionManager.java   
@Inject
public VertxSubscriptionManager(
    Vertx vertx, DatasetDao datasetDao, Reader reader, AsOfFactory asOfFactory) {
  this.vertx = vertx;
  this.datasetDao = datasetDao;
  this.reader = reader;
  this.asOfFactory = asOfFactory;
  this.subscriptions = new ConcurrentHashMap<>();
  this.executor = vertx.createSharedWorkerExecutor("subscription-manager");
}
项目:Equella    文件:DownloadPackageViewer.java   
@Inject
public void setPluginService(PluginService pluginService)
{
    downloadLink = new PluginTracker<ItemUrlExtender>(pluginService,
        "com.tle.web.viewitem.treeviewer", "downloadLink", "id");
    downloadLink.setBeanKey("class");
}
项目:verify-hub    文件:CountriesResource.java   
@Inject
public CountriesResource(
        ConfigEntityDataRepository<CountriesConfigEntityData> countriesConfigEntityDataRepository,
        ExceptionFactory exceptionFactory
) {
    this.countriesConfigEntityDataRepository = countriesConfigEntityDataRepository;
    this.exceptionFactory = exceptionFactory;
}
项目:webpoll    文件:RepositoryFactoryImpl.java   
@Inject
public RepositoryFactoryImpl(Instance<SurveyRepository> surveyRepository,
                             Instance<UserRepository> userRepository,
                             Instance<ResponseRepository> responseRepository) {
    this.surveyRepository = surveyRepository;
    this.userRepository = userRepository;
    this.responseRepository = responseRepository;
}
项目:oscm    文件:SubscriptionServiceMockBase.java   
static void mockInjects(Object instance) throws Exception {
    for (Field f : instance.getClass().getDeclaredFields()) {
        Inject injected = f.getAnnotation(Inject.class);
        if (injected != null) {
            Class<?> t = f.getType();
            f.set(instance, mock(t));
        }
    }
}
项目:beadledom    文件:ShutdownHookModule.java   
@Inject
public SystemShutdownHook(final LifecycleShutdownManager shutdownManager) {
  Runtime.getRuntime().addShutdownHook(new Thread() {
    @Override
    public void run() {
      shutdownManager.shutdown();
    }
  });
}
项目:ProjectAres    文件:MapLogger.java   
@Inject MapLogger(@Assisted MapDefinition map, MapdevLogger mapdevLogger) {
    super(mapdevLogger.getName() + "." + map.getDottedPath(), null);
    this.map = map;
    setParent(mapdevLogger);
    setUseParentHandlers(true);
}
项目:mvparms    文件:ImageLoader.java   
@Inject //通过注解进行初始化
public ImageLoader(BaseImageLoaderStrategy strategy) {
    setLoadImgStrategy(strategy);
}
项目:webpoll    文件:SurveyOverviewServiceImpl.java   
@Inject
public SurveyOverviewServiceImpl(RepositoryFactory repositoryFactory, SecurityAdapter securityAdapter) {
    this.repositoryFactory = repositoryFactory;
    this.securityAdapter = securityAdapter;
}
项目:open-kilda    文件:KafkaConfig.java   
@Inject
public KafkaConfig(@Named("kafka.host") String host, @Named("kafka.port") Integer port) {
    this.host = host;
    this.port = port;
}
项目:Reer    文件:DefaultSettings.java   
@Inject
public PluginManagerInternal getPluginManager() {
    throw new UnsupportedOperationException();
}
项目:dagger2-sample    文件:AddMenuBalancePresenter2.java   
@Inject
AddMenuBalancePresenter2(IAddMenuBalanceView view, MenuBalanceRepository2 mMenuBalanceRepository) {
    this.mView = view;
    this.mMenuBalanceRepository = mMenuBalanceRepository;
}
项目:bitflyer4j    文件:Bitflyer4jImpl.java   
@Inject
public Bitflyer4jImpl(Injector i) {

    injector = i;

    environment = injector.getInstance(Environment.class);

    marketService = injector.getInstance(MarketService.class);

    accountService = injector.getInstance(AccountService.class);

    orderService = injector.getInstance(OrderService.class);

    realtimeService = injector.getInstance(RealtimeService.class);

    log.info("Initialized : {} - {}", getVersion(), getSite());

}