Java Code Examples for com.google.inject.Inject

The following are top voted examples for showing how to use com.google.inject.Inject. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: NoticeDog   File: OverlayNotificationController.java   View source code 6 votes vote down vote up
@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();
        }
    });
}
 
Example 2
Project: abhot   File: HealthCheckServiceImpl.java   View source code 6 votes vote down vote up
@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));
		}
	}
}
 
Example 3
Project: TakinRPC   File: TccProvider.java   View source code 6 votes vote down vote up
@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()));
            }
        }
    }
}
 
Example 4
Project: convertigo-che-assembly   File: TextEditorsViewExtension.java   View source code 6 votes vote down vote up
@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"));
}
 
Example 5
Project: verify-matching-service-adapter   File: FixedCertificateChainValidator.java   View source code 5 votes vote down vote up
@Inject
public FixedCertificateChainValidator(
        KeyStore trustStore,
        CertificateChainValidator certificateChainValidator) {
    this.trustStore = trustStore;
    this.certificateChainValidator = certificateChainValidator;
}
 
Example 6
Project: gemoc-studio   File: DslSyntacticSequencer.java   View source code 5 votes vote down vote up
@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());
}
 
Example 7
Project: paraflow   File: HDFSSplitManager.java   View source code 5 votes vote down vote up
@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");
}
 
Example 8
Project: NoticeDog   File: NotificationManager.java   View source code 5 votes vote down vote up
@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();
}
 
Example 9
Project: empiria.player   File: DictionaryFileRequestCallback.java   View source code 5 votes vote down vote up
@Inject
public DictionaryFileRequestCallback(@Assisted int index, ExplanationListener explanationListener,
                                     EntryFactory entryFactory, Logger logger) {

    this.index = index;
    this.explanationListener = explanationListener;
    this.entryFactory = entryFactory;
    this.logger = logger;
}
 
Example 10
Project: minebox   File: NbdServer.java   View source code 5 votes vote down vote up
@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;
}
 
Example 11
Project: empiria.player   File: DataSourceManager.java   View source code 5 votes vote down vote up
@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);
}
 
Example 12
Project: presto-manager   File: PrestoInformer.java   View source code 5 votes vote down vote up
@Inject
PrestoInformer(Client client, PrestoConfig config)
{
    this.client = requireNonNull(client);
    this.configFile = requireNonNull(config.getConfigDirectory())
            .resolve("config.properties");
}
 
Example 13
Project: empiria.player   File: ModuleFeedbackProcessor.java   View source code 5 votes vote down vote up
@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();
}
 
Example 14
Project: sig-seguimiento-vehiculos   File: GraticuleTool.java   View source code 5 votes vote down vote up
@Inject
public GraticuleTool(GeoMap geoMap) {
	super(UIMessages.INSTANCE.graticuleToolText(), ImageProvider.INSTANCE
			.graticule(), geoMap);
	setToolTipConfig(createTooltipConfig(
			UIMessages.INSTANCE.graticuleToolText(),
			UIMessages.INSTANCE.graticuleToolTip(), Side.LEFT));
}
 
Example 15
Project: tools   File: MetaDataStatus.java   View source code 5 votes vote down vote up
@Inject
public MetaDataStatusProvider(
        @Named("parentDirs") List<String> parentDir,
        SerialNumberService serialNumberService) {

    this.parentDirs = parentDir;
    this.serialNumberService = serialNumberService;
}
 
Example 16
Project: empiria.player   File: MenuPresenter.java   View source code 5 votes vote down vote up
@Inject
public MenuPresenter(MenuView view, MenuStyleNameConstants styleNameConstants) {
    this.view = view;
    this.styleNameConstants = styleNameConstants;
    isHidden = true;
    view.addClickHandler(createClickCommand());
}
 
Example 17
Project: OSWf-OSWorkflow-fork   File: SimulatorModel.java   View source code 5 votes vote down vote up
@Inject
public SimulatorModel(OSWfServiceAsync service) {
    this.service = service;

    currentPIIDMap = new HashMap<String,Long>();
    inputs = new HashMap<String,String>(); 
}
 
Example 18
Project: gw4e.project   File: DSLPoliciesSyntacticSequencer.java   View source code 5 votes vote down vote up
@Inject
protected void init(IGrammarAccess access) {
	grammarAccess = (DSLPoliciesGrammarAccess) access;
	match_Model_NEWLINETerminalRuleCall_0_1_0_a = new TokenAlias(true, true, grammarAccess.getModelAccess().getNEWLINETerminalRuleCall_0_1_0());
	match_Model_NEWLINETerminalRuleCall_1_a = new TokenAlias(true, true, grammarAccess.getModelAccess().getNEWLINETerminalRuleCall_1());
	match_Model___NEWLINETerminalRuleCall_0_0_0_a_CommentParserRuleCall_0_0_1__q = new GroupAlias(false, true, new TokenAlias(true, true, grammarAccess.getModelAccess().getNEWLINETerminalRuleCall_0_0_0()), new TokenAlias(false, false, grammarAccess.getModelAccess().getCommentParserRuleCall_0_0_1()));
	match_PathGeneratorStopCondition_WSTerminalRuleCall_5_a = new TokenAlias(true, true, grammarAccess.getPathGeneratorStopConditionAccess().getWSTerminalRuleCall_5());
	match_XBlockExpression_SemicolonKeyword_2_1_q = new TokenAlias(false, true, grammarAccess.getXBlockExpressionAccess().getSemicolonKeyword_2_1());
	match_XExpressionInClosure_SemicolonKeyword_1_1_q = new TokenAlias(false, true, grammarAccess.getXExpressionInClosureAccess().getSemicolonKeyword_1_1());
	match_XFunctionTypeRef___LeftParenthesisKeyword_0_0_RightParenthesisKeyword_0_2__q = new GroupAlias(false, true, new TokenAlias(false, false, grammarAccess.getXFunctionTypeRefAccess().getLeftParenthesisKeyword_0_0()), new TokenAlias(false, false, grammarAccess.getXFunctionTypeRefAccess().getRightParenthesisKeyword_0_2()));
	match_XImportDeclaration_SemicolonKeyword_2_q = new TokenAlias(false, true, grammarAccess.getXImportDeclarationAccess().getSemicolonKeyword_2());
	match_XParenthesizedExpression_LeftParenthesisKeyword_0_a = new TokenAlias(true, true, grammarAccess.getXParenthesizedExpressionAccess().getLeftParenthesisKeyword_0());
	match_XParenthesizedExpression_LeftParenthesisKeyword_0_p = new TokenAlias(true, false, grammarAccess.getXParenthesizedExpressionAccess().getLeftParenthesisKeyword_0());
}
 
Example 19
Project: Pogamut3   File: UT2004HSServer.java   View source code 5 votes vote down vote up
@Inject
public UT2004HSServer(UT2004AgentParameters params,
		IAgentLogger agentLogger, IComponentBus bus,
		SocketConnection connection, UT2004WorldView worldView, IAct act) {
	super(params, agentLogger, bus, connection, worldView, act);
	getWorldView().addEventListener(BeginMessage.class,
			myBeginMessageListener);
	getWorldView().addEventListener(EndMessage.class, myEndMessageListener);
	getWorldView().addEventListener(PlayerJoinsGame.class,
			myPlayerJoinsGameMessageListener);
	getWorldView().addEventListener(PlayerLeft.class,
			myPlayerLeftMessageListener);
	getWorldView().addObjectListener(PlayerMessage.class, myPlayerListener);

	level = new LevelGeometryModule(

	new IUT2004ServerProvider() {

		@Override
		public void killServer() {
		}

		@Override
		public UT2004Server getServer() {
			return UT2004HSServer.this;
		}
	}, getWorldView(), getLogger());
}
 
Example 20
Project: tools   File: NbdServer.java   View source code 5 votes vote down vote up
@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;
}
 
Example 21
Project: tools   File: StatusResource.java   View source code 5 votes vote down vote up
@Inject
public StatusResource(EncyptionKeyProvider encyptionKeyProvider
        , @Named("parentDirs") List<String> parentDirs
        , DownloadFactory downloadFactory
        , SerialNumberService serialNumberService) {

    this.encyptionKeyProvider = encyptionKeyProvider;
    this.parentDirs = parentDirs;
    this.downloadFactory = downloadFactory;
    this.serialNumberService = serialNumberService;
}
 
Example 22
Project: sig-seguimiento-vehiculos   File: AddLayerTool.java   View source code 5 votes vote down vote up
@Inject
public AddLayerTool(GeoMap geoMap) {
	super(UIMessages.INSTANCE.add(), ImageProvider.INSTANCE.addLayer());
	setToolTipConfig(createTooltipConfig(UIMessages.INSTANCE.add(),
			UIMessages.INSTANCE.addLayerToolTip(), Side.LEFT));
       
}
 
Example 23
Project: NoticeDog   File: SwipeViewManager.java   View source code 5 votes vote down vote up
@Inject
protected void start() throws Exception {
    super.start();
    Log.d(TAG, "start");
    constructRunnableSwitch();
    createSwipeLayoutView();
    createSwipeTabView();
    createLockscreenListener();
    this.receiver = new SwipeManagerReceiver();
    IntentFilter filter = new IntentFilter();
    filter.addAction(INTENT_ACTION_CMDS);
    filter.addAction("android.intent.action.CONFIGURATION_CHANGED");
    this.context.registerReceiver(this.receiver, filter);
}
 
Example 24
Project: empiria.player   File: VideoFullScreenMediaButton.java   View source code 5 votes vote down vote up
@Inject
public VideoFullScreenMediaButton(MediaStyleNameConstants styleNames, VideoFullScreenHelper fullScreenHelper, EventsBus eventsBus,
                                  Provider<VideoFullScreenMediaButton> buttonProvider, PageScopeFactory scopeFactory) {
    super(styleNames.QP_MEDIA_FULLSCREEN_BUTTON());

    this.fullScreenHelper = fullScreenHelper;
    this.eventsBus = eventsBus;
    this.buttonProvider = buttonProvider;
    this.scopeFactory = scopeFactory;
}
 
Example 25
Project: empiria.player   File: ModuleScopedLazyProvider.java   View source code 5 votes vote down vote up
@Inject
public ModuleScopedLazyProvider(Provider<T> instanceProvider, ModuleScopeStack moduleScopeStack) {
    this.instanceProvider = instanceProvider;
    this.moduleScopeStack = moduleScopeStack;

    currentTopContext = moduleScopeStack.getCurrentTopContext();
}
 
Example 26
Project: empiria.player   File: ExplorableImgWindowCanvas.java   View source code 5 votes vote down vote up
@Inject
public ExplorableImgWindowCanvas(TouchController touchController, TouchHandlerOnImageProvider touchHandlerOnImageProvider) {
    canvas = Canvas.createIfSupported();
    initWidget(uiBinder.createAndBindUi(this));
    context2d = canvas.getContext2d();
    this.touchController = touchController;
    touchHandlerInitializer = touchHandlerOnImageProvider.get();
}
 
Example 27
Project: ja-micro   File: SchemaMigrator.java   View source code 5 votes vote down vote up
@Inject
public SchemaMigrator(ServiceProperties props, DatabaseMigrationContributor hc,
                      ConnectionVerifier verifier, Flyway flyway) {
    this.serviceProps = props;
    this.healthCheck = hc;
    this.connectionVerifier = verifier;
    this.flyway = flyway;
}
 
Example 28
Project: mynlp   File: PlaceRecognition.java   View source code 5 votes vote down vote up
@Inject
public PlaceRecognition(PlaceDictionary placeDictionary, CoreDictionary coreDictionary) {
    this.personDictionary = placeDictionary;

    a_total_freq = placeDictionary.getTransformMatrixDictionary().getTotalFrequency(Z);
    defaultEnumFreqPair = new EnumFreqPair(Z, a_total_freq);

    place_word_id = coreDictionary.getWordID(CoreDictionary.TAG_PLACE);
    place_word_tag = CoreDictionary.TAG_PLACE;
    place_natureAttribute =
            coreDictionary.get(place_word_id);
}
 
Example 29
Project: sig-seguimiento-vehiculos   File: ZoomToSeletionTool.java   View source code 5 votes vote down vote up
@Inject
public ZoomToSeletionTool(final GeoMap geoMap, final LayerManagerWidget layerManager) {
	super(UIMessages.INSTANCE.zoomToSeletionToolText(),
			ImageProvider.INSTANCE.zoomToSelection(), layerManager);
	setToolTipConfig(createTooltipConfig(
			UIMessages.INSTANCE.zoomToSeletionToolText(),
			UIMessages.INSTANCE.zoomToSeletionToolTip(), Side.LEFT));
	this.geoMap = geoMap;
	setEnabled(false);
}
 
Example 30
Project: empiria.player   File: ChoiceModule.java   View source code 4 votes vote down vote up
@Inject
public ChoiceModule(ChoiceModuleStructure choiceStructure, @ModuleScoped ChoiceModuleModel moduleModel, @ModuleScoped ChoiceModulePresenter presenter) {
    this.choiceStructure = choiceStructure;
    this.moduleModel = moduleModel;
    this.presenter = presenter;
}
 
Example 31
Project: empiria.player   File: Instance.java   View source code 4 votes vote down vote up
@Inject
public Instance(Provider<T> provider) {
    this.provider = provider;
}
 
Example 32
Project: mynlp   File: NRDictionary.java   View source code 4 votes vote down vote up
@Inject
public NRDictionary(Environment environment) throws Exception {
    super(environment);
}
 
Example 33
Project: convertigo-che-assembly   File: CouchDBConnectorEditorProvider.java   View source code 4 votes vote down vote up
@Inject
public CouchDBConnectorEditorProvider(Provider<GraphicEditorsViewPresenter> graphicEditorsViewPesenter) {
    super(graphicEditorsViewPesenter, "couchDBConnectorEditor", "Couch DB Connector Editor");
}
 
Example 34
Project: angel   File: EnvironmentBlock.java   View source code 4 votes vote down vote up
@Inject
EnvironmentBlock(AMContext amctx) {
  amContext = amctx;
}
 
Example 35
Project: abhot   File: KairosDBJobFactory.java   View source code 4 votes vote down vote up
@Inject
public KairosDBJobFactory(Injector guice)
{
	this.guice = guice;
}
 
Example 36
Project: empiria.player   File: PositionInMediaStream.java   View source code 4 votes vote down vote up
@Inject
public PositionInMediaStream(MediaStyleNameConstants styleNames, ProgressUpdateLogic progressUpdateLogic, PageScopeFactory pageScopeFactory) {
    super(styleNames.QP_MEDIA_POSITIONINSTREAM());
    this.progressUpdateLogic = progressUpdateLogic;
    this.pageScopeFactory = pageScopeFactory;
}
 
Example 37
Project: Amicus   File: AmicusMagic.java   View source code 4 votes vote down vote up
@Inject
public AmicusMagic(@Nonnull final Game game) {
    super(game, "magic.conf");
}
 
Example 38
Project: abhot   File: CountAggregator.java   View source code 4 votes vote down vote up
@Inject
public CountAggregator(LongDataPointFactory dataPointFactory)
{
	m_dataPointFactory = dataPointFactory;
}
 
Example 39
Project: che-archetypes   File: SampleProjectType.java   View source code 4 votes vote down vote up
@Inject
public SampleProjectType() {
  super(X_PROJECT_TYPE_ID, "Sample Project Type", true, false, true);
  addConstantDefinition(LANGUAGE, "language", C_LANG);
  addVariableDefinition(COMPILER_VERSION_ATRIBUTE, "GCC compiler version", false);
}
 
Example 40
Project: angel   File: WorkerBlock.java   View source code 4 votes vote down vote up
@Inject
WorkerBlock(AMContext amctx) {
  amContext = amctx;
}