Example usage for com.google.gwt.inject.rebind.adapter GinModuleAdapter GinModuleAdapter

List of usage examples for com.google.gwt.inject.rebind.adapter GinModuleAdapter GinModuleAdapter

Introduction

In this page you can find the example usage for com.google.gwt.inject.rebind.adapter GinModuleAdapter GinModuleAdapter.

Prototype

public GinModuleAdapter(GinModule ginModule) 

Source Link

Usage

From source file:com.goodow.wave.bootstrap.server.BootstrapModule.java

License:Apache License

private void loadFromClasspath() {
    ServiceLoader<Module> modules = ServiceLoader.load(Module.class);
    Iterator<Module> moduleIt = modules.iterator();
    while (moduleIt.hasNext()) {
        Module module = moduleIt.next();
        logger.finer("Install " + module.getClass().getName());
        install(module);/*from   w w  w  . j  a  va  2 s.c o  m*/
    }

    ServiceLoader<GinModule> ginModules = ServiceLoader.load(GinModule.class);
    Iterator<GinModule> ginModuleItr = ginModules.iterator();
    while (ginModuleItr.hasNext()) {
        GinModule ginModule = ginModuleItr.next();
        GinModuleAdapter module = new GinModuleAdapter(ginModule);
        logger.finer("Install " + ginModule.getClass().getName());
        install(module);
    }
}

From source file:com.guit.rebind.gin.GinOracle.java

License:Apache License

private static Module instantiateGModuleClass(Class<? extends GinModule> moduleClassName) {
    try {//  ww  w.ja  v  a  2s .c o m
        return new GinModuleAdapter(moduleClassName.newInstance());
    } catch (InstantiationException e) {
        return null;
    } catch (IllegalAccessException e) {
        return null;
    }
}