Exemplo n.º 1
0
 public File getHome() {
   if (HOME == null) {
     String appHome = BusiPluginsHelper.getAppHome();
     HOME = BusiPluginsHelper.verifyHome(appHome, NB_FRAME_CONFIG);
   }
   return HOME;
 }
Exemplo n.º 2
0
  public String[] getSpringConfigs() {
    final String[] pluginxms = BusiPluginsHelper.getPluginsConfig(PLUGINHOME);
    try {
      final String ppath = HOME.getCanonicalPath() + File.separator + "config";
      SpringAll_xmlDefine define =
          new SpringAll_xmlDefine() {
            @Override
            protected void setCustomerXml(StringBuffer xmlBuf) {
              // setPropertyHolder("file:" + ppath + File.separator + "system.properties");
              xmlBuf
                  .append("<import resource=\"")
                  .append("file:")
                  .append(ppath)
                  .append(File.separator);
              xmlBuf.append("spring-dao.xml\"/>");
              xmlBuf
                  .append("<import resource=\"")
                  .append("file:")
                  .append(ppath)
                  .append(File.separator);
              xmlBuf.append("spring-services.xml\"/>");
              if (pluginxms != null && pluginxms.length > 0) {
                for (String plugin : pluginxms) {
                  xmlBuf.append("<import resource=\"").append(plugin).append("\"/>");
                }
              }
            }
          };
      define.setPropertyHolder("file:" + ppath + File.separator + "system.properties");
      String springAllPath = ppath + File.separator + DEFAULT_SPRING_CONFIG;
      IOUtil.inputStream2File(IOUtil.str2InputStream(define.getXml()), springAllPath);
      File config = new File(springAllPath);
      if (config.exists() && config.isFile()) {
        return new String[] {"file:" + springAllPath};
      } else {
        throw new AinbException(Constants.ERR_FRAME_NAME.getValue(), " get spring configs error.");
      }
    } catch (Exception e) {
      throw new AinbException(Constants.ERR_FRAME_NAME.getValue(), " get spring configs error.", e);
    }

    //		if(pluginxms!=null && pluginxms.length>0){
    //			String[] configs = new String[pluginxms.length + 1];
    //			configs[0] = DEFAULT_SPRING_CONFIG;
    //			System.arraycopy(pluginxms, 0, configs, 1, pluginxms.length);
    //
    //			return configs;
    //		}
    //		return new String[]{DEFAULT_SPRING_CONFIG};
  }
Exemplo n.º 3
0
 private void loadPluginsClass() {
   String pluginHome = BusiPluginsHelper.getPluginHome();
   PLUGINHOME = pluginHome;
   BusiPluginsHelper.loadPluginsClass(pluginHome);
 }