Examples of Injector


Examples of com.google.inject.Injector

     * @param sc {@link javax.servlet.ServletConfig}
     * @return true if Jersey classes are detected
     */
    @Override
    protected boolean detectSupportedFramework(ServletConfig sc) {
        Injector injector = (Injector) config.getServletContext().getAttribute(Injector.class.getName());
        GuiceContainer guiceServlet = injector.getInstance(GuiceContainer.class);

        setUseStreamForFlushingComments(false);
        ReflectorServletProcessor rsp = new ReflectorServletProcessor();
        setDefaultBroadcasterClassName(JERSEY_BROADCASTER);
        setUseStreamForFlushingComments(true);

        rsp.setServlet(guiceServlet);
        rsp.setFilterClassName(GUICE_FILTER);
        getAtmosphereConfig().setSupportSession(false);

        String mapping = sc.getInitParameter(PROPERTY_SERVLET_MAPPING);
        if (mapping == null) {
            mapping = "/*";
        }

        try {
            Map<String, String> props = injector.getInstance(
                    Key.get(new TypeLiteral<Map<String, String>>() {},Names.named(JERSEY_PROPERTIES)));


            if (props != null) {
                for (String p : props.keySet()) {
View Full Code Here

Examples of com.google.inject.Injector

     * @param sc {@link javax.servlet.ServletConfig}
     * @return true if Jersey classes are detected
     */
    @Override
    protected boolean detectSupportedFramework(ServletConfig sc) {
        Injector injector = (Injector) config.getServletContext().getAttribute(Injector.class.getName());
        GuiceContainer guiceServlet = injector.getInstance(GuiceContainer.class);

        setUseStreamForFlushingComments(false);
        ReflectorServletProcessor rsp = new ReflectorServletProcessor();
        setDefaultBroadcasterClassName(JERSEY_BROADCASTER);
        setUseStreamForFlushingComments(true);

        rsp.setServlet(guiceServlet);
        getAtmosphereConfig().setSupportSession(false);

        String mapping = sc.getInitParameter(PROPERTY_SERVLET_MAPPING);
        if (mapping == null) {
            mapping = "/*";
        }

        try {
            Map<String, String> props = injector.getInstance(
                    Key.get(new TypeLiteral<Map<String, String>>() {},Names.named(JERSEY_PROPERTIES)));


            if (props != null) {
                for (String p : props.keySet()) {
View Full Code Here

Examples of com.google.inject.Injector

    final JButton runButton = new JButton("Run", ImageManager.getInstance().getImageIcon("images/actions/execute.png"));
    runButton.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        Injector injector = Guice.createInjector(new DCModule(_parentModule, ajb) {
          @Override
          public String getJobFilename() {
            return "Save " + _table.getName() + " as Excel spreadsheet";
          }
        });

        ResultWindow window = injector.getInstance(ResultWindow.class);
        window.setVisible(true);
        dialog.dispose();
        window.startAnalysis();
      }
    });
View Full Code Here

Examples of com.google.inject.Injector

    _parentModule = parentModule;
  }

  @Override
  public void actionPerformed(ActionEvent e) {
    Injector injector = Guice.createInjector(new DCModule(_parentModule, null));
    injector.getInstance(AnalysisJobBuilderWindow.class).open();
  }
View Full Code Here

Examples of com.google.inject.Injector

    final JButton runButton = new JButton("Run", ImageManager.getInstance().getImageIcon("images/actions/execute.png"));
    runButton.addActionListener(new ActionListener() {

      @Override
      public void actionPerformed(ActionEvent e) {
        Injector injector = Guice.createInjector(new DCModule(_parentModule, ajb) {
          @Override
          public String getJobFilename() {
            return "Save " + _table.getName() + " as CSV file";
          }
        });

        ResultWindow window = injector.getInstance(ResultWindow.class);
        window.setVisible(true);
        dialog.dispose();
        window.startAnalysis();
      }
    });
View Full Code Here

Examples of com.google.inject.Injector

    try {
      if (!ajb.isConfigured(true)) {
        throw new IllegalStateException("Unknown job configuration issue!");
      }

      Injector injector = Guice.createInjector(new DCModule(_parentModule, ajb));

      RunAnalysisActionListener actionListener = injector.getInstance(RunAnalysisActionListener.class);
      actionListener.actionPerformed(event);
    } catch (Exception e) {
      WidgetUtils.showErrorMessage("Error", "Could not perform quick analysis on table " + _table.getName(), e);
    }
View Full Code Here

Examples of com.google.inject.Injector

    RowProcessingAnalyzerJobBuilder<ValueDistributionAnalyzer> groupedValueDist = ajb
        .addRowProcessingAnalyzer(ValueDistributionAnalyzer.class);
    groupedValueDist.addInputColumn(ajb.getSourceColumnByName("PUBLIC.CUSTOMERS.CITY"));
    groupedValueDist.setConfiguredProperty("Group column", ajb.getSourceColumnByName("PUBLIC.CUSTOMERS.COUNTRY"));

    Injector injector = Guice.createInjector(new DCModule(conf) {
      @Override
      public AnalysisJobBuilder getAnalysisJobBuilder() {
        return ajb;
      }
    });
   
    ResultWindow resultWindow = injector.getInstance(ResultWindow.class);
    resultWindow.setVisible(true);
    resultWindow.startAnalysis();
  }
View Full Code Here

Examples of com.google.inject.Injector

    ajb.addSourceColumns("PUBLIC.OFFICES.CITY", "PUBLIC.OFFICES.TERRITORY");
    groupedPatternFinder.addInputColumn(ajb.getSourceColumnByName("PUBLIC.OFFICES.CITY"));
    groupedPatternFinder.addInputColumn(ajb.getSourceColumnByName("PUBLIC.OFFICES.TERRITORY"), groupedPatternFinder
        .getDescriptor().getConfiguredProperty("Group column"));

    Injector injector = Guice.createInjector(new DCModule(conf) {
      @Override
      public AnalysisJobBuilder getAnalysisJobBuilder() {
        return ajb;
      }
    });

    ResultWindow resultWindow = injector.getInstance(ResultWindow.class);
    resultWindow.setVisible(true);
    resultWindow.startAnalysis();
  }
View Full Code Here

Examples of com.google.inject.Injector

import com.google.inject.Injector;

public class PropertyWidgetFactoryTest extends TestCase {

  public void testCreateAllPropertyTypes() throws Exception {
    Injector injector = Guice.createInjector(new DCModule(DCConfiguration.get()));

    AnalysisJobBuilder ajb = injector.getInstance(AnalysisJobBuilder.class);

    AnalyzerBeanDescriptor<ManyPropertiesAnalyzer> descriptor = Descriptors.ofAnalyzer(ManyPropertiesAnalyzer.class);

    assertEquals(24, descriptor.getConfiguredProperties().size());

    AbstractBeanJobBuilder<?, ?, ?> beanJobBuilder = ajb.addRowProcessingAnalyzer(descriptor);

    PropertyWidgetFactory propertyWidgetFactory = injector.getInstance(InjectorBuilder.class)
        .with(PropertyWidgetFactory.TYPELITERAL_BEAN_JOB_BUILDER, beanJobBuilder).createInjector()
        .getInstance(PropertyWidgetFactory.class);
    assertNotNull(propertyWidgetFactory);

    performAssertions(propertyWidgetFactory, "Int property", SingleNumberPropertyWidget.class, 0, 2);
View Full Code Here

Examples of com.google.inject.Injector

    popupBubble.attachTo(button);

    button.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent event) {
        Injector injectorWithNullDatastore = _injectorBuilder.with(datastoreClass, null).createInjector();
        AbstractFileBasedDatastoreDialog<D> dialog = injectorWithNullDatastore.getInstance(dialogClass);
        dialog.setVisible(true);
      }
    });
    return button;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.