CN102402427A - Method and device for updating Java application program - Google Patents

Method and device for updating Java application program Download PDF

Info

Publication number
CN102402427A
CN102402427A CN2010102799557A CN201010279955A CN102402427A CN 102402427 A CN102402427 A CN 102402427A CN 2010102799557 A CN2010102799557 A CN 2010102799557A CN 201010279955 A CN201010279955 A CN 201010279955A CN 102402427 A CN102402427 A CN 102402427A
Authority
CN
China
Prior art keywords
class file
target class
loading procedure
type
java
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2010102799557A
Other languages
Chinese (zh)
Other versions
CN102402427B (en
Inventor
杨航
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201010279955.7A priority Critical patent/CN102402427B/en
Publication of CN102402427A publication Critical patent/CN102402427A/en
Priority to HK12107008.1A priority patent/HK1166396A1/en
Application granted granted Critical
Publication of CN102402427B publication Critical patent/CN102402427B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method and a device for updating a Java application program, which are used for improving the updating efficiency of the Java application program. The method comprises the following steps of: acquiring at least one target class file, establishing a corresponding class loading program for the at least one acquired target class file, and loading the at least one target class file to the Java application program in a running state by using the class loading program in the process of running the Java application program, wherein the class loading program inherits the current environment loading program. Therefore, the hot deployment of the Java application program is realized only by loading the recompiled target class file, so that the updating efficiency of the Java application program is improved. The invention provides the corresponding device simultaneously.

Description

A kind of update method of java application and device
Technical field
The application relates to computer realm, particularly a kind of update method of application program and device.
Background technology
In the Java software development process, the developer needs to recompilate after revising code at every turn, and is encapsulated as application program, restarts application program then, just can see amended final implementation effect; After some application program recompilated, restarting needed the long period, for example; Can't be divided into the application program (the WEB layer exploitation of using like, WEB) of Development of Module, for this kind application program; Even each code of revising very small amount; All need recompilate the encapsulation whole application program, and close restart again the WEB application server (as, Jboss).In the exploitation of enterprise-level, generally speaking, revise common application program; From revising code to closing and restarting the WEB server; This process need time about 5 minutes, for bigger application program, this process possibly need more than 10 minute time; And in the programming process, the developer need regularly check the operation result of current code and make modify, with guarantee code according to developer's wish present corresponding effect; Therefore need constantly close and restart the WEB server; Like this, just make and meaninglessly spend the time on code compile, re-launching applications to promote greatly, especially when repairing code error; This consumption is more obvious, thereby has seriously reduced the efficient of code research and development.In addition, for large-scale service application program, in escalation process; Often need restart application program, recompilate and dispose, the new issue application program of laying equal stress on; In restarting service process, often need interrupt external service, thereby influence the service quality of system.
To the problems referred to above, two kinds of solutions are provided under the prior art:
First kind of solution is: (like, tomcat, heat Jboss) is disposed function directly to use the WEB server.Be WEB server monitoring document change, if certain file is modified, just the WEB server reloads the affiliated module of this document; Thereby realize the heat deployment.
But adopt this kind solution, have following shortcoming:
A, WEB server reload whole module through the monitoring document change, only can be directed against sevlet (a kind of java application of server end) and carry out the heat loading; For the application program of having used framework, the content in can't loading frame if load the renewal of implementation framework code through servlet heat, needs initialization framework once more, and speed is very slow.
Behind B, the each revised file, the WEB server can carry out heat automatically to be disposed, and this can make memory requirements increase, simultaneously, owing to reinitialize corresponding module, and so can take a large amount of cpu resources; After repeatedly heat was disposed, system resource can be taken in a large number, disposed thereby have to stop heat, recompilated application program and restarted service.
Second kind of solution is: adopt the method for hotswap, through the interface (Jpda or Jvmti) that Java Virtual Machine (Jvm) provides, change the state of Java Virtual Machine, with original .class file among the class file of revising (.class file) the replacement Jvm.Adopt above-mentioned solution can realize being made amendment in the zone that can arrive in the running status, the debugging tool of employing can be debug, has certain heat and disposes ability.
Yet, adopt this kind solution, there is following shortcoming:
Make amendment in A, the zone that only can arrive to running status, and can not increase new zone.As, only support modification to method body, do not support the increase method, amending method name, operations such as method parameter.Dispose for heat, can't accomplish that the heat of whole codes is disposed, particularly regular operation such as the increase method, increases inner classes, amending method name or the like; Can have a strong impact on the range of application of heat deploying method, have certain limitation.
The heat that B, Hotswap provide is disposed more complicated, can produce unsettled phenomenon during use, collapses sometimes.
The exploitation amount of C, the instrument that adopts when realizing that through this kind solution heat is disposed is very big, can increase the exploitation complexity.
In sum, the heat of the java application that existing solution all can't be realized ideal is disposed, and need provide a kind of new scheme to overcome the defective of existing scheme.
Summary of the invention
The application provides a kind of amending method and device of java application, in order in the process that java application is made amendment, reduces the complexity of operating process, improves it and carries out efficient.
The concrete technical scheme that the application provides is following:
A kind of update method of java application comprises:
Confirm to exist the target class file of at least one compiling generation;
Obtain said at least one target class file in designated storage location;
Set up corresponding type loading procedure at least one the target class file that obtains, adopt in the java application of said type of loading procedure with said at least one target class file load to running status; Wherein, said type of loading procedure inherited current environment loading procedure.
A kind of device that is used for the java application renewal comprises:
Scanning element is used for confirming to exist at least one to compile the target class file that generates;
Acquiring unit is used for obtaining said at least one target class file in designated storage location;
Processing unit is used for setting up corresponding type loading procedure at least one the target class file that obtains, and adopts in the java application of said type of loading procedure with said at least one target class file load to running status; Wherein, said type of loading procedure inherited current environment loading procedure.
Among the application embodiment, developed new hot deployment tool, through the easyStartClassLoader of newly-built succession current environment classloader; At designated storage location loaded targets class file, and it is loaded in the java application of running status, thereby accomplishes the renewal of java application; Like this; Only need to load the target class file that recompilates, realized that just the heat of java application is disposed, thereby improved the update efficiency of java application.
Description of drawings
Fig. 1 is a WEB server principle of work synoptic diagram among the application embodiment;
Fig. 2 is a WEB server capability structural drawing among the application embodiment;
Fig. 3 upgrades process flow diagram for WEB server among the application embodiment to the java application of running status.
Embodiment
Consult shown in Figure 1, in the process that java application is made amendment, in order to reduce the complexity of operating process; Improve it and carry out efficient, among the application embodiment, researched and developed a kind of new hot deployment tool; Preferable; The WEB server that this hot part instrument is adopted when operation is Jboss, and the code development environment of employing (being code editor) is: eclipse, and the application embodiment is not limited to Jboss and two kinds of implementations of eclipse; Be merely for example, be exemplary explanation here here
As shown in Figure 1, under the prior art,, can use compilation tools such as antx/maven that source code is compiled encapsulation when the developer has write source code, and finally generate software product (as, the java application that can move); Then, the developer is deployed to this software product on the Jboss, restarts Jvm (JavaVirtual Machine; Java Virtual Machine); Start Jboss by Jvm, start software product (comprise the startup application framework, start the application code of software product by application framework) by Jboss again; At this moment, the developer sends a fill order to Jboss, can see corresponding implementation effect.If source code is made amendment according to implementation effect discovery needs; The developer need close Jboss so; And repeat above-mentioned source code and revise, compile encapsulation process; To be deployed to once more on the Jboss according to the software product that amended source code generates, restart Jboss again to move amended software product.This process need long period, can reduce the modification efficient of java application, thereby influence the performance of whole service system.
Different with ordinary procedure, java applet (.class file) is not local executable program.When needs operation .class file; At first should move Jvm (Java Virtual Machine); And then in Jvm, move the .class file load, the instrument of being responsible for loading the .class file just is called classloader, and the interface that Jvm uses in loading procedure is called the Jvmti interface.Among the application embodiment, in the hot deployment tool of design, defined the function of Jvmti interface again again; Replaced original skeleton code among the Jvm, like this, when starting Jvm; Jvm can create a classloader (being called EasyStartClassLoader) automatically again according to the skeleton code after changing; Directly obtain the .class file that up-to-date compiling generates, wherein in designated storage location
Jvmti interface: as shown in Figure 1; When original framework (also can be called application framework) moved, Jboss generally went to obtain the application code that comprises in the local software product through the classLoader in the running environment, and among the application embodiment; Through defining the Jvmti interface again; Changed the behavior of original framework, when making the each invocation target .class file of Jboss, obtained the target .class file that up-to-date compiling generates to designated storage location; So-called designated storage location can be the build targets folder in the code editor of developer's appointment.
In the practical application; Also can from code editor, not obtain target .class file, for example, call Jvm instruction direct compilation through order line and generate a target .class file; Perhaps; Compile new target .class that generates or the like from other in assigned address copy, its purpose is to obtain a target .class file and heat is deployed in the java application of running status, not the source of limited target .class file.In following examples, obtaining target .class file with the prescribed storage means in code editor is that example describes.
EasyStartClassLoader: when obtaining target .class file, create classloader again; In the present embodiment; When creating EasyStartClassLoader; Put upside down the mechanism (load by father classLoader earlier, load by sub-classLoader again) that the parents of the routine of classLoader appoint, adopted to load by EasyStartClassLoader earlier; The mode that loads by the father classLoader of EasyStartClassLoader again; Simultaneously this father classLoader is set as environment classLoader, and can only loaded targets .class file through limiting EasyStartClassLoader, guarantee that other .class files or the .class library relevant with target .class file are loaded by environment classLoader.Wherein, so-called environment classLoader promptly is the founder of current environment, and so-called environment promptly is meant current running status, i.e. the state of one group of code operation, and the classLoader that loads this group code promptly is current environment classLoader.
In loading procedure; General through the interface among the Java or the mode of Java reflex mechanism; The target .class file that makes external environment condition can normally use easyStartClassLoader to load; Thereby be implemented in run mode, the target .class file that calls up-to-date loading automatically moves, and obtains instant result.
With code editor is that eclipse is an example, and after the developer revised partial code, eclipse can be compiled into new .class file, i.e. target .class file to the code file of revising part; Owing to be the single file of compiling, so speed is exceedingly fast, and can ignore compilation time; Then; Through using the framework of being handled by the jvmti interface of JVM (framework that promptly defines again); Regularly carry out file scan, confirm interior the existence when recompilating the target .class file that generates of file of appointment among the eclipse, just in the file of this appointment, obtain newly-generated target .class file; This process speed is also very fast, can ignore the time.
Below in conjunction with accompanying drawing the application preferred embodiment is elaborated.
Consult shown in Figure 2ly, among the application embodiment, the device that is used for java application is upgraded (like, WEB server) comprises scanning element 10, acquiring unit 11 and processing unit 12, wherein
Scanning element 10 is used for scanning in designated storage location, has confirmed to generate the target class file that recompilates, i.e. target .class file;
In the embodiment of the invention, owing in code editor, obtain target .class file, therefore; Need to adopt scanning element 10 regularly carry out file scan, confirming having target .class file, in the practical application; If generate target .class file based on Jvm order direct compilation; Perhaps, then also can not adopt scanning element 10, repeat no more at this based on indicating from other positions copy targeting .class file;
Acquiring unit 11 is used to obtain at least one target class file, i.e. target .class file;
In the present embodiment, acquiring unit 11 obtains target .class file in designated storage location, and what its reason was that framework that Jvm adopts uses is the Jvmti interface that designs again, and change has taken place in the framework behavior.
Processing unit 12; Be used for setting up corresponding type loading procedure at least one the target class file that obtains; Be easyStartClassLoader, and adopt in the java application of at least one target class file load to running status that such loading procedure will obtain; Wherein, type loading procedure is inherited current environment loading procedure, and promptly easyStartClassLoader inherits current environment classloder.
In this instance, scanning element 10 acquiring units 11 and processing unit 12 are the Jvmti interfaces of design again through Jvm, under the situation that does not change former skeleton code, embed original framework logic, and the operation that comes into force.
Need in the above-mentioned WEB server to support Jvm, preferable, above-mentioned WEB server is Jboss, perhaps is tomcat.
Based on the said system framework, consult shown in Figure 3ly, among the application embodiment, be example with compiling target .class file in eclipse, it is following to the detailed process that the java application of running status upgrades to introduce the WEB server:
Step 300: confirm code editor (as, the target class file that exists at least one compiling to generate in eclipse), i.e. target .class file.
Step 310: the designated storage location in code editor is obtained above-mentioned at least one target class file.
Among the application embodiment; When execution in step 310, the Jvm of WEB server support has changed the behavior of the original framework that moves among the Jvm through the Jvmti interface of redetermination, the framework after order changes can the designated storage location of eclipse (as; The eclipse acquiescence is compiled into target .class file under the file target/classes/ catalogue); Obtain the target .class file of the new compiling of developer, the number of target .class file can be one, also can be a plurality of.
Under the prior art; Jvm is after the jvmti interface is used in configuration, and Jvm all can pass through the Jvmti interface interchange when loading each .class file; And can make amendment to the bytecode of .class file through the Jvmti interface, the realization code of existing Jvmti interface is following:
byte[]
transform(ClassLoader loader,
String className,
Class<?>classBeingRedefined,
ProtectionDomain protectionDomain,
byte[] classfileBuffer)
throws?IllegalClassFormatException;
Be from the code of framework, to obtain through Jvmti interface interchange .class file under the prior art; In above-mentioned code; Loader is for loading the classloader of invoked .class file, and className is the title of invoked .class file, and classBeingRedfined is the type of invoked .class file; ProtectionDomain is the action scope of invoked .class file, and classfileBuffer is the bytecode that Jvm reads.Generally, can analyze, change the content of bytecode then according to the bytecode that classfileBuffer reads; And returning to Jvm, Jvm will move the bytecode after changing, thereby reach the purpose that changes the framework behavior; And in fact original code that uses does not change; So at the code that does not change original use, promptly do not having under the situation of invading, changing original method of operation of framework.But analyze and the change bytecode; Need the developer that the mechanism of Java compiling class file is understood very much, the mechanism of .class file is understood very much, therefore; Change the purpose that Jvm calls original mode of .class file even reached, also need suitable workload according to aforesaid way.
Among the application embodiment, in order to reduce the workload that realizes above-mentioned purpose, the .class file that needs are changed import code editor (as; Eclipse) in, according to the self-defined method of operation that changes class of actual demand, after the preservation; Code editor compiles automatically and generates target .class file, and correspondingly, Jvm is through the jvmti interface; Only need the className in the check code editor; Confirm it is when needing the .class file of replacement, just directly obtain the bytecode of the target .class file of compiling completion, analyze and revise the bytecode among the classfileBuffer and do not spend; Like this, just, greatly reduce the required workload of use-pattern that adopts original Jvmti interface.
Among the application embodiment, realize that the run time version of Jvmti interface interchange is following:
String?targetName=“targetClass”;
if(className.equals(targetName)){
return?Transformer.getBytesFromFile(targetName);
}
return?null;
Wherein, getBytesFromFile (the defined method of targetName is just returned the document flow of target .class,
Step 320: at least one the .class file to obtaining is set up corresponding easyStartClassLoader; Adopt in the java application of at least one .class file load to running status that this easyStartClassLoader will obtain; Wherein, above-mentioned easyStartClassLoader inherits current environment classLoader.
Among the application embodiment; The function of above-mentioned easyStartClassLoader is the target .class file of the appointment that coding generates in the loading code editing machine; Preferable; Can set up at least one easyStartClassLoader to recompilating the target .class file that generates; As, set up an easyStartClassLoader respectively to each target .class file, also can set up an easyStartClassLoader to a plurality of target .class files; And to the target .class file that load be returned to the java application of the running status among the Jvm, make java application can adopt the target .class file of new loading to operate.
Among the application embodiment, realize above-mentioned functions, have following difficult point:
At first, after a classLoader has loaded certain .class file, just can not reload this .class file again, must rebulid a classLoader and just can reload this .class file;
Secondly, the .class file that different classLoader loads can not use each other, even newly-built easyStartClassLoader has loaded target .class file, the classLoader that has set up before this .class file also can't let uses;
Once more, current environmental classes and the class libraries of a large amount of dependences of the .class file that easyStartClassLoader loads, these need be loaded by environment classLoader, and can not be loaded by easyStartClassLoader.
To the problems referred to above, adopted following mode to solve among the application embodiment:
Each all create new easyStartClassLoader, the new easyStartClassLoader that creates inherits current environment classLoader (promptly as easyStartLoader father classLoader); And the mechanism that the parents that put upside down ClassLoader appoint, promptly earlier by easyStartClassLoader loaded targets .class file, the environment classLoader that transfers to its succession again handles; Through limiting the way of add-in, guarantee safety simultaneously, promptly limit the target .class file that easyStartClassLoader can only load designated storage location, the environment classLoader that other relevant .class file is all transferred to its succession loads.Wherein, so-called environment classLoader promptly is the founder of current environment, and so-called environment promptly is meant current running status, i.e. the state of one group of code operation, and the classLoader that loads this group code promptly is current environment classLoader.
Be specially:
Under the prior art, the realization code of classLoader is exemplified below:
protected?synchronized?Class<?>loadClass(String?name,boolean?resolve)
throws?ClassNotFoundException
{
//First,check?if?the?class?has?already?been?loaded
Class?c=findLoadedClass(name);
if?(c==null){
try{
if(parent!=null){
c=parent.loadClass(name,false);
}else{
c=findBootstrapClass0(name);
}
}catch(ClassNotFoundException?e){
//If?still?not?found,then?invoke?findClass?in?order
//to?find?the?class.
c=findClass(name);
}
}
if(resolve){
resolveClass(c);
}
return?c;
}
Can find out that from above-mentioned code there are two characteristics in classloader:
First characteristic is: in case loaded a .class file (type of being called A), just no longer remove to read its bytecode.
Therefore, in the present embodiment, to class A recompilate generate type A ' after, must remove to read also loading classes A ' by a newly-built easyStartClassLoader.
Second characteristic is: preferentially let father classLoader load the .class file, if father classLoader can load this .class file, just no longer load this .class file by sub-classLoader.
Therefore; In the present embodiment; Need put upside down parents and appoint mechanism; Class A ' to recompile generates is loaded by newly-built easyStartClassLoader earlier, loads other relevant .class files by his father classLoader (being the environment classLoader that easyStartClassLoader inherits) again.
Different with prior art, among the application embodiment, easyStartLoader realizes that code is exemplified below:
public?synchronized?Class<?>loadClass(String?name)throws
ClassNotFoundException{
Class<?>c=findLoadedClass(name);
if?(c!=null){
return?c;
}
try?{
if(name.indexOf(targetClass)==-1){
throw?new?Exception(″easyStartClassLoader?escaped:″+
name);
}
c=this.findClass(name);
System.out.println(″easyStartClassLoader?loaded:″+name);
}catch(Exception?e){
c=super.loadClass(name);
}
return?c;
}
Can find out from above-mentioned code; EasyStartClassLoader only need inherit current environment classLoader, becomes the sub-classLoader of current environment classLoader, like this; Other relevant .class files that target .class file (at least one the .class file after promptly recompilating) is relied on then all can be loaded by environment classLoader; And environment classLoader can't loaded targets .class file, promptly under the prerequisite that limits add-in (being target .class file), puts upside down the mechanism that parents appoint; Let sub-classLoader (being easyStartLoader) load earlier; Load by environment classLoader again, but easyStartLoader loaded targets .class file, other relevant .class files are still loaded by environment classLoader.
Based on the foregoing description, with target .class file load to the process of the java application of running status, generally, make external environment condition can call the target .class file of new loading through the interface among the java or the mode of Java reflex mechanism.
Interface among the so-called Java is the statement of serial of methods; It is the set of certain methods characteristic; The only methodical characteristic of interface among Java does not have the realization of method; Therefore these methods can be realized by different classes in different places, and these realizations can have different behavior (being function).Interface among the Java is in fact loaded by environment classLoader; So but easyStartClassLoader also can have access to because inherit environment classLoader; Because of loading of easyStartClassLoader or one group of target .class file also are the interfaces in inheriting Java; So externally in the environment, be loaded one or one group of target .class file are used through the interface that changes into by force among the java after by instantiation.
In the present embodiment, externally use the realization code of one or the one group .class file that is loaded by easyStartClassLoader to be exemplified below in the environment:
ClassLoader?classloader=new
EasyStartClassLoader(new?URL[]{url},moduleClassName);
moduleClass=
classloader.loadClass(moduleClassName);
module=(Module)moduleClass.newInstance();
Can find out through above-mentioned code; In the present embodiment; Loaded by easyStartLoader one or one group of target .class file (below be called the module that is loaded) realized using the interface among the Java, simultaneously, guaranteed that also the interface among the Java is loaded by the environment classLoader as the father classLoader of easyStartClassLoader; But not easyStartClassLoader loads; This is for the module that lets environment classLoader can use easyStartClassLoader to load, because generally speaking, the module that different classLaoder load can not be general.Like this; EasyStartClassLoader inherits above-mentioned environment classLoader; Just can make the interface among the Java that the module accesses that self loads loads to environment classLoader, thereby make external environment condition can call the module that easyStartClassLoader loads through the interface among the above-mentioned Java.Wherein, so-called external environment condition promptly is meant the environment that loads with respect to easyStartClassLoader, and the environment that calls the environment of easyStartClassLoader loading is referred to as external environment condition.
On the other hand; So-called J ava reflex mechanism (being called Reflection) promptly is when java application moves, and allows the .class file that loads, finds out, uses compile duration unknown fully; In other words; Just learn the .class file of title when java application can load an operation, learn its complete construction, and generate its object entity.For example, the Java reflex mechanism is Class.getMethod () .invoke (), adopts the Java reflex mechanism, for any .class file, can both know its all properties and method; For any object, can both call its any method; Therefore, adopt the Java reflex mechanism, can behind java application loaded targets .class file, make external environment condition also can call this target .class file.
At last, Jvm carries out java application according to the .class file that reloads, the function that just can use the .class file of new loading to have.
Among the application embodiment, developed new hot deployment tool, through the easyStartClassLoader of newly-built succession current environment classloader; At designated storage location loaded targets class file, and it is loaded in the java application of running status, thereby accomplishes the renewal of java application; Like this; Only need to load the target class file that recompilates, realized that just the heat of java application is disposed, improved the update efficiency of java application; And the theory structure of easyStartClassLoader is simple, has very high stability, also can not increase memory consumption and extra system consumption, can unlimited quick realization heat free of charge dispose, and has very high practicality; Further, the core code of new hot deployment tool can be made expansion with few exploitation amount based on Java application framework and application state, can accomplish that the heat of full code full operation is disposed, and is with a wide range of applications.
Obviously, those skilled in the art can carry out various changes and modification to the application and not break away from the spirit and scope of the present invention.Like this, belong within the scope of the application's claim and equivalent technologies thereof if these of the application are revised with modification, then the application also is intended to comprise these changes and modification interior.

Claims (10)

1. the update method of a java application is characterized in that, comprising:
Obtain the target class file that at least one compiling generates;
Set up corresponding type loading procedure at least one the target class file that obtains, adopt in the java application of said type of loading procedure with said at least one target class file load to running status; Wherein, said type of loading procedure inherited current environment loading procedure.
2. the method for claim 1 is characterized in that, sets up corresponding type loading procedure at least one the target class file that obtains, and comprising:
If the number of the target class file that obtains is one, then to setting up corresponding type loading procedure by the target class file;
If the number of the target class file that obtains is more than one, then corresponding each target class file is set up at least one type loading procedure.
3. according to claim 1 or claim 2 method is characterized in that, adopts in the java application of said type of loading procedure with said at least one target class file load to running status, comprising:
Adopt said type of loading procedure that said at least one target class file is loaded earlier;
Adopt said environment loading procedure pair other class files relevant to load again with said target class file.
4. method as claimed in claim 3 is characterized in that, adopts in the java application of said type of loading procedure with said at least one target class file load to running status, further, comprising:
Adopt said type loading procedure to inherit the interface among whole Java that said environment loading procedure loads, make the external environment condition can be through said at least one the target class file of the interface interchange among the said Java.
5. method as claimed in claim 3 is characterized in that, adopts in the java application of said type of loading procedure with said at least one target class file load to running status, further, comprising:
Adopt the Java reflex mechanism, make external environment condition can call said at least one target class file.
6. one kind is used for the device that java application upgrades, and it is characterized in that, comprising:
Acquiring unit is used to obtain the target class file that at least one compiling generates;
Processing unit is used for setting up corresponding type loading procedure at least one the target class file that obtains, and adopts in the java application of said type of loading procedure with said at least one target class file load to running status; Wherein, said type of loading procedure inherited current environment loading procedure.
7. device as claimed in claim 6 is characterized in that, said processing unit is set up corresponding type loading procedure at least one the target class file that obtains, and comprising:
If the number of the target class file that obtains is one, then said processing unit is to setting up corresponding type loading procedure by the target class file;
If the number of the target class file that obtains is more than one, corresponding each the target class file of then said processing unit is set up at least one type loading procedure.
8. like claim 6 or 7 described devices, it is characterized in that said processing unit adopts in the java application of said type of loading procedure with said at least one target class file load to running status, comprising:
Adopt said type of loading procedure that said at least one target class file is loaded earlier;
Adopt said environment loading procedure pair other class files relevant to load again with said target class file.
9. device as claimed in claim 7 is characterized in that, said processing unit adopts in the java application of said type of loading procedure with said at least one target class file load to running status, further, comprising:
Adopt said type loading procedure to inherit the interface among whole Java that said environment loading procedure loads, make the external environment condition can be through said at least one the target class file of the interface interchange among the said Java.
10. device as claimed in claim 6 is characterized in that, said type of loading procedure of said processing unit employing to java application, further, comprises said at least one target class file load:
Adopt the Java reflex mechanism, make external environment condition can call said at least one target class file.
CN201010279955.7A 2010-09-09 2010-09-09 A kind of update method of java application and device Active CN102402427B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201010279955.7A CN102402427B (en) 2010-09-09 2010-09-09 A kind of update method of java application and device
HK12107008.1A HK1166396A1 (en) 2010-09-09 2012-07-18 Method and apparatus for updating a java application java

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201010279955.7A CN102402427B (en) 2010-09-09 2010-09-09 A kind of update method of java application and device

Publications (2)

Publication Number Publication Date
CN102402427A true CN102402427A (en) 2012-04-04
CN102402427B CN102402427B (en) 2015-09-02

Family

ID=45884662

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010279955.7A Active CN102402427B (en) 2010-09-09 2010-09-09 A kind of update method of java application and device

Country Status (2)

Country Link
CN (1) CN102402427B (en)
HK (1) HK1166396A1 (en)

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103812946A (en) * 2014-02-27 2014-05-21 东莞旨尖动漫科技有限公司 Method and system for online cloud updating of AR application program
CN103823658A (en) * 2012-11-19 2014-05-28 苏州博远容天信息科技有限公司 Bridge architecture based coordinative dynamic reflection technology
CN105068837A (en) * 2015-08-07 2015-11-18 Tcl集团股份有限公司 Web application updating method and apparatus
WO2016000126A1 (en) * 2014-06-30 2016-01-07 北京新媒传信科技有限公司 Automatic deployment method and terminal
CN105242948A (en) * 2015-10-27 2016-01-13 江苏电力信息技术有限公司 Java web project based hot deploy implementation method
CN105589701A (en) * 2014-10-21 2016-05-18 阿里巴巴集团控股有限公司 Client application partial updating method and apparatus
CN106027591A (en) * 2015-03-27 2016-10-12 林胜雄 Service optimization computer system and method thereof
WO2017124962A1 (en) * 2016-01-21 2017-07-27 阿里巴巴集团控股有限公司 Method, apparatus, and system for hot-deploying application
CN107346252A (en) * 2016-05-07 2017-11-14 腾讯科技(深圳)有限公司 Using update method and device
CN107463391A (en) * 2016-06-03 2017-12-12 阿里巴巴集团控股有限公司 Task processing method, device and equipment
CN107508846A (en) * 2016-06-14 2017-12-22 北京京东尚科信息技术有限公司 The update method and system and terminal device of applications client
CN107943543A (en) * 2017-11-29 2018-04-20 福州市智捷信息科技有限公司 A kind of method and computer equipment of WEB application heat deployment
WO2018072493A1 (en) * 2016-10-17 2018-04-26 宁德时代新能源科技股份有限公司 Compiling method and compiling system
CN108491216A (en) * 2018-03-05 2018-09-04 北京指掌易科技有限公司 A kind of method of android system unaware application installation upgrading
CN110262818A (en) * 2019-05-29 2019-09-20 北京达佳互联信息技术有限公司 The hot update method of Java code, device, electronic equipment and storage medium
CN111435312A (en) * 2019-01-15 2020-07-21 北京嘀嘀无限科技发展有限公司 Application program management method and device and electronic equipment
CN111625256A (en) * 2020-05-15 2020-09-04 广东浪潮大数据研究有限公司 Application program upgrading method, system, equipment and computer storage medium
CN111736913A (en) * 2019-03-25 2020-10-02 华为技术有限公司 Class loading method and device
CN111866047A (en) * 2019-04-30 2020-10-30 北京达佳互联信息技术有限公司 Data decoding method and device, computer equipment and storage medium
CN112363707A (en) * 2020-11-25 2021-02-12 国电南瑞科技股份有限公司 Control layer general scheduling method based on JAVA reflection technology
CN112379973A (en) * 2020-12-01 2021-02-19 腾讯科技(深圳)有限公司 Heavy loading method and device
CN113138787A (en) * 2021-04-28 2021-07-20 中消云(北京)物联网科技研究院有限公司 Program updating method and device
CN115576589A (en) * 2022-12-08 2023-01-06 平安银行股份有限公司 Program hot updating method, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1195677A1 (en) * 2000-10-06 2002-04-10 Abb Research Ltd. Dynamic class loading
US20020055910A1 (en) * 1998-09-10 2002-05-09 David John Durbin Program component distribution
CN101236503A (en) * 2008-02-27 2008-08-06 鞠京佳 Hot-deployment entity component

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020055910A1 (en) * 1998-09-10 2002-05-09 David John Durbin Program component distribution
EP1195677A1 (en) * 2000-10-06 2002-04-10 Abb Research Ltd. Dynamic class loading
CN101236503A (en) * 2008-02-27 2008-08-06 鞠京佳 Hot-deployment entity component

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
任哲: "《JAVA技术应用基础——对象•模式•虚拟机》", 31 March 2009 *

Cited By (36)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103823658A (en) * 2012-11-19 2014-05-28 苏州博远容天信息科技有限公司 Bridge architecture based coordinative dynamic reflection technology
CN103812946A (en) * 2014-02-27 2014-05-21 东莞旨尖动漫科技有限公司 Method and system for online cloud updating of AR application program
CN103812946B (en) * 2014-02-27 2017-12-26 广州梦能动漫科技有限公司 Method and system for online cloud updating of AR application program
WO2016000126A1 (en) * 2014-06-30 2016-01-07 北京新媒传信科技有限公司 Automatic deployment method and terminal
CN105589701B (en) * 2014-10-21 2019-03-08 阿里巴巴集团控股有限公司 A kind of client application local updating method and device
CN105589701A (en) * 2014-10-21 2016-05-18 阿里巴巴集团控股有限公司 Client application partial updating method and apparatus
CN106027591A (en) * 2015-03-27 2016-10-12 林胜雄 Service optimization computer system and method thereof
CN105068837A (en) * 2015-08-07 2015-11-18 Tcl集团股份有限公司 Web application updating method and apparatus
CN105242948A (en) * 2015-10-27 2016-01-13 江苏电力信息技术有限公司 Java web project based hot deploy implementation method
CN105242948B (en) * 2015-10-27 2018-06-19 江苏电力信息技术有限公司 Heat deployment implementation method based on Java web projects
WO2017124962A1 (en) * 2016-01-21 2017-07-27 阿里巴巴集团控股有限公司 Method, apparatus, and system for hot-deploying application
US11055085B2 (en) 2016-01-21 2021-07-06 Banma Zhixing Network (Hongkong) Co., Limited Method, apparatus, and system for hot-deploying application
CN107346252A (en) * 2016-05-07 2017-11-14 腾讯科技(深圳)有限公司 Using update method and device
CN107346252B (en) * 2016-05-07 2021-05-25 腾讯科技(深圳)有限公司 Application updating method and device
CN107463391A (en) * 2016-06-03 2017-12-12 阿里巴巴集团控股有限公司 Task processing method, device and equipment
CN107508846A (en) * 2016-06-14 2017-12-22 北京京东尚科信息技术有限公司 The update method and system and terminal device of applications client
WO2018072493A1 (en) * 2016-10-17 2018-04-26 宁德时代新能源科技股份有限公司 Compiling method and compiling system
CN107943543B (en) * 2017-11-29 2022-01-14 优速云(福建)科技有限公司 WEB application hot deployment method and computer equipment
CN107943543A (en) * 2017-11-29 2018-04-20 福州市智捷信息科技有限公司 A kind of method and computer equipment of WEB application heat deployment
CN108491216A (en) * 2018-03-05 2018-09-04 北京指掌易科技有限公司 A kind of method of android system unaware application installation upgrading
CN108491216B (en) * 2018-03-05 2021-07-13 北京指掌易科技有限公司 Method for installing and upgrading non-sensory application of Android system
CN111435312A (en) * 2019-01-15 2020-07-21 北京嘀嘀无限科技发展有限公司 Application program management method and device and electronic equipment
CN111435312B (en) * 2019-01-15 2023-09-29 北京嘀嘀无限科技发展有限公司 Application program management method and device and electronic equipment
CN111736913B (en) * 2019-03-25 2021-11-19 华为技术有限公司 Class loading method and device
CN111736913A (en) * 2019-03-25 2020-10-02 华为技术有限公司 Class loading method and device
US11755341B2 (en) 2019-03-25 2023-09-12 Huawei Technologies Co., Ltd. Class loading method and apparatus
CN111866047A (en) * 2019-04-30 2020-10-30 北京达佳互联信息技术有限公司 Data decoding method and device, computer equipment and storage medium
CN110262818A (en) * 2019-05-29 2019-09-20 北京达佳互联信息技术有限公司 The hot update method of Java code, device, electronic equipment and storage medium
CN111625256A (en) * 2020-05-15 2020-09-04 广东浪潮大数据研究有限公司 Application program upgrading method, system, equipment and computer storage medium
CN111625256B (en) * 2020-05-15 2024-02-09 广东浪潮大数据研究有限公司 Application program upgrading method, system, equipment and computer storage medium
CN112363707A (en) * 2020-11-25 2021-02-12 国电南瑞科技股份有限公司 Control layer general scheduling method based on JAVA reflection technology
CN112363707B (en) * 2020-11-25 2022-09-09 国电南瑞科技股份有限公司 Control layer general scheduling method based on JAVA reflection technology
CN112379973A (en) * 2020-12-01 2021-02-19 腾讯科技(深圳)有限公司 Heavy loading method and device
CN112379973B (en) * 2020-12-01 2023-10-24 腾讯科技(深圳)有限公司 Heavy load method and device
CN113138787A (en) * 2021-04-28 2021-07-20 中消云(北京)物联网科技研究院有限公司 Program updating method and device
CN115576589A (en) * 2022-12-08 2023-01-06 平安银行股份有限公司 Program hot updating method, electronic equipment and storage medium

Also Published As

Publication number Publication date
HK1166396A1 (en) 2012-10-26
CN102402427B (en) 2015-09-02

Similar Documents

Publication Publication Date Title
CN102402427B (en) A kind of update method of java application and device
US11853774B2 (en) Dynamically loaded plugin architecture
CN108027722B (en) Dynamically updating applications in compilation and deployment
US10795660B1 (en) Live code updates
US11385993B2 (en) Dynamic integration of command line utilities
Hellman Android programming: Pushing the limits
US20160232017A1 (en) System and Method for Reloading Constructors
US20090319554A1 (en) Unified metadata for external components
US9459986B2 (en) Automatic generation of analysis-equivalent application constructs
US20090320007A1 (en) Local metadata for external components
JP2022553860A (en) runtime container
WO2018187798A1 (en) Flow-based scoping
US9367429B2 (en) Diagnostics of declarative source elements
CN102364433A (en) Method for realizing Wine construction tool transplanting on ARM (Advanced RISC Machines) processor
US9141356B2 (en) Process for generating dynamic type
US11366657B2 (en) Inferring code deprecation from module deprecation
Gregersen Implications of modular systems on dynamic updating
Nutter et al. JRuby
US8135943B1 (en) Method, apparatus, and computer-readable medium for generating a dispatching function
Mukherjee et al. Weaves: A framework for reconfigurable programming
Gregersen et al. State of the art of dynamic software updating in Java
Aranega et al. Tool demo: fine-grained run-time reflection in Python with Reflectivipy
Starkman The Robot Operating System in Transition: Experiments and Tutorials
De Florio Fault-Tolerant Protocols Using Aspect Orientation
Cinar Communicating with Native Code using JNI

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1166396

Country of ref document: HK

C14 Grant of patent or utility model
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: GR

Ref document number: 1166396

Country of ref document: HK