Package com.google.inject.servlet

Examples of com.google.inject.servlet.ServletModule


    YarnConfiguration conf = SliderUtils.createConfiguration();
    fs = FileSystem.get(new URI("file:///"), conf);
  }

  private static Injector createInjector() {
    return Guice.createInjector(new ServletModule() {
      @Override
      protected void configureServlets() {

        AppState appState = null;
        try {
View Full Code Here


{
    public static void main(final String[] args) throws Exception
    {
        final Injector injector = Guice.createInjector(
            new RealtimeSystemModule(),
            new ServletModule()
            {
                @Override
                protected void configureServlets()
                {
                    // Static files
View Full Code Here

    addWebSocketServlets();

    try {
      final Injector parentInjector = injector;

      final ServletModule servletModule = getServletModule(parentInjector);

      ServletContextListener contextListener = new GuiceServletContextListener() {

        private final Injector childInjector = parentInjector.createChildInjector(servletModule);
View Full Code Here

    addServlet("/webclient/*", DefaultServlet.class);
  }

  public ServletModule getServletModule(final Injector injector) {

    return new ServletModule() {
      @Override
      protected void configureServlets() {
        // We add servlets here to override the DefaultServlet automatic registered by WebAppContext
        // in path "/" with our WaveClientServlet. Any other way to do this?
        // Related question (unanswered 08-Apr-2011)
View Full Code Here

    /** {@inheritDoc}
     * @see com.google.inject.servlet.GuiceServletContextListener#getInjector()
     */
    @Override
    protected Injector getInjector() {
        return Guice.createInjector(new JpaPersistModule("myblogUnit"), new ServletModule(){
            /** {@inheritDoc}
             * @see com.google.inject.servlet.ServletModule#configureServlets()
             */
            @Override
            protected void configureServlets() {
View Full Code Here

        injector = Guice.createInjector(createServletModule());
    }

    ServletModule createServletModule() {
        return new ServletModule() {
            @Override
            protected void configureServlets() {
                bind(DataSource.class).toInstance(pool);
                bind(QueryRunner.class).toInstance(new QueryRunner(pool));
            }
View Full Code Here

public class GuiceServletConfig extends GuiceServletContextListener {

  @Override
  protected Injector getInjector() {
    ServletModule servletModule = new ServletModule() {
      @Override
      protected void configureServlets() {
        // Single entry point for all jsonrpc requests
        serve("/jsonrpc").with(JsonRpcProcessor.class);
       
View Full Code Here

public class GuiceServletConfig extends GuiceServletContextListener {
  private static final Logger log = Logger.getLogger(GuiceServletConfig.class.getName());

  @Override
  protected Injector getInjector() {
    ServletModule servletModule = new ServletModule() {
      @Override
      protected void configureServlets() {
        serveRegex("\\/_wave/.*").with(Stocky.class);
      }
    };
View Full Code Here

public class WebModule extends AbstractModule {

  @Override
  protected void configure() {
    install(new ServletModule() {
        @Override
        protected void configureServlets() {
           serve("/*").with(org.rendersnake.ext.guice.GuiceComponentServlet.class);
           bind(IndexAction.class);
           bind(LoginAction.class);
View Full Code Here

public class GuiceServletConfig extends GuiceServletContextListener {
  private static final Logger log = Logger.getLogger(GuiceServletConfig.class.getName());

  @Override
  protected Injector getInjector() {
    ServletModule servletModule = new ServletModule() {
      @Override
      protected void configureServlets() {
        serveRegex("\\/_wave/.*").with(Buggy.class);
        serve("/authSubHandler").with(AuthSubHandler.class);
        serve("/getUserInfo").with(GetUserInfo.class);
View Full Code Here

TOP

Related Classes of com.google.inject.servlet.ServletModule

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.