Package com.google.inject

Examples of com.google.inject.Module


  @Override
  public List<Module> getModules() {
    List<Module> modules = new ArrayList<Module>(0);

    modules.add(new Module() {
      @Override
      public void configure(Binder binder) {
        // ===================================================
        // 初始化ResponseWriter
        // ===================================================
View Full Code Here


  }
 
  @Override
  public List<Module> getModules() {
    List<Module> modules = new ArrayList<Module>(0);
    modules.add(new Module() {
      @Override
      @SuppressWarnings("unchecked")
      public void configure(Binder binder) {
        ActionRegister register = new ActionRegister();
        for (Class clazz : classes) {
View Full Code Here

*/
public class SecurityGuiceModuleProvider extends ModuleProviderTemplate {
  @Override
  public List<Module> getModules() {
    List<Module> modules = new ArrayList<Module>(0);
    modules.add(new Module() {
      @Override
      public void configure(Binder binder) {
        binder.bind(SecurityContext.class).toProvider(SecurityContextProvoider.class);
        binder.bindInterceptor(Matchers.any(), Matchers
            .annotatedWith(RolesAllowed.class),
View Full Code Here

  }

  @Override
  public List<Module> getModules() {
    List<Module> modules = new ArrayList<Module>(0);
    modules.add(new Module() {
      @Override
      public void configure(Binder binder) {
        Field[] fields;
        JndiResource annotation;
        Class type;
View Full Code Here

  }
 
  @Override
  public List<Module> getModules() {
    List<Module> modules = new ArrayList<Module>(0);
    modules.add(new Module() {
      @Override
      public void configure(Binder binder) {
        binder.bind(CacheProvider.class).toProvider(CacheProviderProvider.class);
        CacheProviderRegister cacheManagerRegister = new CacheProviderRegister();
        for (Class clazz : classes) {
View Full Code Here

  }

  @Override
  public List<Module> getModules() {
    List<Module> modules = new ArrayList<Module>(0);
    modules.add(new Module() {
      @Override
      public void configure(Binder binder) {
        AbstractMatcher<Class> classMatcher = new AbstractMatcher<Class>() {
          public boolean matches(Class clazz) {
            return clazz.isAnnotationPresent(Interceptors.class)||clazz.isAnnotationPresent(Interceptor.class);
View Full Code Here

      JRest4GuiceHelper.useJRest("org.jrest4guice.sample")// 使用Rest,并指定要动态扫描注册的包路径
          .useJPA()// 使用JPA
          .useSecurity()// 使用JAAS
          .useCache()//打开缓存客户端的功能
//          .enableCustomInterceptor("org.jrest4guice.sample")//打开自定义的拦截器支持,允许通过@Interceptors来支持自定义的拦截器
          .addUserModule(new Module(){
            @Override
            public void configure(Binder binder) {
              binder.bindConstant().annotatedWith(Names.named(MultipartFormDataContentRader.FILE_SIZE_MAX)).to(1024 * 1024*10);
              binder.bindConstant().annotatedWith(Names.named(MultipartFormDataContentRader.SIZE_MAX)).to(1024 * 1024*100);
            }
 
View Full Code Here

*/
public class HibernateSearchGuiceModuleProvider extends ModuleProviderTemplate{
  @Override
  public List<Module> getModules() {
    List<Module> modules = new ArrayList<Module>(0);
    modules.add(new Module() {
      @Override
      public void configure(Binder binder) {
        binder.bind(FullTextSession.class).toProvider(
            FullTextSessionProvider.class);
        binder.bind(FullTextEntityManager.class).toProvider(
View Full Code Here

*/
public class HibernateGuiceModuleProvider extends ModuleProviderTemplate{
  @Override
  public List<Module> getModules() {
    List<Module> modules = new ArrayList<Module>(0);
    modules.add(new Module() {
      @Override
      public void configure(Binder binder) {
        binder.bind(SessionFactory.class).toProvider(
            SessionFactoryProvider.class);
        binder.bind(Session.class).toProvider(
View Full Code Here

  }

  @Override
  public List<Module> getModules() {
    List<Module> modules = new ArrayList<Module>(0);
    modules.add(new Module() {
      @Override
      public void configure(Binder binder) {
        AbstractMatcher<Class> classMatcher = new AbstractMatcher<Class>() {
          public boolean matches(Class clazz) {
            return clazz.isAnnotationPresent(Transactional.class);
View Full Code Here

TOP

Related Classes of com.google.inject.Module

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.