本文整理匯總了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;
}