Summary of the invention
The technical problem to be solved in the present invention is how by the mode of man-machine interaction, solves the rapid deployment because realizing application program, and cause break down in certain application program or change the operation conflict causing other application programs.
The present invention proposes a kind of method of server disposition application program, comprises step:
Specified application deployed position in the server;
Separate management needs the application program of disposing, the deployed position of application program needing automatically actuated application program and running.
Preferably, described deployed position is preserved by setting up configuration file.
Preferably, described separate management need to dispose application program, need automatically actuated application program and the step of the deployed position of application program run to comprise:
Be respectively need to dispose application program, need automatically actuated application program and the configuration file of application program that running to set up corresponding managing folder to manage.
Preferably, described management comprises:
Add, delete or amendment.
Preferably, the method also comprises step:
According to interpolation management, the startup service command of invoking server, starts service.
Preferably, the method also comprises step:
According to deletion management, the stopping service interface of invoking server, stops service.
The present invention also proposes a kind of device of server disposition application program, comprising:
Configuration module, is used to specify application program deployed position in the server;
Administration module, for the application program needing to dispose, need automatically actuated application program and the application program run to carry out separate management.
Preferably, described deployed position is preserved by setting up configuration file.
Preferably, described administration module comprises:
Deployment unit, for the configuration file of the application program that managerial demand is disposed;
Start unit, for the configuration file of the automatically actuated application program of managerial demand;
Running unit, for managing the configuration file of the application program run.
Preferably, described management comprises:
Add, delete or amendment.
Preferably, this device also comprises:
Service starts module, manages, the startup service command of invoking server for the interpolation according to described administration module, starts service.
Preferably, this device also comprises:
Service stopping module, manages for the deletion according to described administration module, the stopping service interface of invoking server, stops service.
Preferably, this device also comprises:
Stop module, by the stopping service interface of invoking server, stop all application program service.
The method of server disposition application program of the present invention and device, by setting up the web application in intermediate system management Tomcat server, both the decoupling zero of Tomcat server and web application had been achieved, achieve the automatic deployment of web application simultaneously, be reached through the mode of man-machine interaction, solve rapid deployment because realizing application program, and cause break down in certain application program or change the object causing the operation of other application programs to conflict.
Embodiment
The present invention, by setting up the web application in intermediate system management Tomcat server, had both achieved the decoupling zero of Tomcat server and web application, had achieved the automatic deployment of web application simultaneously.For Web application developer, only need the realization paying close attention to own service, and no longer need concern how to be disposed in Tomcat server.For the managerial personnel of Tomcat server, the operation such as unloading and upgrading of container itself also can not be affected because of the web application be embedded in Tomcat server.
With reference to Fig. 1, propose the method for a kind of server disposition application program of one embodiment of the invention, comprising:
Step S10, specified application deployed position in the server;
Step S11, separate management need the application program of disposing, the deployed position of application program needing automatically actuated application program and running.
As described in step S10, by configuration file management application program, this configuration file specifies the position that application program is disposed.Application program can be deployed in arbitrarily Anywhere, and only need read configuration file can find application program, and does not need application program to bind.Above-mentioned server comprises Tomcat server etc.; Above-mentioned application program comprises web application etc.
As described in step S11, three managing folders can be set up, be respectively used to manage all application program, the deployed position of application program that needs automatically actuated application program and running that need to dispose.
Such as: which application program user can select need automatically to start by configuration, the deployed position of this application program can be added into and need in managing folder corresponding to automatically actuated application program.And any one application program can be started or stoped at any time, and do not disturb startup and the stopping of other application programs; As need application program be started, then only the deployed position of this application program need be added into the managing folder corresponding to application program run and all can; Otherwise, application program is deleted from this managing folder.
The application program that above-mentioned needs are disposed comprises the application program that in Tomcat server, all needs are disposed; The automatically actuated application program of above-mentioned needs comprises needs when Tomcat startup of server, the application program automatically run; The above-mentioned application program run comprises the application program starting or starting.
In an embodiment of the present embodiment, above-mentioned steps S11 can comprise:
Separate management needs the application program of disposing, the configuration file of application program needing automatically actuated application program and running.
Because above-mentioned configuration file can preserve deployed position, the configuration file namely by managing application program reaches the object of management application deployment position.And respectively by the application program needing to dispose, the configuration file of application program that needs automatically actuated application program and running, can be placed in corresponding managing folder.Above-mentioned management comprises interpolation, deletion or amendment etc.Namely the management of configuration file in managing folder be can be and configuration file in managing folder is added, delete or the operation such as amendment.
In another embodiment of the present embodiment, said method also can comprise:
According to interpolation management, call the startup service command of Tomcat server, start service.
Heat disposes the process of (starting or stoping) application program, and the interface provided by calling Tomcat server completes.
The method of the server disposition application program of the present embodiment, realizes by web administration control desk.
With reference to Fig. 2, when user selects to load web application, first, enter web administration control desk and select Web to start options, control desk will read the application profiles be configured in managing folder and return configuration file list of file names (i.e. web application list of file names).
The configuration file of web application is that the content of this file is as follows with the .xml file of web application name name:
<Contextpath="/myweb"docBase="F:\WebApp\myweb"debug="0"privileged="true">
</Context>
This configuration file provides the deployed position of web application, can find web application by deployed position.
Then, user can select the Web startup item (application program) needing to start from the configuration file list of file names returned, and configuration file corresponding for choice writes in the managing folder corresponding to application program run by control desk.
Web administration control desk will call the startup service command of Tomcat server, start the application program service in above-mentioned being checked.After service startup completes, user is by Web browser access Web application.
Said method also can comprise:
According to deletion management, call the stopping service interface of Tomcat server, stop service.
With reference to Fig. 3, when user needs to stop certain web application, first, enter web administration control desk, select Web to start options, control desk will read the application profiles be configured in managing folder and return configuration file list of file names, this list comprises and starting or startup item, during configuration filename corresponding to these startup items is checked, also comprise non-startup item, these non-startup items are not checked.
User can find out the configuration filename corresponding to web application that need stop in the list in being checked and remove and choose, then, web administration control desk then can call the stopping Web application service interface of Tomcat, stop the web application service that is checked, this process can not have influence on other be checked in the normal start-up and operation of application program.
In the present embodiment, by calling the stopping service interface of Tomcat server, all web application services can also be stopped.
The method of the server disposition application program of the present embodiment, a kind of robotization is provided to dispose the deployment scheme of web application, multiple web application can be managed, application program is started or stoped automatically, be independent of each other between each application program, and the multiple application program of heat deployment simultaneously can be realized; , can effectively application program be combined with Tomcat server, i.e. each application program needing to dispose of ALARA Principle, the service interface that can call Tomcat server again provides realizes hot disposing application program meanwhile.
With reference to Fig. 4, propose the device 20 of a kind of server disposition application program of another embodiment of the present invention, comprising:
Configuration module 21, is used to specify application program deployed position in the server;
Administration module 22, for the application program needing to dispose, need automatically actuated application program and the application program run to carry out separate management.
Above-mentioned configuration module 21 is by setting up configuration file management application program, and this configuration file specifies the position that application program is disposed.Application program can be deployed in arbitrarily Anywhere, and only need read configuration file can find application program, and does not need application program to bind.Above-mentioned server comprises Tomcat server etc.; Above-mentioned application program comprises web application etc.Above-mentioned deployed position is preserved by setting up configuration file.
Above-mentioned administration module 22 can set up three managing folders, is respectively used to manage all application program, the deployed position of application program that needs automatically actuated application program and running that need to dispose.
Such as: which application program user can select need automatically to start by configuration, the deployed position of this application program can be added into and need in managing folder corresponding to automatically actuated application program.And any one application program can be started or stoped at any time, and do not disturb startup and the stopping of other application programs; As need application program be started, then only the deployed position of this application program need be added into the managing folder corresponding to application program run and all can; Otherwise, application program is deleted from this managing folder.
The application program that above-mentioned needs are disposed comprises the application program that in Tomcat server, all needs are disposed; The automatically actuated application program of above-mentioned needs comprises needs when Tomcat startup of server, the application program automatically run; The above-mentioned application program run comprises the application program starting or starting.
With reference to Fig. 5, in an embodiment of the present embodiment, above-mentioned administration module 22 comprises deployment unit 221, start unit 222 and running unit 223; This deployment unit 221, for the configuration file of the application program that managerial demand is disposed; This start unit 222, for the configuration file of the automatically actuated application program of managerial demand; This running unit 223, for managing the configuration file of the application program run.
Because above-mentioned configuration file can preserve deployed position, the configuration file namely by managing application program reaches the object of management application deployment position.And respectively by the application program needing to dispose, the configuration file of application program that needs automatically actuated application program and running, can be placed in corresponding managing folder.Above-mentioned management comprises interpolation, deletion or amendment etc.Namely the management of configuration file in managing folder be can be and configuration file in managing folder is added, delete or the operation such as amendment.
Above-mentioned deployment unit 221, start unit 222 and running unit 223, the application program can disposed with needs respectively by foundation, the managing folder corresponding to application program needing automatically actuated application program and running, to manage corresponding configuration file.
With reference to Fig. 6, in another embodiment of the present embodiment, said apparatus 20 also can comprise service and start module 23, manages, call the startup service command of Tomcat server for the interpolation according to above-mentioned administration module 22, starts service.
Above-mentioned service starts module 23 when needs load web application, first, can read the configuration file that in the managing folder corresponding to application program needing to dispose, all web applications are corresponding, and return configuration file list of file names (i.e. web application list of file names).
This configuration file provides the deployed position of web application, can find web application by deployed position.
Then, the configuration filename corresponding to web application needing to start can be selected from the configuration file list of file names returned, and the configuration file of correspondence is write in the managing folder corresponding to application program run.
Call the startup service command of Tomcat server again, start above-mentioned application program service.After service startup completes, user is by Web browser access Web application.
Said apparatus 20 also can comprise service stopping module 24, manages, call the stopping service interface of Tomcat server for the deletion according to above-mentioned administration module 22, stops service.
Above-mentioned service stopping module 24, when stopping web application, first in the managing folder corresponding to the application program run, need be found out and need stop the configuration file corresponding to web application and delete; Then, then call the stopping Web application service interface of Tomcat, stop this web application service.
In the present embodiment, said apparatus 20 also comprises termination module 25, by calling the stopping service interface of Tomcat server, can stop all web application services.
Following concrete example explanation, such as need the all-purpose card of exploitation to apply, multiple APD such as vehicle line toll application and platform application is deployed in same Tomcat server, the device 20 of the server disposition application program of the present embodiment can be adopted just to achieve the goal.
Each application above-mentioned only needs respective configuration file to dispose in administration module 22, just can carry out management application to this configuration file.Available configuration interface simultaneously, the demand configuration according to user needs automatically actuated application, also can loading and unloading application at any time.All-purpose card application, when configuring, is configured to automatic startup item by such as user, and when so each said apparatus 20 starts, the application of this all-purpose card will startup item together start along with this device 20 by default; In device 20 operational process, can select to start vehicle line toll application or platform application by starting service option, and the startup of the application of this vehicle line toll or platform application does not affect the use of all-purpose card application.
Meanwhile, user also can stop certain applying as required at any time, such as needs to stop all-purpose card application, then select to stop by this device 20, other application can continue normal use.This device 20 also provides the function stopping all application services, and all application can all stop by this function.
The device 20 of the server disposition application program of the present embodiment, can be used as the bridge between link Tomcat server and web application, for starting, loading or unloading web application.The deployment information that this device 20 ALARA Principle web application is provided by configuration file; Meanwhile, as the communication interface of application program and Tomcat server, the interface provided by calling Tomcat server completes automatic heating disposing application program, so, can by Tomcat server and application program separated from one another, do not interfere with each other.
The foregoing is only the preferred embodiments of the present invention; not thereby the scope of the claims of the present invention is limited; every utilize instructions of the present invention and accompanying drawing content to do equivalent structure or equivalent flow process conversion; or be directly or indirectly used in other relevant technical fields, be all in like manner included in scope of patent protection of the present invention.