本文整理汇总了Java中com.google.inject.Inject类的典型用法代码示例。如果您正苦于以下问题:Java Inject类的具体用法?Java Inject怎么用?Java Inject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Inject类属于com.google.inject包,在下文中一共展示了Inject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import com.google.inject.Inject; //导入依赖的package包/类
@Inject
void init() {
this.notificationBarView = (OverlayNotificationBarView) ((LayoutInflater) this.context.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.overlay_notification_bar, null);
this.notificationTouchListener = new View(this.context);
this.notificationTouchListener.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
return OverlayNotificationController.this.notificationBarView.dispatchTouchEvent(event);
}
});
this.notificationBarView.addListener((Object) this, new NotificationViewListener() {
public void onNotificationViewClosed() {
OverlayNotificationController.this.removeFromWindow();
OverlayNotificationController.this.fireOnNotificationClosed();
}
});
}
示例2: HealthCheckServiceImpl
import com.google.inject.Inject; //导入依赖的package包/类
@Inject
public HealthCheckServiceImpl(Injector injector)
{
checkNotNull(injector);
Map<Key<?>, Binding<?>> bindings = injector.getAllBindings();
for (Key<?> key : bindings.keySet())
{
Class<?> bindingClass = key.getTypeLiteral().getRawType();
if (HealthStatus.class.isAssignableFrom(bindingClass))
{
checks.add((HealthStatus) injector.getInstance(bindingClass));
}
}
}
示例3: TccProvider
import com.google.inject.Inject; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Inject
private TccProvider() {
ServiceInfos serviceInfos = GuiceDI.getInstance(Scaner.class).getContractInfo();
List<SessionBean> sessionBeanList = serviceInfos.getSessionBeanList();
if (CollectionUtil.isNotEmpty(sessionBeanList)) {
for (SessionBean bean : sessionBeanList) {
logger.info(JSON.toJSONString(bean));
if (bean.getImplClass().getCls().isAnnotationPresent(Compensable.class)) {
Compensable compenanno = (Compensable) bean.getImplClass().getCls().getAnnotation(Compensable.class);
logger.info(JSON.toJSONString(compenanno));
compenMap.put(compenanno.interfaceClass(), new Tcc(compenanno.cancellableKey(), compenanno.confirmableKey()));
}
}
}
}
示例4: configureActions
import com.google.inject.Inject; //导入依赖的package包/类
@Inject
private void configureActions(
final ActionManager actionManager,
final ActiveTextEditorsAction activeTextEditorsAction,
final MultipleMethodFileIdentifier multipleMethodFileIdentifier) {
actionManager.registerAction(ActiveTextEditorsAction.ACTION_ID, activeTextEditorsAction);
final List<String> contentTypes = makeList("application/javascript", "text/javascript");
// Add JS highlight and completion
multipleMethodFileIdentifier.registerNewExtension(TextEditorsPrefix.C8O_JSCRIPT_STEP_EDITOR, contentTypes);
multipleMethodFileIdentifier.registerNewExtension(TextEditorsPrefix.C8O_JSCRIPT_TRANSACTION_EDITOR, contentTypes);
// For the moment, add XMl highlight for xsl files
multipleMethodFileIdentifier.registerNewExtension("xsl", makeList("application/xml"));
}
示例5: FixedCertificateChainValidator
import com.google.inject.Inject; //导入依赖的package包/类
@Inject
public FixedCertificateChainValidator(
KeyStore trustStore,
CertificateChainValidator certificateChainValidator) {
this.trustStore = trustStore;
this.certificateChainValidator = certificateChainValidator;
}
示例6: init
import com.google.inject.Inject; //导入依赖的package包/类
@Inject
protected void init(IGrammarAccess access) {
grammarAccess = (DslGrammarAccess) access;
match_Dsl_LineFeedKeyword_7_q = new TokenAlias(false, true, grammarAccess.getDslAccess().getLineFeedKeyword_7());
match_Dsl_SPACETerminalRuleCall_0_a = new TokenAlias(true, true, grammarAccess.getDslAccess().getSPACETerminalRuleCall_0());
match_Dsl_SPACETerminalRuleCall_2_a = new TokenAlias(true, true, grammarAccess.getDslAccess().getSPACETerminalRuleCall_2());
match_Dsl_SPACETerminalRuleCall_4_a = new TokenAlias(true, true, grammarAccess.getDslAccess().getSPACETerminalRuleCall_4());
match_Dsl_SPACETerminalRuleCall_6_a = new TokenAlias(true, true, grammarAccess.getDslAccess().getSPACETerminalRuleCall_6());
match_Entry_LineFeedKeyword_7_q = new TokenAlias(false, true, grammarAccess.getEntryAccess().getLineFeedKeyword_7());
match_Entry_SPACETerminalRuleCall_0_a = new TokenAlias(true, true, grammarAccess.getEntryAccess().getSPACETerminalRuleCall_0());
match_Entry_SPACETerminalRuleCall_2_a = new TokenAlias(true, true, grammarAccess.getEntryAccess().getSPACETerminalRuleCall_2());
match_Entry_SPACETerminalRuleCall_4_a = new TokenAlias(true, true, grammarAccess.getEntryAccess().getSPACETerminalRuleCall_4());
match_Entry_SPACETerminalRuleCall_6_a = new TokenAlias(true, true, grammarAccess.getEntryAccess().getSPACETerminalRuleCall_6());
}
示例7: HDFSSplitManager
import com.google.inject.Inject; //导入依赖的package包/类
@Inject
public HDFSSplitManager(
HDFSConnectorId connectorId,
MetaDataQuery metaDataQuer,
FSFactory fsFactory)
{
this.connectorId = requireNonNull(connectorId, "connectorId is null");
this.metaDataQuer = requireNonNull(metaDataQuer, "metaServer is null");
this.fsFactory = requireNonNull(fsFactory, "fsFactory is null");
}
示例8: start
import com.google.inject.Inject; //导入依赖的package包/类
@Inject
private void start() {
this.receiver = new NotificationManagerReceiver();
IntentFilter filter = new IntentFilter();
filter.addAction(NotificationService.INTENT_ACTION_EVENTS);
this.context.registerReceiver(this.receiver, filter);
this.keepNotificationsInDrawer = this.settings.getKeepNotificationsInDrawer();
this.settings.registerSettingChangeListener(this);
this.processors = this.appManager.getNotificationFilters();
this.appManager.addListener(this);
checkIfNotificationSerivceIsRunning();
}
示例9: DictionaryFileRequestCallback
import com.google.inject.Inject; //导入依赖的package包/类
@Inject
public DictionaryFileRequestCallback(@Assisted int index, ExplanationListener explanationListener,
EntryFactory entryFactory, Logger logger) {
this.index = index;
this.explanationListener = explanationListener;
this.entryFactory = entryFactory;
this.logger = logger;
}
示例10: NbdServer
import com.google.inject.Inject; //导入依赖的package包/类
@VisibleForTesting
@Inject
public NbdServer(MinebdConfig config, SystemdUtil systemdUtil, ExportProvider exportProvider, EncyptionKeyProvider encyptionKeyProvider) {
this.port = config.nbdPort;
this.config = config;
this.systemdUtil = systemdUtil;
this.exportProvider = exportProvider;
this.encyptionKeyProvider = encyptionKeyProvider;
}
示例11: DataSourceManager
import com.google.inject.Inject; //导入依赖的package包/类
@Inject
public DataSourceManager(AssessmentDataSourceManager assessmentDataManager, ItemDataSourceCollectionManager itemDataCollectionManager,
StyleDataSourceLoader styleDataSourceLoader, ContentPreloader contentPreloader) {
this.assessmentDataManager = assessmentDataManager;
this.assessmentDataManager.setSkinListener(this);
this.itemDataCollectionManager = itemDataCollectionManager;
this.styleDataSourceLoader = styleDataSourceLoader;
this.contentPreloader = contentPreloader;
mode = DataSourceManagerMode.NONE;
itemDataCollectionManager.setLoaderEventListener(this);
libraryLoader = new LibraryLoader(this);
}
示例12: requireNonNull
import com.google.inject.Inject; //导入依赖的package包/类
@Inject
PrestoInformer(Client client, PrestoConfig config)
{
this.client = requireNonNull(client);
this.configFile = requireNonNull(config.getConfigDirectory())
.resolve("config.properties");
}
示例13: ModuleFeedbackProcessor
import com.google.inject.Inject; //导入依赖的package包/类
@Inject
public ModuleFeedbackProcessor(@Assisted InlineBodyGeneratorSocket inlineBodyGeneratorSocket, FeedbackRegistry feedbackRegistry,
FeedbackConditionMatcher matcher, SoundActionProcessor soundProcessor, FeedbackPropertiesCollector propertiesCollector,
Provider<FeedbackActionCollector> feedbackActionCollectorProvider) {
this.inlineBodyGeneratorSocket = inlineBodyGeneratorSocket;
this.feedbackRegistry = feedbackRegistry;
this.matcher = matcher;
this.soundProcessor = soundProcessor;
this.propertiesCollector = propertiesCollector;
this.feedbackActionCollectorProvider = feedbackActionCollectorProvider;
initializeFeedbackActionCollector();
}
示例14: GraticuleTool
import com.google.inject.Inject; //导入依赖的package包/类
@Inject
public GraticuleTool(GeoMap geoMap) {
super(UIMessages.INSTANCE.graticuleToolText(), ImageProvider.INSTANCE
.graticule(), geoMap);
setToolTipConfig(createTooltipConfig(
UIMessages.INSTANCE.graticuleToolText(),
UIMessages.INSTANCE.graticuleToolTip(), Side.LEFT));
}
示例15: MetaDataStatusProvider
import com.google.inject.Inject; //导入依赖的package包/类
@Inject
public MetaDataStatusProvider(
@Named("parentDirs") List<String> parentDir,
SerialNumberService serialNumberService) {
this.parentDirs = parentDir;
this.serialNumberService = serialNumberService;
}