zoukankan      html  css  js  c++  java
  • Java Instrumentation

    package com.dms;
    
    import java.io.File;
    
    import org.apache.commons.io.FileUtils;
    import org.javalite.activejdbc.Base;
    import org.javalite.instrumentation.Instrumentation;
    
    import com.dms.manage.domains.PO.basedata.OrgPo;
    
    public class MakeInstrumentationUtil {
    
        public static void make() {
            try {
                String resourcePath = ClassLoader.getSystemResource("").getPath();
                Instrumentation instrumentation = new Instrumentation();
                instrumentation.setOutputDirectory(resourcePath);
                instrumentation.instrument();
                
                File properties = new File(resourcePath + "\activejdbc_models.properties");
                if(properties.exists()) {
                    File target = new File(System.getProperty("user.dir") + "\res\activejdbc_models.properties");
                    FileUtils.copyFile(properties, target);
                }else {
                    System.out.println("properties未成功生成。");
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    
        public static void main(String[] args) {
            MakeInstrumentationUtil.make(); // 这里创建Instrumentation
        }
    }

    web.xml
    <listener>
    <listener-class>org.javalite.instrumentation.ActiveJdbcInstrumentationListener</listener-class>
    </listener>

  • 相关阅读:
    狗狗急性肠胃炎
    shell change password
    男职工为什么要交生育保险
    预扣预缴个税
    转《最优状态机》
    状态机编程-队列缓冲事件,事件可异步触发
    max713镍氢电池充电管理IC
    NUP2201MR
    LSP5513
    74HC14D(6反向施密特触发器)
  • 原文地址:https://www.cnblogs.com/MaxLife/p/9002384.html
Copyright © 2011-2022 走看看