@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()); }
@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"); }
@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(); }); }
@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); }
/** * 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); } }); }
@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; }
@Inject public MessageBufferConfiguration(Config config) { if (config.hasPath("message-buffer-size")) { this.size = config.getInt("message-buffer-size"); } else { this.size = SIZE; } }
@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; }
@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; }
@Inject public DefaultPullRequestReferenceManager(Dao dao, UserManager userManager, MarkdownManager markdownManager) { super(dao); this.markdownManager = markdownManager; this.userManager = userManager; }
@Inject public SplashInteractor(@ApplicationContext Context context, PreferencesHelper preferencesHelper, ApiHelper apiHelper) { super(preferencesHelper, apiHelper); mContext = context; }
@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; }
@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; }
@Inject MatchPlayerExecutor(SyncExecutor syncExecutor, Match match, UUID uuid) { super(syncExecutor); this.uuid = uuid; if(!match.isUnloaded()) { this.match = match; this.match.registerEvents(this); } }
@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); }
/** * 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); }
/** * @param pool connection to Redis */ @Inject public RedisKeyRepository(final JedisPool pool) { if (pool == null) { throw new IllegalArgumentException("pool cannot be null"); } this.pool = pool; }
@Inject CalculatorPresenterImpl(CalculateOperationsInteractor interactorCalculateOperations, CharactersValidator validator, StringTransformator transformator, ParseInputInteractor interactorParseInput) { this.interactorCalculations = interactorCalculateOperations; this.interactorParseInput = interactorParseInput; this.validator = validator; this.transformator = transformator; }
@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; } }
@Inject public AddMachineRouter(ServiceResponse serviceResponse, AddMachineService service, EndpointProtector protector) { super(serviceResponse); this.service = service; this.protector = protector; }
@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(); }
@Inject MatchExecutor(SyncExecutor executor, Match match) { super(executor); if(!match.isUnloaded()) { this.match = match; this.match.registerEvents(this); } }
@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); }
@Inject public FeedViewModel(UserManager userManager, FeedRepo repo, UserRestService userRestService) { super(userManager); this.userRestService = userRestService; this.feedRepo = repo; refresh(300); }
@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()); }
@Inject public MoveContentOperationExecutor(@Assisted("courseId") String courseId, @Assisted("locationId") String locationId) { this.courseId = courseId; this.locationId = locationId; }
@Inject public CEIDGCaptchaMachineLearningRunner(MultiLayerConfigurationFactory multiLayerConfigurationFactory, MachineLearningService machineLearningService, MultiLayerNetworkFactory multiLayerNetworkFactory, MultiLayerNetworkSaver multiLayerNetworkSaver) { this.multiLayerConfigurationFactory = multiLayerConfigurationFactory; this.machineLearningService = machineLearningService; this.multiLayerNetworkFactory = multiLayerNetworkFactory; this.multiLayerNetworkSaver = multiLayerNetworkSaver; }
@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"); }
@Inject public void setPluginService(PluginService pluginService) { downloadLink = new PluginTracker<ItemUrlExtender>(pluginService, "com.tle.web.viewitem.treeviewer", "downloadLink", "id"); downloadLink.setBeanKey("class"); }
@Inject public CountriesResource( ConfigEntityDataRepository<CountriesConfigEntityData> countriesConfigEntityDataRepository, ExceptionFactory exceptionFactory ) { this.countriesConfigEntityDataRepository = countriesConfigEntityDataRepository; this.exceptionFactory = exceptionFactory; }
@Inject public RepositoryFactoryImpl(Instance<SurveyRepository> surveyRepository, Instance<UserRepository> userRepository, Instance<ResponseRepository> responseRepository) { this.surveyRepository = surveyRepository; this.userRepository = userRepository; this.responseRepository = responseRepository; }
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)); } } }
@Inject public SystemShutdownHook(final LifecycleShutdownManager shutdownManager) { Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { shutdownManager.shutdown(); } }); }
@Inject MapLogger(@Assisted MapDefinition map, MapdevLogger mapdevLogger) { super(mapdevLogger.getName() + "." + map.getDottedPath(), null); this.map = map; setParent(mapdevLogger); setUseParentHandlers(true); }
@Inject //通过注解进行初始化 public ImageLoader(BaseImageLoaderStrategy strategy) { setLoadImgStrategy(strategy); }
@Inject public SurveyOverviewServiceImpl(RepositoryFactory repositoryFactory, SecurityAdapter securityAdapter) { this.repositoryFactory = repositoryFactory; this.securityAdapter = securityAdapter; }
@Inject public KafkaConfig(@Named("kafka.host") String host, @Named("kafka.port") Integer port) { this.host = host; this.port = port; }
@Inject public PluginManagerInternal getPluginManager() { throw new UnsupportedOperationException(); }
@Inject AddMenuBalancePresenter2(IAddMenuBalanceView view, MenuBalanceRepository2 mMenuBalanceRepository) { this.mView = view; this.mMenuBalanceRepository = mMenuBalanceRepository; }
@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()); }