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


Java Inject類代碼示例

本文整理匯總了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();
        }
    });
}
 
開發者ID:bunnyblue,項目名稱:NoticeDog,代碼行數:17,代碼來源:OverlayNotificationController.java

示例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));
		}
	}
}
 
開發者ID:quqiangsheng,項目名稱:abhot,代碼行數:17,代碼來源:HealthCheckServiceImpl.java

示例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()));
            }
        }
    }
}
 
開發者ID:lemonJun,項目名稱:TakinRPC,代碼行數:17,代碼來源:TccProvider.java

示例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"));
}
 
開發者ID:convertigo,項目名稱:convertigo-che-assembly,代碼行數:17,代碼來源:TextEditorsViewExtension.java

示例5: FixedCertificateChainValidator

import com.google.inject.Inject; //導入依賴的package包/類
@Inject
public FixedCertificateChainValidator(
        KeyStore trustStore,
        CertificateChainValidator certificateChainValidator) {
    this.trustStore = trustStore;
    this.certificateChainValidator = certificateChainValidator;
}
 
開發者ID:alphagov,項目名稱:verify-matching-service-adapter,代碼行數:8,代碼來源:FixedCertificateChainValidator.java

示例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());
}
 
開發者ID:eclipse,項目名稱:gemoc-studio,代碼行數:15,代碼來源:DslSyntacticSequencer.java

示例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");
}
 
開發者ID:dbiir,項目名稱:paraflow,代碼行數:11,代碼來源:HDFSSplitManager.java

示例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();
}
 
開發者ID:bunnyblue,項目名稱:NoticeDog,代碼行數:13,代碼來源:NotificationManager.java

示例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;
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:10,代碼來源:DictionaryFileRequestCallback.java

示例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;
}
 
開發者ID:MineboxOS,項目名稱:minebox,代碼行數:10,代碼來源:NbdServer.java

示例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);
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:14,代碼來源:DataSourceManager.java

示例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");
}
 
開發者ID:prestodb,項目名稱:presto-manager,代碼行數:8,代碼來源:PrestoInformer.java

示例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();
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:13,代碼來源:ModuleFeedbackProcessor.java

示例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));
}
 
開發者ID:geowe,項目名稱:sig-seguimiento-vehiculos,代碼行數:9,代碼來源:GraticuleTool.java

示例15: MetaDataStatusProvider

import com.google.inject.Inject; //導入依賴的package包/類
@Inject
public MetaDataStatusProvider(
        @Named("parentDirs") List<String> parentDir,
        SerialNumberService serialNumberService) {

    this.parentDirs = parentDir;
    this.serialNumberService = serialNumberService;
}
 
開發者ID:MineboxOS,項目名稱:tools,代碼行數:9,代碼來源:MetaDataStatus.java


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