CN101236503A - Hot-deployment entity component - Google Patents

Hot-deployment entity component Download PDF

Info

Publication number
CN101236503A
CN101236503A CNA2008100078890A CN200810007889A CN101236503A CN 101236503 A CN101236503 A CN 101236503A CN A2008100078890 A CNA2008100078890 A CN A2008100078890A CN 200810007889 A CN200810007889 A CN 200810007889A CN 101236503 A CN101236503 A CN 101236503A
Authority
CN
China
Prior art keywords
class
entity
dialogue
factory
loader
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.)
Pending
Application number
CNA2008100078890A
Other languages
Chinese (zh)
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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CNA2008100078890A priority Critical patent/CN101236503A/en
Publication of CN101236503A publication Critical patent/CN101236503A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

The present invention relates to a hot deployment entity class component, which is a realization mode of object relation mapping and is used to realize the data information exchange and data transmission of digital media resources. The present invention comprises a dialogue factory class, a class loading controller and a class loader. The steps of the present invention are that: a class byte code stream is added to the dialogue factory class; the dialogue factory class invokes the class loading controller, sends the class byte code stream to the class loading controller for processing; the class loading controller creates a new entity class loader and compiles transmitted byte codes as a newly created entity class; the entity class is sent back to the dialogue factory through the class loading controller to finish the hot adding to the entity class; an instruction in uninstall assignment class is sent to the dialogue factory class, and the dialogue factory forwards the instruction to the class loading controller; the class loading controller deletes the class loader of the class, clears and destroys the class loader from cache, so as to complete the hot uninstall of the entity class.

Description

A kind of hot-deployment entity component
Technical field
Hot-deployment entity component of the present invention is a kind of implementation to ORM in the Java language (Object Relational Mapping, Object Relation Mapping) function, is used to realize the data information exchange and the data transmission of digital media resource.
Background technology
ORM is a kind of in order to solve the technology of the mutual mismatch problem that exists in object-oriented and the relational database, and applied functional module is all arranged in multiple programming language.Hibernate (the open source code product is being free on the market and widespread use) is exactly typical case's realization of ORM function in the Java field.Hibernate, what present is the mapping of static entities Bean to database, and static entities Bean is meant the data type with a series of attributes that has pre-defined before the program run, does not possess extendability when operation, thereby does not support the heat of transaction Bean is disposed.
And so-called heat is disposed, also claim heat management, including but not limited to program, plug-in unit, data/database, or the heat of module or the like loads, heat is installed, carry with heat is imperial, that is when the structure of system or application program, function, after the data that include etc. have had artificial or unartificial changes such as increase or minimizing, need not restart whole this system software, database, person's application program, or this other system, also can keep the state when this system or application program are current to be moved substantially, bringing into play under its original function situation in the same old way, also carried out the process of new function simultaneously.
Transaction Bean is meant the entity B ean that creates when program run, have very high extendability during operation, can increase property content.
If do not support transaction Bean, defective is tangible so, promptly, when the Business Entity model changes, use system or the application program of Hibernate, just corresponding entity class can not be under the situation that the system that is disposed does not restart, be written into again, thereby the mapping of solid model can't be finished immediately to database table structure.
Summary of the invention
The present invention is primarily aimed at Java Entity Bean, and promptly the heat of Java entity class is disposed target.This is a kind of component software that is used for hot-deployment entity, and called after Yangtse based on following framework and the advantage brought, solves above-mentioned defective.
Yangtse simplifies and realizes ORM with reference to the standard among the JPA 1.0 (being about the standard of ORM among the JEE5).
Realize theing contents are as follows of Yangtse scheme:
Introduce a notion, Classloader, i.e. ClassLoader earlier.Java class file in Java after the compiling is a unicode, it is the Unicode file, JVM when program run, be Java Virtual Machine (Java Virtual Machine), can remove to search class file according to the actual requirements, earlier it is become the byte code stream, then it is compiled into executable binary stream, and be put in the buffer memory, in this process, if this class file is loaded and compiles, use this time-like later on, to directly take out from buffer memory, such process is finished by a class in JVM, and this class just is Classloader.
Thereby, in Java, class is realized hot principle of disposing, be exactly by the bytecode of Classloader dynamic load specified class and the class of dynamically deleting appointment.Among the present invention, realize that promptly Entity Bean carries out that heat disposes, and just is based on this principle to entity class.Yangtse of the present invention is based on this principle, but the order that Classloader is searched class is improved again, to satisfy actual needs.Classloader is searched among the default sequence of class and the Yangtse entity class Classloader and is searched type systematic among the general Java, respectively as shown in fig. 1.
Can find out the entity class loader from figure below of Fig. 1, promptly Entity ClassLoader is to be written into class from the entity class loader of same level, is not to be written into class from file.From the entity class loader of peer, be written into class, just mean that this entity class just can be disposed by heat so if distribute an entity class loader for each entity class.Therefore, in Yangtse, when adding the entity class that to dispose, just distribute an entity class loader to it; When this entity class of unloading, just delete the entity class loader at this type of place, give Java rubbish device with this entity class loader then and handle, and these processes do not need to restart the current application program system.
Yangtse finish entity is carried out hot deployment main-process stream as shown in Figure 2.Among Fig. 2 as seen, add entity class byte code stream to SessionFactory (among the Yangtse, the session factory class that uses when connecting a data source, it is responsible for creating the functions such as session with data source, be equivalent to the persistence unit among the JPA, i.e. Persistence Unit) in, SessionFactory calls the interpolation operation of aforesaid hot deployment then, and return the java class after the compiling, promptly finish interpolation function entity class; When sending the instruction of unloading specified class to SessionFactory, SessionFactory calls the unloading operation of above-mentioned hot deployment and promptly finishes the function that this entity class is unloaded.Adding new entity class process, a new entity class loader compiling class bytecode of creating is the process of class exactly.Wherein, JVM is the search procedure shown in calling graph 1 figure below automatically, solves the dependence to other classes, especially to the dependence of entity.
In JPA, each entity class only is subordinated to a persistence unit, so claim the non-entity class that are subordinated to current persistence unit " external entity class " each other each other here.In the compiling procedure of Yangtse, can use Java form " mark symbol @OutsideEntity " to mark an associated entity, this entity belongs to the external entity class.Thereby, make Yangtse can call other JPA assemblies, finish the time-delay of associated external entity class and loading in time.
Yangtse is the sub-project of " polymerization medium Resource TOC exchange system " (hereinafter to be referred as " exchange system "), and promptly the so-called hot-deployment entity component in this system also can claim heat management module or assembly.So crucial application is arranged in this " exchange system ".This exchange system belongs to the information resources switching technology of computer internet medium, is used to realize the metadata information exchange and the data transmission of digital media resource.What the metadata schema that exchanges in this exchange system had a height can self-defined property, that is: by allowing the user on the interface, define metadata schema, when this model by after examining, this system uses this model data, call the function that generates the entity class bytecode among the Yangtse then, generate the pairing entity class of this model, transfer to Yangtse then and finish the heat of this entity class is disposed, thereby finish Database Mapping.Afterwards, the user uses Yangtse just can finish this solid data is safeguarded, the user must inquire about to use the object-oriented query statement.When model changes, the user can be earlier from Yangtse corresponding entity class in the current model of unloading, and then add newly-generated entity class, finish model the heat of entity class mapped out the work.
Comprehensively above-mentioned, use the component software (the present invention is with its called after Yangtse) that is used for hot-deployment entity of the present invention, just can realize the heat of transaction class is disposed, thereby under the situation of not restarting current application program or system, change to solid model is come into force, can not influence the normal operation of system basically.
Description of drawings
Fig. 1 is the comparison synoptic diagram to conventional art and loading entity class of the present invention order;
Fig. 2 is for realizing the heat management synoptic diagram among the present invention.
Embodiment
Further specify claims and summary of the invention with example below.
Fig. 1 is for to conventional art and the present invention synoptic diagram of comparing in proper order of the loading classes of scheme separately.Parent ClassLoader (being the parent loader), EntityClassLoader (entity class loader) and ClassLoader Controller (Classloader controller) are Classloaders in the drawings, the difference name that gives because of residing role is different.Directed line, promptly arrow line represents to search the direction of action, and the numeral on the line is searched the step of action, has reflected order; It is a plurality of that dotted line represents that this Classloader can have.
Last figure among Fig. 1 is the default sequence of system loads class in the existing technology, and detailed step is as follows:
Whether step 1. detects such and was written into, and detects promptly in buffer memory cache whether this type of is arranged.If have then to step 5, if not then to step 2.The as above line among the figure 1;
Step 2. uncle's Classloader (if there is not the parent loader, the Classloader that then uses acquiescence is as the parent loader) then is written into, if can not find then to step 3, if find then to step 5.The as above line 2 of figure;
Step 3. is sought class file from the class.path that Classloader is relevant therewith, be written into class from file.If can not find then to step 4, if find then to step 5.The as above line 3 of figure;
Step 4. is dished out and be can not find the unusual of specified class;
Step 5. is returned class.
Figure below among Fig. 1 is the order that Yangtse entity class loader is searched class, is described in detail as follows:
Whether step 1. detects this type of and was written into, and promptly looks in buffer memory cache whether this type of is arranged.If have then to step 4, if not then to step 2.Line 1 as figure below;
Step 2. is written into (default sequence that this process is exactly the system loads class) from the class loading control then.If can not find, then to be written into class from the buffer memory of other entity class loader of its administration, as line 2.2, such entity class loader can have N, so that make this search procedure, promptly the process shown in the line 2.2 repeats N time; Promptly arrive step 4 if find, otherwise to step 3.As the line in figure below 2;
Step 3. is dished out and be can not find the unusual of specified class;
Step 4. is returned class.
More above-mentioned two processes can find out, Yangtse is that the entity class loader from peer is written into class, is not written into class from file.From the entity class loader of peer, be written into class, mean that this entity class just can be disposed by heat so if distribute an entity class loader for each entity class.This entity class is after being disposed by heat, and the dependence between the entity class just can normally be moved.And from file, be not written into, be because the entity class that needs heat to dispose all is dynamically to generate, so, needn't add this process in the entity class loader in the Yangtse the inside.
Fig. 2 is that assembly of the present invention is realized the heat management synoptic diagram.
Among the Yangtse of the present invention, what use when connecting a data source is a kind of SessionFactory (session factory class).By this kind, create functions such as session with data source, it is equivalent to so-called persistence unit (PersistenceUnit) among the JPA.
When the user adds entity class byte code stream among the SessionFactory to, SessionFactory calls the class loading control then, gives the class loading control class byte code stream and handles; The class loading control is created a new entity class loader, and uses this entity class loader compiling to pass the bytecode of coming in, and makes it to become java class.The new entity class loader compiling class bytecode of creating is in the process of class, and the search procedure shown in automatic calling graph 1 figure below of JVM solves the dependence to other classes, especially to the dependence of entity.Return the java class of this new establishment then, promptly finished the heat of entity class is added function.When the class of user to SessionFactory transmission unloading appointment, SessionFactory is transmitted to the class loading control with this order then, and the class loading control unloads this type of Classloader, promptly finishes the process of this entity class unloading.
Wherein, entity class loader compiling class bytecode in above-mentioned new establishment is in the process of class, compiler will find this type of class of quoting, claim " dependence class ", to detect the problem whether class deposits that relies on, detect this problem then, finish whole compilation process at last, can normally be carried out when the program run to guarantee this type of.Search in the process that relies on class at this, compiler can the described process of automatic calling graph 1 figure below be searched the dependence class, relies on class then can't pass compiling if can not find; If can find class, the problem that class is relied on when compiling with regard to solving.
Carry out in the process in above-mentioned compiling, must search associated entity class (or relying on class): owing to need to give each entity class to distribute an entity class loader, to guarantee that each entity can both be disposed by heat, so need search the associated entity class by the entity class loader of same level.This also is the main place that hot-deployment entity component Yangtse of the present invention is different from conventional art.

Claims (6)

1. hot-deployment entity component is characterized in that:
This assembly comprises dialogue factory class, class loading control, Classloader, and job step is:
The user adds entity class byte code stream in the dialogue factory class to, and this dialogue factory class calls described class loading control then, gives the class loading control entity class byte code stream and handles;
Such loading control is created a new entity class loader, and uses this entity class loader compiling to pass the described bytecode of coming in, with its entity class as new establishment;
By described class loading control, sent the entity class of this new establishment back to dialogue factory, finish the heat of entity class is added;
And,
When the instruction of user to described dialogue factory class transmission unloading specified class, this dialogue factory then is transmitted to this instruction described class loading control;
Such loading control is promptly deleted this type of Classloader, and removes from buffer memory and destroy, and finishes the heat unloading of this entity class.
2. hot-deployment entity component according to claim 1 is characterized in that:
The entity class loader of described new establishment is compiled as the class bytecode in the process of entity class, by the entity class loader in the virtual machine of program language establishment, searches related entity class automatically, and the order of searching class is as follows:
Whether step 1 detects this type of and was written into, and whether promptly look in buffer memory has this type of, if having then to step 4, if not then to step 2;
Step 2 is written into from the class loading control, if can not find, then to from the buffer memory of other entity class loader of its administration, being written into class, such entity class loader, rank is identical, can have a plurality of, thereby make this search procedure repeat plural number; Promptly arrive step 4 if find, otherwise to step 3;
Step 3, dishing out can not find the unusual of specified class;
Step 4 is returned class.
3. hot-deployment entity component according to claim 2 is characterized in that:
The virtual machine of described program language establishment is a Java Virtual Machine.
4. hot-deployment entity component according to claim 1 is characterized in that:
The entity class of described new establishment is a java class.
5. hot-deployment entity component according to claim 2 is characterized in that:
The entity class of described association or entity for a plurality of, mark respectively with different titles, and these a plurality of entity class or entity be not under the jurisdiction of each other each other, be in outside each other mutually.
6. hot-deployment entity component according to claim 5 is characterized in that:
The form of described title is the Java form, that is, and and mark symbol @OutsideEntity.
CNA2008100078890A 2008-02-27 2008-02-27 Hot-deployment entity component Pending CN101236503A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2008100078890A CN101236503A (en) 2008-02-27 2008-02-27 Hot-deployment entity component

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2008100078890A CN101236503A (en) 2008-02-27 2008-02-27 Hot-deployment entity component

Publications (1)

Publication Number Publication Date
CN101236503A true CN101236503A (en) 2008-08-06

Family

ID=39920147

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2008100078890A Pending CN101236503A (en) 2008-02-27 2008-02-27 Hot-deployment entity component

Country Status (1)

Country Link
CN (1) CN101236503A (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102402427A (en) * 2010-09-09 2012-04-04 阿里巴巴集团控股有限公司 Method and device for updating Java application program
CN102819438A (en) * 2011-06-08 2012-12-12 金蝶软件(中国)有限公司 Hot-load method and device and information system
CN101763271B (en) * 2008-12-26 2013-01-16 爱思开电讯投资(中国)有限公司 Method and device for loading classes and creating and accessing class objects
CN104935561A (en) * 2014-03-19 2015-09-23 国家电网公司 Assembly data processing method and device thereof
CN105242948A (en) * 2015-10-27 2016-01-13 江苏电力信息技术有限公司 Java web project based hot deploy implementation method
CN102819438B (en) * 2011-06-08 2016-12-14 金蝶软件(中国)有限公司 Method, device and the information system that a kind of heat loads
CN106502751A (en) * 2016-11-15 2017-03-15 努比亚技术有限公司 Heat deployment apparatus and method
CN106708494A (en) * 2015-11-18 2017-05-24 北京神州泰岳软件股份有限公司 JAR upgrading method and apparatus
CN106708547A (en) * 2015-11-12 2017-05-24 卓望数码技术(深圳)有限公司 Service plug-in management method and system
CN108363612A (en) * 2018-03-07 2018-08-03 江苏电力信息技术有限公司 The J2EE modules heat deployment and recalls information statistical method realized based on class loaders
CN108376064A (en) * 2016-11-24 2018-08-07 阿里巴巴集团控股有限公司 The correlation technique of rule engine system and regulation engine
CN109491718A (en) * 2018-09-13 2019-03-19 北京米文动力科技有限公司 A kind of plug-in loading method and equipment
CN112286533A (en) * 2020-11-16 2021-01-29 广州速威智能系统科技有限公司 Thermal restoration method and device for cloud service

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101763271B (en) * 2008-12-26 2013-01-16 爱思开电讯投资(中国)有限公司 Method and device for loading classes and creating and accessing class objects
CN102402427B (en) * 2010-09-09 2015-09-02 阿里巴巴集团控股有限公司 A kind of update method of java application and device
CN102402427A (en) * 2010-09-09 2012-04-04 阿里巴巴集团控股有限公司 Method and device for updating Java application program
CN102819438A (en) * 2011-06-08 2012-12-12 金蝶软件(中国)有限公司 Hot-load method and device and information system
CN102819438B (en) * 2011-06-08 2016-12-14 金蝶软件(中国)有限公司 Method, device and the information system that a kind of heat loads
CN104935561B (en) * 2014-03-19 2018-06-01 国家电网公司 A kind of module data treating method and apparatus
CN104935561A (en) * 2014-03-19 2015-09-23 国家电网公司 Assembly data processing method and device thereof
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
CN106708547A (en) * 2015-11-12 2017-05-24 卓望数码技术(深圳)有限公司 Service plug-in management method and system
CN106708494A (en) * 2015-11-18 2017-05-24 北京神州泰岳软件股份有限公司 JAR upgrading method and apparatus
CN106502751A (en) * 2016-11-15 2017-03-15 努比亚技术有限公司 Heat deployment apparatus and method
CN108376064A (en) * 2016-11-24 2018-08-07 阿里巴巴集团控股有限公司 The correlation technique of rule engine system and regulation engine
CN108363612A (en) * 2018-03-07 2018-08-03 江苏电力信息技术有限公司 The J2EE modules heat deployment and recalls information statistical method realized based on class loaders
CN109491718A (en) * 2018-09-13 2019-03-19 北京米文动力科技有限公司 A kind of plug-in loading method and equipment
CN112286533A (en) * 2020-11-16 2021-01-29 广州速威智能系统科技有限公司 Thermal restoration method and device for cloud service
CN112286533B (en) * 2020-11-16 2024-01-26 广州速威智能系统科技有限公司 Thermal restoration method and device for cloud service

Similar Documents

Publication Publication Date Title
CN101236503A (en) Hot-deployment entity component
US8984009B2 (en) Methods and systems for utilizing bytecode in an on-demand service environment including providing multi-tenant runtime environments and systems
CN102521254B (en) Uniform access method of isomeric database
CN113872948A (en) Method for executing intelligent contract, block chain node and node equipment
US20040176968A1 (en) Systems and methods for dynamically configuring business processes
WO2007101734A1 (en) Plug-in update and management
CN111176791B (en) Cross-virtual machine calling method based on multi-virtual machine blockchain platform
CN105808776A (en) Data management system and method of distributed database
JP7293314B2 (en) Ethereum virtual machine transaction processing method, apparatus, equipment, program and medium
CN102339298A (en) Method, device and system for updating SQL (Structured Query Language) script metadata
CN107122216B (en) Dynamic loading method for embedded real-time operating system
CN104679572A (en) Plug-in support method based on preloading mechanism
CN101727475A (en) Method, device and system for acquiring database access process
CN104615489A (en) Multi-node data interaction achieving method
CN104423982A (en) Request processing method and device
US9411618B2 (en) Metadata-based class loading using a content repository
CN110659088B (en) Method and system for expanding program under embedded environment
US8707260B2 (en) Resolving interdependencies between heterogeneous artifacts in a software system
Kolovos et al. The epsilon pattern language
US11474832B2 (en) Intelligently determining a virtual machine configuration during runtime based on garbage collection characteristics
CN109558121A (en) Development approach, device, equipment and the storage medium of interface drive program
CN100456238C (en) Method and apparatus for realizing distributed object persistence and compiling unit
CN110334031B (en) Memory allocation code detection method and device, computer equipment and storage medium
CN109783132B (en) Method and device for realizing system singleization and distribution
CN101458628A (en) Program edition management method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
DD01 Delivery of document by public notice

Addressee: Pan Zhengzheng

Document name: Notification of before Expiration of Request of Examination as to Substance

C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Open date: 20080806

DD01 Delivery of document by public notice

Addressee: Pan Zhengzheng

Document name: Notification that Application Deemed to be Withdrawn