當前位置: 首頁>>代碼示例>>Java>>正文


Java Inject類代碼示例

本文整理匯總了Java中javax.inject.Inject的典型用法代碼示例。如果您正苦於以下問題:Java Inject類的具體用法?Java Inject怎麽用?Java Inject使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Inject類屬於javax.inject包,在下文中一共展示了Inject類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: RateLimitedExecutor

import javax.inject.Inject; //導入依賴的package包/類
@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());

}
 
開發者ID:vy,項目名稱:hrrs,代碼行數:18,代碼來源:RateLimitedExecutor.java

示例2: setPluginService

import javax.inject.Inject; //導入依賴的package包/類
@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");
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:19,代碼來源:TLEAclManagerImpl.java

示例3: ServerTagger

import javax.inject.Inject; //導入依賴的package包/類
@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();
    });
}
 
開發者ID:OvercastNetwork,項目名稱:ProjectAres,代碼行數:21,代碼來源:ServerTagger.java

示例4: AnimationEditorComponent

import javax.inject.Inject; //導入依賴的package包/類
@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);
}
 
開發者ID:rmfisher,項目名稱:fx-animation-editor,代碼行數:18,代碼來源:AnimationEditorComponent.java

示例5: SimpleBookmarkStore

import javax.inject.Inject; //導入依賴的package包/類
/**
 * 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);
        }
    });
}
 
開發者ID:ProgrammingLife2017,項目名稱:hygene,代碼行數:39,代碼來源:SimpleBookmarkStore.java

示例6: MatchExecutor

import javax.inject.Inject; //導入依賴的package包/類
@Inject MatchExecutor(SyncExecutor executor, Match match) {
    super(executor);

    if(!match.isUnloaded()) {
        this.match = match;
        this.match.registerEvents(this);
    }
}
 
開發者ID:OvercastNetwork,項目名稱:ProjectAres,代碼行數:9,代碼來源:MatchExecutor.java

示例7: DynamicScheduler

import javax.inject.Inject; //導入依賴的package包/類
@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);
}
 
開發者ID:OvercastNetwork,項目名稱:ProjectAres,代碼行數:9,代碼來源:DynamicScheduler.java

示例8: FeedViewModel

import javax.inject.Inject; //導入依賴的package包/類
@Inject
public FeedViewModel(UserManager userManager, FeedRepo repo, UserRestService userRestService) {
    super(userManager);
    this.userRestService = userRestService;
    this.feedRepo = repo;
    refresh(300);
}
 
開發者ID:duyp,項目名稱:mvvm-template,代碼行數:8,代碼來源:FeedViewModel.java

示例9: WifiMeasurementsGatherer

import javax.inject.Inject; //導入依賴的package包/類
@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;
}
 
開發者ID:ubikgs,項目名稱:AndroidSensors,代碼行數:13,代碼來源:WifiMeasurementsGatherer.java

示例10: MessageBufferConfiguration

import javax.inject.Inject; //導入依賴的package包/類
@Inject
public MessageBufferConfiguration(Config config) {
    if (config.hasPath("message-buffer-size")) {
        this.size = config.getInt("message-buffer-size");
    } else {
        this.size = SIZE;
    }
}
 
開發者ID:DevOpsStudio,項目名稱:Re-Collector,代碼行數:9,代碼來源:MessageBufferConfiguration.java

示例11:

import javax.inject.Inject; //導入依賴的package包/類
@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;
}
 
開發者ID:dmitrikudrenko,項目名稱:MDRXL,代碼行數:15,代碼來源:GeraltWomanPhotosPresenter.java

示例12:

import javax.inject.Inject; //導入依賴的package包/類
@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;
}
 
開發者ID:rafjordao,項目名稱:Nird2,代碼行數:12,代碼來源:IntroducerManager.java

示例13: DefaultPullRequestReferenceManager

import javax.inject.Inject; //導入依賴的package包/類
@Inject
public DefaultPullRequestReferenceManager(Dao dao, UserManager userManager, 
		MarkdownManager markdownManager) {
	super(dao);
	this.markdownManager = markdownManager;
	this.userManager = userManager;
}
 
開發者ID:jmfgdev,項目名稱:gitplex-mit,代碼行數:8,代碼來源:DefaultPullRequestReferenceManager.java

示例14: SplashInteractor

import javax.inject.Inject; //導入依賴的package包/類
@Inject
public SplashInteractor(@ApplicationContext Context context,
                        PreferencesHelper preferencesHelper,
                        ApiHelper apiHelper) {

    super(preferencesHelper, apiHelper);
    mContext = context;
}
 
開發者ID:n1rocket,項目名稱:eggs-android,代碼行數:9,代碼來源:SplashInteractor.java

示例15:

import javax.inject.Inject; //導入依賴的package包/類
@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;
}
 
開發者ID:rafjordao,項目名稱:Nird2,代碼行數:13,代碼來源:ForumControllerImpl.java


注:本文中的javax.inject.Inject類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。