CN102226888B - Framework loading method and device - Google Patents

Framework loading method and device Download PDF

Info

Publication number
CN102226888B
CN102226888B CN201110134966.0A CN201110134966A CN102226888B CN 102226888 B CN102226888 B CN 102226888B CN 201110134966 A CN201110134966 A CN 201110134966A CN 102226888 B CN102226888 B CN 102226888B
Authority
CN
China
Prior art keywords
framework
loader
loading
configuration
loads
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.)
Expired - Fee Related
Application number
CN201110134966.0A
Other languages
Chinese (zh)
Other versions
CN102226888A (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.)
Huawei Digital Technologies Chengdu Co Ltd
Original Assignee
Huawei Symantec Technologies Co 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 Huawei Symantec Technologies Co Ltd filed Critical Huawei Symantec Technologies Co Ltd
Priority to CN201110134966.0A priority Critical patent/CN102226888B/en
Publication of CN102226888A publication Critical patent/CN102226888A/en
Application granted granted Critical
Publication of CN102226888B publication Critical patent/CN102226888B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The embodiment of the invention provides a framework loading method and device. The framework loading method comprises the following steps that: if a loader judges to know that a configuration state is unconfigured, the loader provides a configuration interface to obtain port information; and the loader loads a framework according to the port information. The framework loading device comprises the loader, and the loader comprises a judging module and a loading module. The judging module is used for providing the configuration interface to obtain the port information if the loader judges to known that the configuration state is unconfigured; and the loading module is used for loading the framework according to the port information and further generating state change indication information. The framework loading method and device provided by the embodiment of the invention can configure the configuration information of the framework according to the port information so as to load the framework, thereby improving the flexibility and the accuracy of framework loading.

Description

Framework loading method and equipment
Technical field
The embodiment of the present invention relates to software development technique, relates in particular to a kind of framework loading method and equipment.
background technology
Spring framework (Spring Framework is called for short Spring framework) is a Java/JavaEE application framework of increasing income.Spring framework because of its there is light weight, control reversion, towards the feature such as tangent plane and container, can reduce the complicacy of enterprise's application and development, thereby obtain widely application.
When Java Web application starts, conventionally need to load Spring framework, prior art provides can a kind of loading method, and preset a configuration file in web application is write the loading interface of Spring exactly in configuration file.In the time starting web application, web application loads Spring framework according to the loading interface of the Spring in this configuration file automatically.
In the field deployment process of Java web application, must first in Java web application, find this configuration file, by third party application (as the vi instrument of the notepad of Windows system, linux system), configuration file is modified again, to adapt to actual scene, can start.In actual application, at least there is following defect in the method for therefore, carrying out the loading of Spring framework by configuration file:
One, very flexible.User is carrying out Java web application while disposing, must first configuration file carry out pre-configured, to having relatively high expectations of user.
Two, easily make mistakes.In configuration file, generally comprise a lot of configuration datas, particularly database configuration data, its form is all generally the technical term based on exploitation.It is modified, if instrument is incorrect, or amendment time makes a mistake, and cannot carry out timely verification, causes system to start.If do not backed up, even cannot review reduction, bring larger problem.
Three, installation and deployment cost is high.According to describing above, professional level, software familiarity to installation personnel are had relatively high expectations, and are taken time and effort.While particularly making a mistake, also cannot locate, even need developer's on-site support, the inevitable installation and deployment cost that greatly improves.
summary of the invention
The embodiment of the present invention provides a kind of framework loading method and equipment, to have improved dirigibility and accuracy that framework loads.
The embodiment of the present invention provides a kind of framework loading method, comprising: start application program, and described application program loads loader, said loader detects the inking device of the described framework recording in Parameter File;
Know that configuration status is not for configuring if described loader judges, provide configuration interface to obtain interface message;
Described loader is according to described interface message loading frame.
Framework loading method as above, described loader, according to described interface message loading frame, comprising:
Described loader is searched configuration file;
Described loader is revised described configuration file according to described interface message;
Described loader loads described framework according to described amended configuration file.
Framework loading method as above, described loader, according to after described interface message loading frame, also comprises:
Described loader is revised as described configuration status and configures.
Framework loading method as above, described loader, according to described interface message loading frame, also comprises:
Described framework loads relating module automatically.
Framework loading method as above, knows that configuration status is not for configuring if described loader judges, provides configuration interface with before obtaining interface message, also comprises:
Start application program;
Described application program loads described loader.
The embodiment of the present invention provides a kind of framework loading equipemtn, comprise that loader starts module and loader, described loader starts module, in the time starting application program, load described loader, described loader detects the configuration status of the described framework recording in Parameter File; Described loader comprises judge module and load-on module;
If described judge module judges and knows that configuration status is not for configuring for loader, provides configuration interface to obtain interface message;
Described load-on module is used for according to described interface message loading frame, and generates state change indication information.
Framework loading equipemtn as above, described load-on module comprises:
Search unit, for searching configuration file;
Interface amendment unit, for revising described configuration file according to described interface message;
Framework loading unit, for loading described framework according to described amended configuration file, and generates state change indication information.
Framework loading equipemtn as above, described loader also comprises:
Status modifier module, for being revised as described configuration status and configuring according to described state change indication information.
Framework loading equipemtn as above, also comprises:
Loader starts module, in the time starting application program, loads described loader.
The framework loading method that the embodiment of the present invention provides and equipment, by the setting of loader, detect the configuration status of framework, in the time that framework is not configured, provides configuration interface guiding user that interface message is provided.Loader is according to interface message loading frame, and to start the module being associated, the harmless time delay that has realized framework loads.User is without manually searching configuration file, and it is revised accordingly, improved the convenience of operation, and then improved dirigibility and accuracy that framework loads.
Brief description of the drawings
The framework loading method process flow diagram that Fig. 1 provides for the embodiment of the present invention;
A kind of framework loading equipemtn structural representation that Fig. 2 provides for the embodiment of the present invention;
The another kind of framework loading equipemtn structural representation that Fig. 3 provides for the embodiment of the present invention.
Embodiment
For making object, technical scheme and the advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described.It should be noted that, in accompanying drawing or instructions, similar or identical element all uses identical Reference numeral.
The framework loading method process flow diagram that Fig. 1 provides for the embodiment of the present invention, as shown in Figure 1, this framework loading method comprises:
Know that configuration status is not for configuring if step 10 loader judges, provide configuration interface to obtain interface message;
In actual applications, when application program (comprising web application, multipad, Java application service etc.) starts, conventionally need loading frame, framework is specifically as follows Spring framework, is conventionally provided with Parameter File to record the configuration status of Spring framework in application program.In the time of initial start-up application program, conventionally Spring framework is not loaded and carries out corresponding configuration, the configuration status in this Parameter File is not configuration.Concrete, can represent configuration status by overall static parameter value, in the time that overall static parameter value is false, represent Spring framework not to be loaded and carries out corresponding configuration, in the time that overall static parameter value is true, represent Spring framework to be loaded and carries out corresponding configuration, can directly load Spring framework to complete the start-up course of application program.Configuration interface is specially friendly human-computer interaction interface, by corresponding configuration instruction guides user input interface information.In actual applications, interface message is specifically as follows the parameter information such as address, username and password of such as database, or the storage address information of journal file.Configuration interface, can utilize prior art (as JSP, Swing etc.) to realize, and the hommization such as drop-down list, format check operation is provided.
Step 20, loader are according to interface message loading frame.
Concrete, this loader is non-Spring relating module, can not rely on Spring framework practical function.Loader can adopt Java to realize, and following functions can be provided: encapsulation Spring framework loading interface ContextLoaderListener; Load Spring framework: by creating the example of ContextLoaderListener, call its acquiescence loading method contextInitialized; Judge whether Spring loads.
The framework loading method that the present embodiment provides, by the setting of loader, detects the configuration status of framework, in the time that framework is not configured, provides configuration interface guiding user that interface message is provided.Loader is according to interface message loading frame, and to start the module being associated, the harmless time delay that has realized framework loads.User is without manually searching configuration file, and it is revised accordingly, improved the convenience of operation, and then improved dirigibility and accuracy that framework loads.
In the present embodiment, step 20, loader, according to interface message loading frame, specifically can comprise:
Step 201, loader are searched configuration file;
Step 202, loader are revised configuration file according to interface message;
Step 203, loader are according to amended configuration file loading frame.
Conventionally configuration file has specific memory location, or configuration file has specific file layout, and loader can directly be searched configuration file to assigned address.Revise the corresponding contents of the configuration file finding according to interface message, concrete, in configuration file, default interface recording of information position has specific mark conventionally, by the default interface information that finds to this mark, and this interface message is replaced to default interface information, provide correct interface to be embodied as the loading of framework.
In the present embodiment, step 20, loader, according to interface message loading frame, can also comprise afterwards:
Step 30, loader are revised as configuration status and configure.
By being the amendment of configuration status, avoid starting application program is all to carry out the configuration of framework loading at every turn.
In the present embodiment, step 20, loader, according to interface message loading frame, can also comprise:
Step 204, framework load relating module automatically.
After framework loads successfully, automatically load the relating module taking this framework as applied environment.
In the present embodiment, know that configuration status is not for configuring if step 10 loader judges, provide configuration interface to obtain interface message, can also comprise before:
Step 40, the application program that starts;
Step 50, application program loads loader.
In actual application, the detailed process that the framework loading method providing by the present embodiment carries out the loading of Spring framework can be: user launches application, the automatic loads loader of application program, loader detects the configuration status of the Spring framework recording in Parameter File, know that if judge configuration status is not for configuring, provide configuration interface to user, user provides interface message according to the guiding of configuration interface.Loader is searched configuration file, according to interface message, the corresponding contents of configuration file is modified, and loader loads Spring framework according to amended configuration file again.Loader is revised as the configuration status in Parameter File and configures.If loader judges that the configuration status of knowing in Parameter File, for configuring, directly loads Spring framework.Spring framework loads Spring relating module after loading automatically.So far just completed the start-up course of this application program.
A kind of framework loading equipemtn structural representation that Fig. 2 provides for the embodiment of the present invention, as shown in Figure 2, this framework loading equipemtn comprises loader 31, loader comprises judge module 311 and load-on module 312.If judge module 311 judges and knows that configuration status is not for configuring for loader, provides configuration interface to obtain interface message.Load-on module 312 is for according to interface message loading frame, and generates state change indication information.
The framework loading equipemtn that the present embodiment provides, by the setting of judge module 311, detects the configuration status of framework, in the time that framework is not configured, provides configuration interface guiding user that interface message is provided.Loader 31 is according to interface message loading frame, and to start the module being associated, loader 31 is as the buffer memory between application program launching module and framework, and the harmless time delay that has realized framework loads.User is without manually searching configuration file, and it is revised accordingly, improved the convenience of operation, and then improved dirigibility and accuracy that framework loads.
The another kind of framework loading equipemtn structural representation that Fig. 3 provides for the embodiment of the present invention, as shown in Figure 3, in the present embodiment, load-on module 312 can comprise searches unit 3121, interface amendment unit 3122 and framework loading unit 3123.Search unit 3121 for searching configuration file.Interface amendment unit 3122 is for revising configuration file according to interface message.Framework loading unit 3123 is for according to amended configuration file loading frame, and generates state change indication information.
In the present embodiment, loader 31 can also comprise status modifier module 313, and status modifier module 313 is for being revised as configuration status and configuring according to state change indication information.
In the present embodiment, this framework loading equipemtn, can also comprise that loader starts module 32, and loader starts module 32 in the time starting application program, loads loader 31.
The framework loading method that the embodiment of the present invention provides and equipment, specifically can be applied to the equipment that the application program based on Spring framework is installed, as equipment such as Windows server, Linux servers, increase the ease for use of software, avoid the application program of prior art, the particularly installation and deployment of JavaEE application program, the professional knowledge that deployment personnel are had requires higher defect.The JavaEE application program of developing according to existing mode, its installation and deployment time to be hour to calculate, the framework loading method and the equipment that adopt this inventive embodiments to provide, installation and deployment time 30% before being reduced to, has reduced the cost of installation and deployment.When installation, be also not easy to make mistakes, greatly reduce the risk of application program installation and deployment failure.
It should be noted that in Java and JavaEE exploitation, also have a lot of frameworks as Struts, Hibernate etc., the similar Spring framework loading method of employing that all embodiment of the present invention provides and equipment and application software are carried out in conjunction with the object loading to reach framework.
Finally it should be noted that: above embodiment only, in order to technical scheme of the present invention to be described, is not intended to limit; Although the present invention is had been described in detail with reference to previous embodiment, those of ordinary skill in the art is to be understood that: its technical scheme that still can record previous embodiment is modified, or part technical characterictic is wherein equal to replacement; And these amendments or replacement do not make the essence of appropriate technical solution depart from the spirit and scope of various embodiments of the present invention technical scheme.

Claims (7)

1. a framework loading method, is characterized in that, described method is used for loading Spring framework, and described method comprises:
Start application program;
Described application program loads loader, described loader detects the configuration status of the described Spring framework recording in Parameter File, wherein, described loader adopts Java to realize, and described loader judges by the example that creates ContextLoaderListener whether described Spring framework loads;
If described loader judges that the configuration status of knowing described Spring framework, for not configuration, provides configuration interface to obtain interface message;
Described loader loads described Spring framework according to described interface message.
2. framework loading method according to claim 1, is characterized in that, described loader loads described Spring framework according to described interface message, comprising:
Described loader is searched configuration file;
Described loader is revised described configuration file according to described interface message;
Described loader loads described Spring framework according to described amended configuration file.
3. framework loading method according to claim 1 and 2, is characterized in that, described loader also comprises after loading described Spring framework according to described interface message:
Described loader is revised as described configuration status and configures.
4. framework loading method according to claim 1, is characterized in that, described loader loads described Spring framework according to described interface message, also comprises:
Described Spring framework loads relating module automatically.
5. a framework loading equipemtn, is characterized in that, described framework loading equipemtn is used for loading Spring framework, and described framework loading equipemtn comprises:
Loader starts module, for starting application program, and described application program loads loader;
Loader, the configuration status that is used for the described Spring framework that Parameter File is recorded detects, wherein, described loader adopts Java to realize, and described loader judges by the example that creates ContextLoaderListener whether described Spring framework loads;
Described loader comprises:
Judge module, if judge that for described loader the configuration status of knowing described Spring framework, for not configuration, provides configuration interface to obtain interface message;
Load-on module, for loading described Spring framework according to described interface message.
6. framework loading equipemtn according to claim 5, is characterized in that, described load-on module comprises:
Search unit, for searching configuration file;
Interface amendment unit, for revising described configuration file according to described interface message;
Framework loading unit, for loading described Spring framework according to described amended configuration file.
7. according to the framework loading equipemtn described in claim 5 or 6, it is characterized in that, described loader also comprises:
Status modifier module, for being revised as described configuration status and configuring.
CN201110134966.0A 2011-05-23 2011-05-23 Framework loading method and device Expired - Fee Related CN102226888B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110134966.0A CN102226888B (en) 2011-05-23 2011-05-23 Framework loading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110134966.0A CN102226888B (en) 2011-05-23 2011-05-23 Framework loading method and device

Publications (2)

Publication Number Publication Date
CN102226888A CN102226888A (en) 2011-10-26
CN102226888B true CN102226888B (en) 2014-10-08

Family

ID=44807857

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110134966.0A Expired - Fee Related CN102226888B (en) 2011-05-23 2011-05-23 Framework loading method and device

Country Status (1)

Country Link
CN (1) CN102226888B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103197935A (en) * 2012-01-09 2013-07-10 腾讯科技(深圳)有限公司 Application loading method and system
CN106126303B (en) * 2016-07-01 2019-09-17 合一信息技术(北京)有限公司 Installation method, the apparatus and system of (SuSE) Linux OS
CN107329755A (en) * 2017-06-29 2017-11-07 青岛华正信息技术有限公司 A kind of HZPHP frameworks
CN108897582A (en) * 2018-06-21 2018-11-27 珠海市君天电子科技有限公司 Interface loading method, device, electronic equipment, server and storage medium
CN110874246A (en) * 2018-08-28 2020-03-10 Tcl集团股份有限公司 Module loading method, system and equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1383327A (en) * 2002-06-10 2002-12-04 成都威斯达芯片有限责任公司 Digital detection method for transmitting movie scene by TV
CN101222371A (en) * 2008-01-24 2008-07-16 中国海洋大学 Client terminal component operation management system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100340984C (en) * 2004-01-02 2007-10-03 华为技术有限公司 Method for realizing application interface integration and business integration
CN1815442A (en) * 2005-02-05 2006-08-09 夏新电子股份有限公司 Method and device for user-defining interface for hand-held device
KR20080048836A (en) * 2006-11-29 2008-06-03 삼성전자주식회사 Apparatus and method for managing blog information

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1383327A (en) * 2002-06-10 2002-12-04 成都威斯达芯片有限责任公司 Digital detection method for transmitting movie scene by TV
CN101222371A (en) * 2008-01-24 2008-07-16 中国海洋大学 Client terminal component operation management system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
叶健毅.实现Spring实例.《精通Java EE-Eclipse Struts2 Hibernate Spring整合应用案例》.人民邮电出版社,2009,(第2版),第121-126页. *

Also Published As

Publication number Publication date
CN102226888A (en) 2011-10-26

Similar Documents

Publication Publication Date Title
US10732963B2 (en) System and method for automatically managing updated UEFI variables
CN110096424B (en) Test processing method and device, electronic equipment and storage medium
US9262237B2 (en) Automating software availability management based on API versioning
CN102226888B (en) Framework loading method and device
CN110673923B (en) XWIKI system configuration method, XWIKI system and computer equipment
US8918709B2 (en) Object templates for data-driven applications
US9690564B2 (en) Runtime detection of software configurations and upgrades
US11652686B2 (en) Systems and methods for dynamically commissioning and decommissioning computer components
CN103577201A (en) Embedded dual system updating method and system
CN108008962A (en) The collocation method and system of PXE server under a kind of linux system
US10579347B2 (en) Self re-encoding interpreted application
CN104881311A (en) Method and apparatus for judging version compatibility
JP2013214247A (en) Information processing device, control method, and program
CN114035786A (en) Dependency-based micro-front-end compatible migration method and system
CN109766207A (en) Restoration methods, device, monitoring device and the storage medium of firmware remote upgrade
CN112685040A (en) Method, device, equipment and storage medium for generating interface file in android system
WO2017076244A1 (en) Method, device and related system for dynamically repairing application
CN101753360B (en) Method applying system start-up, parallel management system and application management system
CN106528114A (en) Android firmware application, android firmware and firmware upgrading method
CN104021000B (en) The method that spring data sources are configured using the property file under dynamic route
CN108289114B (en) Cloud service system and method for processing cloud service exception
CN113821219A (en) Method and system for realizing application program containerization
CN106843952B (en) Method and device for updating function module in application
CN116149707B (en) Method and device for detecting and avoiding upgrading risk of distributed system
JP2012093979A (en) Osgi bundle and deployment package automatic creation system, automatic creation method and automatic creation tool

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C53 Correction of patent of invention or patent application
CB02 Change of applicant information

Address after: 611731 Chengdu high tech Zone, Sichuan, West Park, Qingshui River

Applicant after: HUAWEI DIGITAL TECHNOLOGIES (CHENG DU) Co.,Ltd.

Address before: 611731 Chengdu high tech Zone, Sichuan, West Park, Qingshui River

Applicant before: CHENGDU HUAWEI SYMANTEC TECHNOLOGIES Co.,Ltd.

COR Change of bibliographic data

Free format text: CORRECT: APPLICANT; FROM: CHENGDU HUAWEI SYMANTEC TECHNOLOGIES CO., LTD. TO: HUAWEI DIGITAL TECHNOLOGY (CHENGDU) CO., LTD.

C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20141008

CF01 Termination of patent right due to non-payment of annual fee