本文整理汇总了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());
}
示例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");
}
示例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();
});
}
示例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);
}
示例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);
}
});
}
示例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);
}
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例13: DefaultPullRequestReferenceManager
import javax.inject.Inject; //导入依赖的package包/类
@Inject
public DefaultPullRequestReferenceManager(Dao dao, UserManager userManager,
MarkdownManager markdownManager) {
super(dao);
this.markdownManager = markdownManager;
this.userManager = userManager;
}
示例14: SplashInteractor
import javax.inject.Inject; //导入依赖的package包/类
@Inject
public SplashInteractor(@ApplicationContext Context context,
PreferencesHelper preferencesHelper,
ApiHelper apiHelper) {
super(preferencesHelper, apiHelper);
mContext = context;
}
示例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;
}