Package com.changestuffs.server.guice

Source Code of com.changestuffs.server.guice.DispatchServletModule

package com.changestuffs.server.guice;

import java.util.logging.Logger;

import com.changestuffs.server.servlets.FrontServlet;
import com.changestuffs.shared.constants.ServletPaths;
import com.google.inject.persist.PersistFilter;
import com.google.inject.persist.jpa.JpaPersistModule;
import com.google.inject.servlet.ServletModule;
import com.gwtplatform.dispatch.server.guice.DispatchServiceImpl;

public class DispatchServletModule extends ServletModule {

  private final Logger log = Logger.getLogger(getClass().getName());
 
  @Override
  public void configureServlets() {
    serve(ServletPaths.dispatch.getPath()).with(DispatchServiceImpl.class);
   
    for(ServletPaths frontServletPath: ServletPaths.values()){
      if(frontServletPath != ServletPaths.dispatch)
        serve(frontServletPath.getPath()).with(FrontServlet.class);
    }
   
    install(new JpaPersistModule("appEngine"));
      filter("/*").through(PersistFilter.class);
     
    log.info("DispatchServletModule is configured");
  }
}
TOP

Related Classes of com.changestuffs.server.guice.DispatchServletModule

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.