标签:
|  
       
        1 
        
      
        2 
        
      
        3 
        
      
        4 
         |  
      
       
         The redefinition may change method bodies, the constant pool and attributes. 
         
       
         The redefinition must not add, remove or rename fields or methods, change the 
         
       
         signatures of methods, or change inheritance.  These restrictions maybe be 
         
       
         lifted in future versions. 
         
       |  
    
|  
       
        1 
        
      
        2 
        
      
        3 
        
      
        4 
        
      
        5 
        
      
        6 
        
      
        7 
         |  
      
       
         Spring Loaded is a JVM agentforreloadingclassfile changes whilst a JVM is running. 
         
       
         It transforms classes at loadtime to make them amenable to later reloading. 
         
       
         Unlike‘hot code replace‘which only allows simple changes once a JVM is running 
         
       
         (e.g. changes to method bodies), Spring Loaded allows you to 
         
       
         add/modify/delete methods/fields/constructors. 
         
       
         The annotations on types/methods/fields/constructors 
         
       
         can also be modified and it is possible to add/remove/change values inenumtypes. 
         
       |  
    
|  
       
        1 
        
      
        2 
        
      
        3 
        
      
        4 
        
      
        5 
        
      
        6 
        
      
        7 
        
      
        8 
        
      
        9 
        
      
        10 
        
      
        11 
        
      
        12 
        
      
        13 
        
      
        14 
        
      
        15 
        
      
        16 
        
      
        17 
        
      
        18 
        
      
        19 
        
      
        20 
         |  
      
       
         packagetest; 
         
       
         importdemo.A; 
         
       
         publicclassTestPreMain 
         
       
         { 
         
       
             // -javaagent:springloaded-1.2.0.RELEASE.jar -noverify 
         
       
             publicstaticvoidmain(String[] args)throwsException 
         
       
             { 
         
       
                 A a =newA(); 
         
       
                 while(true) 
         
       
                 { 
         
       
                     a.say(); 
         
       
                     Thread.sleep(3000); 
         
       
                 } 
         
       
             } 
         
       
         } 
         
       |  
    
|  
       
        1 
         |  
      
       
         -javaagent:springloaded-1.2.0.RELEASE.jar -noverify 
         
       |  
    
|  
       
        1 
         |  
      
       
         set JAVA_OPTS=-javaagent:springloaded-1.2.0.RELEASE.jar -noverify 
         
       |  
    
使用spring-loaded开源项目,实现java程序和web应用的热部署
标签:
原文地址:http://my.oschina.net/u/2273085/blog/503782