Package com.google.inject

Examples of com.google.inject.Injector


  // Constructor, initializes the 2 MultiPolygon geometries:
  // -------------------------------------------------------------------------

  @Before
  public void setUp() {
    Injector myInjector = Guice.createInjector(new GeomajasTestModule());
    gwtFactory = myInjector.getInstance(GeometryFactory.class);
    LinearRing gwtRing1 = gwtFactory.createLinearRing(new Coordinate[] { new Coordinate(10.0, 10.0),
        new Coordinate(20.0, 10.0), new Coordinate(20.0, 20.0), new Coordinate(10.0, 10.0) });
    Polygon gwtPolygon1 = gwtFactory.createPolygon(gwtRing1, null);
    LinearRing gwtRing2 = gwtFactory.createLinearRing(new Coordinate[] { new Coordinate(10.0, 20.0),
        new Coordinate(30.0, 10.0), new Coordinate(40.0, 10.0), new Coordinate(10.0, 20.0) });
View Full Code Here


  // Constructor, initializes the 2 MultiLineString geometries:
  // -------------------------------------------------------------------------

  @Before
  public void setUp() {
    Injector myInjector = Guice.createInjector(new GeomajasTestModule());
    gwtFactory = myInjector.getInstance(GeometryFactory.class);
    LineString gwtLine1 = gwtFactory.createLineString(new Coordinate[] { new Coordinate(10.0, 10.0),
        new Coordinate(20.0, 10.0), new Coordinate(20.0, 20.0) });
    LineString gwtLine2 = gwtFactory.createLineString(new Coordinate[] { new Coordinate(10.0, 20.0),
        new Coordinate(30.0, 10.0), new Coordinate(40.0, 10.0) });
    gwt = gwtFactory.createMultiLineString(new LineString[] { gwtLine1, gwtLine2 });
View Full Code Here

  private GeometryFactory factory;

  @Before
  public void setUp() {
    Injector myInjector = Guice.createInjector(new GeomajasTestModule());
    factory = myInjector.getInstance(GeometryFactory.class);
    empty = factory.createBbox(0, 0, 0, 0);
    origin = factory.createBbox(0, 0, 10, 10);
    movedEmpty = factory.createBbox(-10, -10, 0, 0);
    movedEmpty2 = factory.createBbox(5, 5, 0, 0);
    normal = factory.createBbox(-5, -5, 20, 20);
View Full Code Here

  // Constructor, initializes the 2 point geometries:
  // -------------------------------------------------------------------------

  @Before
  public void setUp() {
    Injector myInjector = Guice.createInjector(new GeomajasTestModule());
    gwtFactory = myInjector.getInstance(GeometryFactory.class);
    Point point1 = gwtFactory.createPoint(new Coordinate(10.0, 10.0));
    Point point2 = gwtFactory.createPoint(new Coordinate(10.0, 20.0));
    Point point3 = gwtFactory.createPoint(new Coordinate(20.0, 20.0));
    gwt = gwtFactory.createMultiPoint(new Point[] {point1, point2, point3});
View Full Code Here

  // Constructor, initializes the 2 LineString geometries:
  // -------------------------------------------------------------------------

  @Before
  public void setUp() {
    Injector myInjector = Guice.createInjector(new GeomajasTestModule());
    gwtFactory = myInjector.getInstance(GeometryFactory.class);
    gwt = gwtFactory.createLinearRing(new Coordinate[] { new Coordinate(10.0, 10.0), new Coordinate(20.0, 10.0),
        new Coordinate(20.0, 20.0), new Coordinate(10.0, 10.0) });

    jtsFactory = new com.vividsolutions.jts.geom.GeometryFactory(new PrecisionModel(), SRID);
    jts = jtsFactory.createLinearRing(new com.vividsolutions.jts.geom.Coordinate[] {
View Full Code Here

  private MathService service;

  @Before
  public void setup() {
    Injector myInjector = Guice.createInjector(new GeomajasTestModule());
    service = myInjector.getInstance(MathService.class);
  }
View Full Code Here

  // Constructor, initializes the 2 point geometries:
  // -------------------------------------------------------------------------

  @Before
  public void setUp() {
    Injector myInjector = Guice.createInjector(new GeomajasTestModule());
    gwtFactory = myInjector.getInstance(GeometryFactory.class);
    gwt = gwtFactory.createPoint(new Coordinate(10.0, 10.0));
    empty = gwtFactory.createPoint(null);

    jtsFactory = new com.vividsolutions.jts.geom.GeometryFactory(new PrecisionModel(), SRID);
    jts = jtsFactory.createPoint(new com.vividsolutions.jts.geom.Coordinate(10.0, 10.0));
View Full Code Here

  // Constructor, initializes the 2 LineString geometries:
  // -------------------------------------------------------------------------

  @Before
  public void setUp() {
    Injector myInjector = Guice.createInjector(new GeomajasTestModule());
    gwtFactory = myInjector.getInstance(GeometryFactory.class);
    gwt = gwtFactory.createLineString(new Coordinate[] { new Coordinate(10.0, 10.0), new Coordinate(20.0, 10.0),
        new Coordinate(20.0, 20.0) });
    empty = gwtFactory.createLineString(null);

    jtsFactory = new com.vividsolutions.jts.geom.GeometryFactory(new PrecisionModel(), SRID);
View Full Code Here

     * @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

     * @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

TOP

Related Classes of com.google.inject.Injector

Copyright © 2018 www.massapicom. 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.