当前位置: 首页>>代码示例>>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;未经允许,请勿转载。