Package org.eweb4j.config.bean

Examples of org.eweb4j.config.bean.ConfigBean


*/
public class ActionConfig {
  /** 涉及到文件IO,需要同步保证正确性 */
  public synchronized static String check() {
    String error = null;
    ConfigBean cb = (ConfigBean) SingleBeanCache
        .get(ConfigConstant.CONFIGBEAN_ID);

    if (cb == null)
      return null;

    // eweb4j-start-config.xml中<mvc>节点里的actionXmlFile
    List<String> xmlFilePaths = cb.getMvc().getActionXmlFiles().getPath();
    for (String filePath : xmlFilePaths) {
      if (filePath == null || filePath.length() == 0)
        continue;

      // 解决中文文件夹名
View Full Code Here


public class DataSourceCreator {

  public static DataSource create(final DBInfoConfigBean dbInfo)
      throws Exception {

    ConfigBean cb = (ConfigBean) SingleBeanCache
        .get(ConfigConstant.CONFIGBEAN_ID);
    Class<?> cls = Class.forName(cb.getOrm().getDataSource());
    DataSource ds = (DataSource) cls.newInstance();

    List<Property> properties = dbInfo.getProperty();

    // 通过反射将配置信息注入到数据源对象中
View Full Code Here

    if (f == null || f.getPath().length() == 0)
      return null;

    String id = f.getId();
    String path = f.getPath();
    ConfigBean cb = (ConfigBean) SingleBeanCache.get(ConfigBean.class);
    I18N i18n = cb.getLocales();

    final String sufPro = ".properties";

    if (i18n != null) {
      for (Locale l : i18n.getLocale()) {
View Full Code Here

  public synchronized static void writeProp(String propId, String key,
      Object value) throws IOException {
    if (propId == null)
      return;

    ConfigBean cb = (ConfigBean) SingleBeanCache.get(ConfigBean.class);
    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) {
View Full Code Here

  private static Log log = LogFactory.getMVCLogger(InterceptorConfig.class);

  public synchronized static String check() {
    String error = null;
    ConfigBean cb = (ConfigBean) SingleBeanCache.get(ConfigConstant.CONFIGBEAN_ID);

    if (cb != null) {
      for (String filePath : cb.getMvc().getInterXmlFiles().getPath()) {
        if (filePath != null && filePath.length() > 0) {
          File configFile = new File(ConfigConstant.CONFIG_BASE_PATH + filePath);
          try {
            XMLReader reader = BeanXMLUtil.getBeanXMLReader(configFile);
            reader.setBeanName("interceptor");
View Full Code Here

  private static Log log = LogFactory.getMVCLogger(ActionConfig.class);

  /** 涉及到文件IO,需要同步保证正确性 */
  public synchronized static String check() {
    String error = null;
    ConfigBean cb = (ConfigBean) SingleBeanCache.get(ConfigConstant.CONFIGBEAN_ID);

    if (cb == null)
      return null;

    // eweb4j-start-config.xml中<mvc>节点里的actionXmlFile
    List<String> xmlFilePaths = cb.getMvc().getActionXmlFiles().getPath();
    for (String filePath : xmlFilePaths) {
      if (filePath == null || filePath.length() == 0)
        continue;

      // 解决中文文件夹名
View Full Code Here

   * @param ioc
   * @return
   */
  public static String checkIOC(IOCConfigBean ioc, String xmlFile) {
    String error = null;
    ConfigBean cb = (ConfigBean) SingleBeanCache.get(ConfigBean.class);
    if ("true".equalsIgnoreCase(cb.getIoc().getOpen())
        || "1".equals(cb.getIoc().getOpen())) {
      StringBuilder sb = new StringBuilder();
      if (ioc.getScope() == null)
        ioc.setScope("");
      if (!"prototype".equalsIgnoreCase(ioc.getScope())
          && !"singleton".equalsIgnoreCase(ioc.getScope())
View Full Code Here

  }

  public static String checkMVCInterceptor(InterConfigBean inter,
      String xmlFile) {
    String error = null;
    ConfigBean cb = (ConfigBean) SingleBeanCache.get(ConfigBean.class);
    if ("true".equalsIgnoreCase(cb.getMvc().getOpen())
        || "1".equals(cb.getMvc().getOpen())) {
      StringBuilder sb = new StringBuilder();
      if (!"".equals(inter.getClazz())) {
        try {
          if (Class.forName(inter.getClazz()) == null) {
            sb.append("当前您填写的( class=").append(inter.getClazz())
View Full Code Here

   * @return
   */
  public static String checkIOCJnject(List<Injection> inject,
      List<IOCConfigBean> iocList, String beanID, String xmlFile) {
    String error = null;
    ConfigBean cb = (ConfigBean) SingleBeanCache.get(ConfigBean.class);
    if ("true".equalsIgnoreCase(cb.getIoc().getOpen())
        || "1".equals(cb.getIoc().getOpen())) {
      StringBuilder sb = new StringBuilder();
      for (Injection inj : inject) {
        if (inj.getRef() != null && !"".equals(inj.getRef())) {
          boolean flag = false;
          for (IOCConfigBean iocBean : iocList) {
View Full Code Here

   * @param dcb
   * @return
   */
  public static String checkORMDBInfo(DBInfoConfigBean dcb, String filePath) {
    String error = null;
    ConfigBean cb = (ConfigBean) SingleBeanCache.get(ConfigBean.class);
    if ("true".equals(cb.getOrm().getOpen())
        || "1".equals(cb.getOrm().getOpen())) {
      StringBuilder sb = new StringBuilder();
      if (!DBType.MYSQL_DB.equalsIgnoreCase(dcb.getDataBaseType())
          && !DBType.MSSQL2000_DB.equalsIgnoreCase(dcb
              .getDataBaseType())
          && !DBType.MSSQL2005_DB.equalsIgnoreCase(dcb
View Full Code Here

TOP

Related Classes of org.eweb4j.config.bean.ConfigBean

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.