Search in sources :

Example 26 with ConfigBean

use of org.eweb4j.config.bean.ConfigBean in project eweb4j-framework by laiweiwei.

the class Props method writeProp.

public static synchronized void writeProp(String propId, Map<String, String> data) throws IOException {
    if (propId == null)
        return;
    ConfigBean cb = (ConfigBean) SingleBeanCache.get(ConfigBean.class.getName());
    List<Prop> files = cb.getProperties().getFile();
    for (Prop f : files) {
        if (propId.equals(f.getId())) {
            Map<String, String> map = props.get(propId);
            if (map == null) {
                map = new Hashtable<String, String>();
                props.put(propId, map);
            }
            map.putAll(data);
            String filePath = ConfigConstant.CONFIG_BASE_PATH + f.getPath();
            writeProperties(filePath, data);
            break;
        }
    }
}
Also used : Prop(org.eweb4j.config.bean.Prop) ConfigBean(org.eweb4j.config.bean.ConfigBean)

Example 27 with ConfigBean

use of org.eweb4j.config.bean.ConfigBean in project eweb4j-framework by laiweiwei.

the class LogFactory method getIOCLogger.

public static Log getIOCLogger(Class<?> clazz) {
    ConfigBean cb = (ConfigBean) SingleBeanCache.get(ConfigBean.class.getName());
    LogsConfigBean logs = cb == null ? new LogsConfigBean() : cb.getIoc().getLogs();
    return new LogImpl(logs, "IOC", clazz);
}
Also used : LogsConfigBean(org.eweb4j.config.bean.LogsConfigBean) ConfigBean(org.eweb4j.config.bean.ConfigBean) LogsConfigBean(org.eweb4j.config.bean.LogsConfigBean) LogConfigBean(org.eweb4j.config.bean.LogConfigBean)

Example 28 with ConfigBean

use of org.eweb4j.config.bean.ConfigBean in project eweb4j-framework by laiweiwei.

the class LogFactory method getMVCLogger.

public static Log getMVCLogger(Class<?> clazz) {
    ConfigBean cb = (ConfigBean) SingleBeanCache.get(ConfigBean.class.getName());
    LogsConfigBean logs = cb == null ? new LogsConfigBean() : cb.getMvc().getLogs();
    return new LogImpl(logs, "MVC", clazz);
}
Also used : LogsConfigBean(org.eweb4j.config.bean.LogsConfigBean) ConfigBean(org.eweb4j.config.bean.ConfigBean) LogsConfigBean(org.eweb4j.config.bean.LogsConfigBean) LogConfigBean(org.eweb4j.config.bean.LogConfigBean)

Aggregations

ConfigBean (org.eweb4j.config.bean.ConfigBean)28 DBInfoConfigBean (org.eweb4j.orm.dao.config.bean.DBInfoConfigBean)13 LogConfigBean (org.eweb4j.config.bean.LogConfigBean)12 ORMConfigBean (org.eweb4j.orm.config.bean.ORMConfigBean)12 File (java.io.File)10 IOCConfigBean (org.eweb4j.ioc.config.bean.IOCConfigBean)10 ActionConfigBean (org.eweb4j.mvc.config.bean.ActionConfigBean)10 InterConfigBean (org.eweb4j.mvc.config.bean.InterConfigBean)10 FieldConfigBean (org.eweb4j.mvc.config.bean.FieldConfigBean)9 ParamConfigBean (org.eweb4j.mvc.config.bean.ParamConfigBean)9 ResultConfigBean (org.eweb4j.mvc.config.bean.ResultConfigBean)9 ValidatorConfigBean (org.eweb4j.mvc.config.bean.ValidatorConfigBean)9 XMLReader (org.eweb4j.util.xml.XMLReader)6 CheckConfigBean (org.eweb4j.config.CheckConfigBean)5 Method (java.lang.reflect.Method)4 Prop (org.eweb4j.config.bean.Prop)4 ReflectUtil (org.eweb4j.util.ReflectUtil)4 IOException (java.io.IOException)3 LogsConfigBean (org.eweb4j.config.bean.LogsConfigBean)3 FileInputStream (java.io.FileInputStream)2