Package org.expressme.webwind

Examples of org.expressme.webwind.ConfigException


    }

    public void init(final Config config) {
        String value = config.getInitParameter("modules");
        if (value==null)
            throw new ConfigException("Init guice failed. Missing parameter '<modules>'.");
        String[] ss = value.split(",");
        List<Module> moduleList = new ArrayList<Module>(ss.length);
        for (String s : ss) {
            Module m = initModule(s, config.getServletContext());
            if (m!=null)
                moduleList.add(m);
        }
        if (moduleList.isEmpty())
            throw new ConfigException("No module found.");
        this.injector = Guice.createInjector(Stage.PRODUCTION, moduleList);
        config.getServletContext().setAttribute(Injector.class.getName(), this.injector);
    }
View Full Code Here


                    if (o instanceof ServletContextAware) {
                        ((ServletContextAware) o).setServletContext(servletContext);
                    }
                    return (Module) o;
                }
                throw new ConfigException("Class '" + s + "' does not implement '" + Module.class.getName() + "'.");
            }
            catch(InstantiationException e) {
                throw new ConfigException("Cannot instanciate class '" + s + "'.", e);
            }
            catch(IllegalAccessException e) {
                throw new ConfigException("Cannot instanciate class '" + s + "'.", e);
            }
            catch(ClassNotFoundException e) {
                throw new ConfigException("Cannot instanciate class '" + s + "'.", e);
            }
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.expressme.webwind.ConfigException

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.