[go: up one dir, main page]

CN112860345B - Plug-in management method and device - Google Patents

Plug-in management method and device Download PDF

Info

Publication number
CN112860345B
CN112860345B CN202110215996.8A CN202110215996A CN112860345B CN 112860345 B CN112860345 B CN 112860345B CN 202110215996 A CN202110215996 A CN 202110215996A CN 112860345 B CN112860345 B CN 112860345B
Authority
CN
China
Prior art keywords
plug
configuration
app
container
configuration file
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.)
Active
Application number
CN202110215996.8A
Other languages
Chinese (zh)
Other versions
CN112860345A (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.)
Bank of China Ltd
Original Assignee
Bank of China 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 Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202110215996.8A priority Critical patent/CN112860345B/en
Publication of CN112860345A publication Critical patent/CN112860345A/en
Application granted granted Critical
Publication of CN112860345B publication Critical patent/CN112860345B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a plug-in management method and a device, wherein the method comprises the following steps: obtaining a plug-in container main configuration file, wherein plug-in service-id, loading level information and plug-in running configuration are explicitly declared in the plug-in container main configuration file; starting a plug-in container, and searching a plug-in configuration file under a classpath, wherein the plug-in configuration file contains plug-in release information; generating a corresponding configuration object according to the plug-in configuration file; writing the plug-in release information into a corresponding configuration object; filling loading level information and plug-in running configuration into a configuration object according to the plug-in service-id explicitly stated in the plug-in container main configuration file; and carrying out plug-in instantiation on the configuration object according to the loading level information. The invention can perform unified standard management on the plug-in, and improves the control management efficiency of the plug-in.

Description

Plug-in management method and device
Technical Field
The invention relates to the technical field of bank investment products, in particular to a plug-in management method and device.
Background
Industrialization of software has led to the evolution of software reuse from generic class libraries to domain-oriented application frameworks. The application framework emphasizes the design reusability of the software and the expandability of the system so as to shorten the development period of a large-scale application software system and improve the development quality. The future of application software development is to provide an open architecture to facilitate the selection, assembly and integration of middleware, and reuse of application frameworks has become one of the most effective reuse modes in software development and production. In the face of the development trend, the method is a brand new, open and high-expansibility architecture system, namely a plug-in architecture. Plug-in architecture designs have become very popular in recent years, where Eclipse has served as a push-aid, and mentioning that plug-ins will not be self-contained. The plug-in design is not new in nature and has been known for decades. Like the X-Server is based on a plug-in design, all its extended functions and device drivers are added in plug-ins except for the core functions.
In the existing plug-in management scheme, the management process is too complicated and complex, the management efficiency is low, and the plug-ins cannot be managed and controlled in a unified way. Accordingly, there is a need for a card management scheme that overcomes the above-described problems.
Disclosure of Invention
The embodiment of the invention provides a plugin management method, which is used for carrying out unified standard management on plugins and improving the control management efficiency of plugins, and comprises the following steps:
Obtaining a plug-in container main configuration file app-config.xml, wherein plug-in service-id is explicitly declared in the plug-in container main configuration file app-config.xml, and loading level information load-level and plug-in running configuration plug-in-configuration;
starting a plug-in container, and searching plug-in configuration files app-plug in under a classpath, wherein the plug-in configuration files app-plug in contain plug-in release information;
Generating a corresponding configuration object pluginInfo according to the plug-in configuration file app-plug in;
writing the plug-in release information into a corresponding configuration object pluginInfo;
filling loading level information load-level and plug-in running configuration plug-in-configuration into a configuration object pluginInfo according to the plug-in service-id explicitly stated in the plug-in container master configuration file app-configuration;
plug-in instantiation is carried out on the configuration object pluginInfo according to the loading level information load-level;
Further comprises: after the plug-in container is started, a monitoring mechanism listener is utilized to wake up a built-in event FrameworkOnReadyHandler; the built-in event FrameworkOnReadyHandler is registered in the plug-in.
The embodiment of the invention provides a plug-in management device, which is used for carrying out unified standard management on plug-ins and improving the control management efficiency of the plug-ins, and comprises the following components:
The file obtaining module is used for obtaining a plug-in container main configuration file app-config.xml, wherein plug-in service-id, loading level information load-level and plug-in running configuration plug-in-configuration are explicitly declared in the plug-in container main configuration file app-config.xml;
The file searching module is used for starting the plug-in container and searching plug-in configuration files app-plug in under the classpath, wherein the plug-in configuration files app-plug in contain plug-in release information;
The object generation module is used for generating a corresponding configuration object pluginInfo according to the plug-in configuration file app-plugin;
the information writing module is used for writing the plug-in release information into the corresponding configuration object pluginInfo;
the configuration filling module is used for filling the loading level information load-level and the plug-in running configuration plug-in-configuration into the configuration object pluginInfo according to the plug-in service-id explicitly stated in the plug-in container master configuration file app-configuration.
The instantiation module is used for carrying out plug-in instantiation on the configuration object pluginInfo according to the loading level information load-level;
Further comprises: the monitoring and awakening module is used for awakening the built-in event FrameworkOnReadyHandler by utilizing a monitoring mechanism listener after the plug-in container is started; the built-in event FrameworkOnReadyHandler is registered in the plug-in.
The embodiment of the invention also provides computer equipment, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the plug-in management method when executing the computer program.
The embodiment of the invention also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program realizes the plug-in management method when being executed by a processor.
According to the embodiment of the invention, through obtaining the plug-in container main configuration file app-config.xml, the plug-in container main configuration file app-config.xml explicitly declares plug-in service-id, load level information load-level and plug-in operation configuration plug-in-configuration; starting a plug-in container, and searching plug-in configuration files app-plug in under a classpath, wherein the plug-in configuration files app-plug in contain plug-in release information; generating a corresponding configuration object pluginInfo according to the plug-in configuration file app-plug in; writing the plug-in release information into a corresponding configuration object pluginInfo; filling loading level information load-level and plug-in running configuration plug-in-configuration into a configuration object pluginInfo according to the plug-in service-id explicitly stated in the plug-in container master configuration file app-configuration; and carrying out plug-in instantiation on the configuration object pluginInfo according to the loading level information load-level. According to the embodiment of the invention, the plug-in service-id is explicitly stated in the plug-in container main configuration file app-config.xml, the loading level information load-level and the plug-in operation configuration plug-in-configuration are carried out, and then plug-in instantiation is carried out on the configuration object pluginInfo according to the loading level information load-level, so that the problems that the management process is complicated and the management efficiency is low in the existing plug-in management scheme are effectively solved, unified standard management is carried out on the plug-in, and the control management efficiency of the plug-in is improved.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art. In the drawings:
FIG. 1 is a schematic diagram of a method for managing plug-ins according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of another method for managing plug-ins according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a method for managing plug-ins according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a configuration of a card managing apparatus according to an embodiment of the present invention;
fig. 5 is a block diagram of another card managing apparatus according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention will be described in further detail with reference to the accompanying drawings. The exemplary embodiments of the present invention and their descriptions herein are for the purpose of explaining the present invention, but are not to be construed as limiting the invention.
First, the nouns involved in the embodiments of the present application will be described:
Plug-in: plug-ins are modules that independently perform a function or a series of functions. A plug-in is a collection of related functions defined as services that exist in the form of java interfaces. Each plug-in has a unique service number, which is the basis for the plug-in framework to discover and inject configuration information and establish plug-in associations.
And (3) a host: the host is an environment that carries the plug-in operation, providing basic services for the plug-in. The plug-ins are typically managed and controlled by the host program.
As previously mentioned, something of a third party, such as Spring, may be used in addition to the plug-in frame. The timing task is independent of service, but we cannot guarantee that the task submitted by the user cannot use something of a third party such as Spring, but because the timing task is started by priority Spring, spring is not ready, but the timing task can immediately execute the user registered Spring task, so that task execution failure is caused.
In order to perform unified management on the plugins and improve the control management efficiency of the plugins, an embodiment of the present invention provides a plugin management method, as shown in fig. 1, where the method may include:
step 101, obtaining a plug-in container main configuration file app-config.xml, wherein plug-in service-id is explicitly declared in the plug-in container main configuration file app-config.xml, and loading level information load-level and plug-in operation configuration plug-in-configuration;
Step 102, starting a plug-in container, and searching a plug-in configuration file app-plug in under a classpath, wherein the plug-in configuration file app-plug in contains plug-in release information;
step 103, generating a corresponding configuration object pluginInfo according to the plug-in configuration file app-plugin;
104, writing the plug-in release information into a corresponding configuration object pluginInfo;
Step 105, filling loading level information load-level and plug-in running configuration plug-in-configuration into a configuration object pluginInfo according to the plug-in service-id explicitly stated in the plug-in container master configuration file app-configuration.
And 106, carrying out plug-in instantiation on the configuration object pluginInfo according to the loading level information load-level.
As can be seen from fig. 1, in the embodiment of the present invention, by obtaining a plug-in container main configuration file app-config.xml, the plug-in container main configuration file app-config.xml explicitly declares a plug-in service-id, load level information load-level and plug-in running configuration plug-in-configuration; starting a plug-in container, and searching plug-in configuration files app-plug in under a classpath, wherein the plug-in configuration files app-plug in contain plug-in release information; generating a corresponding configuration object pluginInfo according to the plug-in configuration file app-plug in; writing the plug-in release information into a corresponding configuration object pluginInfo; filling loading level information load-level and plug-in running configuration plug-in-configuration into a configuration object pluginInfo according to the plug-in service-id explicitly stated in the plug-in container master configuration file app-configuration; and carrying out plug-in instantiation on the configuration object pluginInfo according to the loading level information load-level. According to the embodiment of the invention, the plug-in service-id is explicitly stated in the plug-in container main configuration file app-config.xml, the loading level information load-level and the plug-in operation configuration plug-in-configuration are carried out, and then plug-in instantiation is carried out on the configuration object pluginInfo according to the loading level information load-level, so that the problems that the management process is complicated and the management efficiency is low in the existing plug-in management scheme are effectively solved, unified standard management is carried out on the plug-in, and the control management efficiency of the plug-in is improved.
In an embodiment, a plug-in container master configuration file app-config.xml is obtained, in which plug-in service-id, load level information load-level and plug-in running configuration plug-in-configuration are explicitly declared.
In this embodiment, the plug-in container master profile app-config. Xml is obtained as follows: reading an app-config.xml of a plug-in container main configuration file under a classpath; or reading context-parameter parameters in web xml, determining the name and storage position of a main configuration file according to the context-parameter parameters, and obtaining the plug-in container main configuration file app-config.
In practice, by default, the plug-in framework will read the app-config.xml file under classpath, and the name and location of the plug-in framework master configuration file may also be specified in web.xml. The framework master profile is specified by context-parameter parameters in web. The parameter name is context/frame-config, and the corresponding value is the storage position of the plug-in container main configuration file. Wherein the storage location may be an absolute path; or a path under the classpath, and the prefix of 'classpath:/' is used.
In an embodiment, a plug-in container is started, and a plug-in configuration file app-plug in under a classpath is searched, wherein the plug-in configuration file app-plug in contains plug-in release information.
In this embodiment, the plug-in publishing information includes: plug-in version number, plug-in service-id, depending on plug-in id, one or any combination of service implementation class information.
In practice, this information is of interest to the plug-in container. The plugin may also specify depend-services list, and reference other plugin services implementing IIoC interfaces by way of injection. When the plug-in is started, the container initializes the plug-in which is depended according to the information depended by the plug-in, and returns the instance of the completion of the construction. When the information is created, a plug-in developer makes a configuration information file in a plug-in jar package, and a plug-in configuration file naming rule < xxx >. App-plug in is stored in a catalog of app-plug in under CLASSPATH, and the configuration generally does not need to be adjusted by an application developer.
In an embodiment, according to the plug-in configuration file app-plugin, a corresponding configuration object pluginInfo is generated; writing the plug-in release information into a corresponding configuration object pluginInfo; filling loading level information load-level and plug-in running configuration plug-in-configuration into a configuration object pluginInfo according to the plug-in service-id explicitly stated in the plug-in container master configuration file app-configuration; and carrying out plug-in instantiation on the configuration object pluginInfo according to the loading level information load-level.
As shown in fig. 2, in this embodiment, the plug-in management method of fig. 1 further includes: step 107, after the plug-in container is started, waking up the built-in event FrameworkOnReadyHandler by using a monitoring mechanism listener; the built-in event FrameworkOnReadyHandler is registered in the plug-in.
In practice, the plug-in container finds and starts the plug-in under the following two conditions: the plug-in jar package containing the published information can be found in the plug-in container, and the plug-in service-id and the load level information load-level are explicitly declared in app-config.
In the embodiment of the invention, each basic function is finished by the plugin, and for the host framework, only basic event scheduling, data caching, plugin management and the like are needed, and corresponding business logic can be finished by the plugin. Therefore, the business logic can be very conveniently updated without affecting the content of the main frame, and the configurable system is provided by simplifying the system design through the plug-in mode, so that a developer is focused on the development of the business logic, and the development efficiency of the system is improved. The host framework manages the life cycle of all the plug-ins, namely, at some key points, the plug-ins are informed to perform operations such as initialization, starting, stopping, destroying and the like. The design benefit based on the plug-in is great, the expansion function is stripped from the frame, the complexity of the frame is reduced, and the frame is easier to realize. The extended functionality is coupled to the framework in a very loose manner, both of which can be independently changed and released while maintaining the interface unchanged. A plug-in interface is disclosed that gives third parties the opportunity to extend the functionality of an application. In addition, the open source and the closed source can coexist in a set of software, and whether the plug-in is the open source or the closed source is completely determined by you. The insert-based design is not mystery, but rather is simpler and easier to understand than a bolus of mud. Various architectures based on plug-in design have own characteristics, but from the overall architecture, the model is the same as the model in different ways, so as to ensure the normal operation of the plug-in, the configuration monitoring and awakening mechanisms and plug-in management are solved from the following three aspects: plug-in base configuration and release configuration management, plug-in container loading process, event monitoring and wake-up mechanism.
The development framework is a semi-finished product of an application with partial functionality that provides a reusable common structure that can be shared between applications. Subsequent developers incorporate the framework into their own applications and extend to meet their specific business needs. Typically the framework is mature, constantly upgraded software, and is a reusable design building block that specifies the architecture of the application, clarifies the overall design, dependencies between collaboration building blocks, responsibility allocation, and control flow, and ultimately presents a set of abstract classes and methods of collaboration between instances thereof. Plug-in management is usually that a developer writes a host program, a predefined system provides a basic service interface and a plug-in interface, and then other developers write plug-in functions according to the system plug-in interface, and usually, plug-ins appear in the form of an independent functional module. The specific functionality of the plug-in is not known to the host program, and typically the host retrieves the plug-in information at start-up and loads the plug-in according to a predetermined plug-in interface.
A specific embodiment is given below to illustrate a specific application of the card management method in the embodiment of the present invention.
In this particular embodiment, as shown in fig. 3, a plug-in base configuration is first performed, and a plug-in is a collection of related functions, which are defined as services, which exist in the manner of java interfaces. Each plug-in has a unique service number, which is the basis for the plug-in framework to discover and inject configuration information and establish plug-in associations.
1. Specifying a container master configuration: by default, the plug-in framework will read the app-config. Xml file under classpath, and the name and location of the plug-in framework master configuration file may also be specified in web. Xml.
<web-app...>
<context-param>
<param-name>context/framework-config</param-name>
<param-value>classpath:/app-config.xml</param-value>
</context-param>
</web-app>
The framework master profile is specified by context-parameter parameters in web. The parameter name is context/frame-config, and the corresponding value is the storage position of the plug-in container main configuration file. May be an absolute path; or a path under the classpath, and the prefix of 'classpath:/' is used.
2. Plug-in release information: plug-in release information including version number, service-id, dependent plug-in id, service implementation class, etc., is of interest to the plug-in container. The plugin may also specify depend-services list, and reference other plugin services implementing IIoC interfaces by way of injection. When the plug-in is started, the container initializes the plug-in which is depended according to the information depended by the plug-in, and returns the instance of the completion of the construction.
When the information is created, a plug-in developer makes a configuration information file in a plug-in jar package, and a plug-in configuration file naming rule < xxx >. App-plug in is stored in a catalog of app-plug in under CLASSPATH, and the configuration is generally not required to be adjusted by an application developer, as shown in table 1.
TABLE 1
service-id Service id, globally unique, of plug-in
service-class Service implementation class, container will call such parameter-free constructors for initialization
version Plug-in version
note Displaying names
depend-services Other plug-in services dependent, optional
3. App-config container configuration: the runtime configuration information of the plug-ins is unified in app-config. Xml of the plug-in container framework, and the configuration file is intended to correctly start the plug-ins contained under the container framework, and the plug-in runtime configuration information of the plug-ins, all plug-ins loaded at the time of container start are declared here. The plug-in container finds and initiates a plug-in with the following two conditions: the plug-in jar package containing the release information can be found in the plug-in container; the service-id and load level information load-level of the plug-in are explicitly declared in app-config.
TABLE 2
4. Plug-in operation configuration: the storage path or content of such a configuration is explicitly indicated in app-config. Xml, and the configuration may be defined in different forms depending on the specific plug-in. Such as cache plug-in catch, needs to define memcached. Logger plug-ins require configuration of log.properties and logformat.properties to determine log output location and output format, etc. These configurations are of great concern to application developers and should be adjusted and defined in actual plug-in applications according to the desired effect.
And further, loading a plugin container, after the plugin container is started, searching all configuration files meeting the general configuration of 'app-plug in/. App-plug in', and considering that each configuration corresponds to a plugin, and generating a corresponding configuration object PluginInfo for the plugin. And the plug-in framework writes the plug-in release information into pluginInfo of the corresponding plug-in according to the content in the app-plug in, and determines the information such as service-id, service-class, version, depend and the like. Reading app-config.xml of the plug-in container fills the plug-in runtime configuration to PluginInfo, such as load-level, plug-in-configuration, etc., according to the declared plug-in name. The plug-in is instantiated according to the parameters of PluginInfo according to the loading level, and the plug-in obtains the plug-in-configuration stated in app-configuration.xml, namely the plug-in running configuration, through the addConfiguraion method of the IIoC interface.
Finally, by using an event monitoring and awakening mechanism, the plug-in framework manages the life cycle of all plug-ins, namely, the plug-ins are informed of operations such as initialization, starting, stopping, destroying and the like at some key points, but the plug-in framework cannot determine whether the plug-ins immediately execute or additionally start threads to do corresponding operations, so that the problem of time sequence dependence on the plug-ins is caused. Something that may be used by a third party outside the plug-in framework, such as Spring. The timing task is independent of service, but we cannot guarantee that the task submitted by the user cannot use something of a third party such as Spring, but because the timing task is started by priority Spring, spring is not ready, but the timing task can immediately execute the user registered Spring task, so that task execution failure is caused. The plug-in framework employs an event listening mechanism to solve this problem.
1. Registering events and callbacks: all events are inherited to FrameworkStatusHandler and require the display of an instance of the incoming callback method (implementation Runnable interface), which is called when the event wakes up to trigger.
FrameworkHandlerRegistry.getInstance().registerFrameworkHandler(
new FrameworkXXXXHandler(new XXXXXCallBack()));
For example:
2. wake-up event: frame work SysEvent. GetInstance (). Notify (frame work XXXXHandler. Class. GetName ()); with this method, the previously registered callback will be called.
Plug-in framework embeds event FrameworkOnReadyHandler for notification event that the whole WEB container is ready, additionally adding listener to the rearmost of WEB xml to ensure that the event is awakened after WEB container startup is completed; the following are provided:
registering an event at any position of the plug-in and carrying out a callback method.
FrameworkHandlerRegistry.getInstance().registerFrameworkHandler(
new FrameworkOnReadyHandler(new MyCallBack()))。
The advantages of the embodiments of the present invention are mainly manifested in the following aspects:
1) Reducing the interdependence among the modules of the system: in the plug-in development, any one system function module, a general user interface, a minimum icon and the like can be developed in a plug-in mode, so that reusability of the general function module is improved; each function is independently developed, mutual independence does not exist, each independent function can be independently operated, and hosting operation can be carried out through a plug-in frame, so that the flexibility of the whole system is improved; the normal operation of other plug-in modules is not influenced when the functional module is modified, the maintenance difficulty of the system is reduced, and the expandability of the system is improved.
2) Independent development, deployment and maintenance of system modules: each functional module can be independently developed as a plug-in according to the service interface defined by the plug-in contract service interface and related metadata, and can independently operate after the development is completed and compiled, and can also operate through the plug-in framework. In theory, the plug-in components should not be individually operable, and in terms of plug-in architecture principles, must be hosted by a plug-in manager to operate. The actual development may vary from business to business, and how the plug-in development should be constrained depends on the actual project requirements.
3) Dynamic assembly and separation system according to the requirement: each functional module can be developed as a plug-in, the deployment information of the plug-in package is maintained through a unified configuration file, the plug-in framework can dynamically download corresponding plug-ins from a server to a client to perform plug-in initialization creation according to the activity condition, the plug-ins are combined to the framework, and the like, and the plug-in framework can flexibly manage each plug-in instance and a communication mechanism among the plug-ins and also support the unloading of the plug-ins.
Based on the same inventive concept, the embodiment of the invention also provides a plug-in management device, as described in the following embodiment. Since the principles of solving the problems are similar to those of the plug-in management method, the implementation of the device can refer to the implementation of the method, and the repetition is omitted.
Fig. 4 is a block diagram of a card managing apparatus according to an embodiment of the present invention, as shown in fig. 4, the apparatus includes:
A file obtaining module 401, configured to obtain a plug-in container main configuration file app-config.xml, where plug-in service-id is explicitly declared in the plug-in container main configuration file app-config.xml, load level information load-level and plug-in running configuration plug-in-configuration;
The file searching module 402 is configured to start a plug-in container and search plug-in configuration files app-plug in a classpath, where the plug-in configuration files app-plug in include plug-in release information;
An object generating module 403, configured to generate a corresponding configuration object pluginInfo according to the add-on configuration file app-plug in;
an information writing module 404, configured to write the plug-in release information into a corresponding configuration object pluginInfo;
a configuration filling module 405, configured to fill the loading level information load-level and the plug-in running configuration plug-in-configuration into the configuration object pluginInfo according to the plug-in service-id explicitly stated in the plug-in container master configuration file app-configuration.
And an instantiation module 406, configured to instantiate the plug-in to the configuration object pluginInfo according to the load-level information load-level.
In one embodiment, the plug-in publishing information includes: plug-in version number, plug-in service-id, depending on plug-in id, one or any combination of service implementation class information.
In one embodiment, the file obtaining module is further configured to obtain a plug-in container master profile app-config. Xml as follows:
reading an app-config.xml of a plug-in container main configuration file under a classpath; or (b)
And reading context-parameter parameters in web xml, determining the name and the storage position of a main configuration file according to the context-parameter parameters, and obtaining the plug-in container main configuration file app-config.
In one embodiment, as shown in fig. 5, the card management apparatus further includes: the monitor wake-up module 407 is configured to wake up the built-in event FrameworkOnReadyHandler by using the monitor mechanism listener after the plug-in container is started up; the built-in event FrameworkOnReadyHandler is registered in the plug-in.
In summary, in the embodiment of the present invention, by obtaining the plug-in container master configuration file app-config.xml, the plug-in container master configuration file app-config.xml explicitly declares the plug-in service-id, loads the level information load-level and plug-in operation configuration plug-in-configuration; starting a plug-in container, and searching plug-in configuration files app-plug in under a classpath, wherein the plug-in configuration files app-plug in contain plug-in release information; generating a corresponding configuration object pluginInfo according to the plug-in configuration file app-plug in; writing the plug-in release information into a corresponding configuration object pluginInfo; filling loading level information load-level and plug-in running configuration plug-in-configuration into a configuration object pluginInfo according to the plug-in service-id explicitly stated in the plug-in container master configuration file app-configuration; and carrying out plug-in instantiation on the configuration object pluginInfo according to the loading level information load-level. According to the embodiment of the invention, the plug-in service-id is explicitly stated in the plug-in container main configuration file app-config.xml, the loading level information load-level and the plug-in operation configuration plug-in-configuration are carried out, and then plug-in instantiation is carried out on the configuration object pluginInfo according to the loading level information load-level, so that the problems that the management process is complicated and the management efficiency is low in the existing plug-in management scheme are effectively solved, unified standard management is carried out on the plug-in, and the control management efficiency of the plug-in is improved.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing description of the embodiments has been provided for the purpose of illustrating the general principles of the invention, and is not meant to limit the scope of the invention, but to limit the invention to the particular embodiments, and any modifications, equivalents, improvements, etc. that fall within the spirit and principles of the invention are intended to be included within the scope of the invention.

Claims (8)

1. A method for managing a card, comprising:
Obtaining a plug-in container main configuration file app-config.xml, wherein plug-in service-id is explicitly declared in the plug-in container main configuration file app-config.xml, and loading level information load-level and plug-in running configuration plug-in-configuration;
starting a plug-in container, and searching plug-in configuration files app-plug in under a classpath, wherein the plug-in configuration files app-plug in contain plug-in release information;
Generating a corresponding configuration object pluginInfo according to the plug-in configuration file app-plug in;
writing the plug-in release information into a corresponding configuration object pluginInfo;
filling loading level information load-level and plug-in running configuration plug-in-configuration into a configuration object pluginInfo according to the plug-in service-id explicitly stated in the plug-in container master configuration file app-configuration;
plug-in instantiation is carried out on the configuration object pluginInfo according to the loading level information load-level;
Further comprises: after the plug-in container is started, a monitoring mechanism listener is utilized to wake up a built-in event FrameworkOnReadyHandler; the built-in event FrameworkOnReadyHandler is registered in the plug-in.
2. The plug-in management method of claim 1, wherein the plug-in publishing information comprises: plug-in version number, plug-in service-id, depending on plug-in id, one or any combination of service implementation class information.
3. The plug-in management method of claim 1, wherein the plug-in container master profile app-config. Xml is obtained as follows:
reading an app-config.xml of a plug-in container main configuration file under a classpath; or (b)
And reading context-parameter parameters in web xml, determining the name and the storage position of a main configuration file according to the context-parameter parameters, and obtaining the plug-in container main configuration file app-config.
4. A card managing apparatus, comprising:
The file obtaining module is used for obtaining a plug-in container main configuration file app-config.xml, wherein plug-in service-id, loading level information load-level and plug-in running configuration plug-in-configuration are explicitly declared in the plug-in container main configuration file app-config.xml;
The file searching module is used for starting the plug-in container and searching plug-in configuration files app-plug in under the classpath, wherein the plug-in configuration files app-plug in contain plug-in release information;
The object generation module is used for generating a corresponding configuration object pluginInfo according to the plug-in configuration file app-plugin;
the information writing module is used for writing the plug-in release information into the corresponding configuration object pluginInfo;
the configuration filling module is used for filling the loading level information load-level and the plug-in running configuration plug-in-configuration into the configuration object pluginInfo according to the plug-in service-id explicitly stated in the plug-in container master configuration file app-configuration.
The instantiation module is used for carrying out plug-in instantiation on the configuration object pluginInfo according to the loading level information load-level;
Further comprises: the monitoring and awakening module is used for awakening the built-in event FrameworkOnReadyHandler by utilizing a monitoring mechanism listener after the plug-in container is started; the built-in event FrameworkOnReadyHandler is registered in the plug-in.
5. The card managing apparatus according to claim 4, wherein the card distribution information includes: plug-in version number, plug-in service-id, depending on plug-in id, one or any combination of service implementation class information.
6. The plug-in management device of claim 4, wherein the file obtaining module is further to obtain a plug-in container master profile app-config. Xml as follows:
reading an app-config.xml of a plug-in container main configuration file under a classpath; or (b)
And reading context-parameter parameters in web xml, determining the name and the storage position of a main configuration file according to the context-parameter parameters, and obtaining the plug-in container main configuration file app-config.
7. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any of claims 1 to 3 when executing the computer program.
8. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed by a processor, implements the method of any of claims 1 to 3.
CN202110215996.8A 2021-02-26 2021-02-26 Plug-in management method and device Active CN112860345B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110215996.8A CN112860345B (en) 2021-02-26 2021-02-26 Plug-in management method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110215996.8A CN112860345B (en) 2021-02-26 2021-02-26 Plug-in management method and device

Publications (2)

Publication Number Publication Date
CN112860345A CN112860345A (en) 2021-05-28
CN112860345B true CN112860345B (en) 2024-06-21

Family

ID=75990115

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110215996.8A Active CN112860345B (en) 2021-02-26 2021-02-26 Plug-in management method and device

Country Status (1)

Country Link
CN (1) CN112860345B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114489853A (en) * 2022-01-21 2022-05-13 阿里巴巴(中国)有限公司 Plug-in registration method, electronic device and computer-readable storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101446903A (en) * 2008-12-19 2009-06-03 北京大学 Automatic component classification method

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100492989C (en) * 2006-09-15 2009-05-27 华为技术有限公司 System and method for business extension using plug-ins
CN106131178A (en) * 2008-12-05 2016-11-16 社会传播公司 Real-time kernel
CN103810008B (en) * 2014-02-19 2018-03-02 迈普通信技术股份有限公司 Plug-in loading method and system
CN107704277A (en) * 2016-08-03 2018-02-16 常州中兴华达科技有限公司 Plug-in loading method and system
CN110162345B (en) * 2019-05-05 2022-02-18 网宿科技股份有限公司 Application program access method and device and storage medium
CN111400129B (en) * 2020-03-06 2022-02-11 广东电网有限责任公司 Distributed application performance monitoring and bottleneck positioning system, method and equipment

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101446903A (en) * 2008-12-19 2009-06-03 北京大学 Automatic component classification method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于框架-插件架构的军事仿真系统设计方法研究;李春荣;刘筱;;现代计算机(专业版);20150805(第22期);71-76、86页 *

Also Published As

Publication number Publication date
CN112860345A (en) 2021-05-28

Similar Documents

Publication Publication Date Title
US12159146B2 (en) Dynamically loaded plugin architecture
US10613837B2 (en) Distributed component model
US7539985B2 (en) Systems and methods for dynamic component versioning
KR101116615B1 (en) Resource management system and method for applications and threads in JAVA Virtual Machine
EP2246783B1 (en) Method and apparatus for automatically generating source code files in a file storage unit
US8713514B2 (en) Heterogeneous language data typing without executable regeneration
CN111309291A (en) Modularized embedded software architecture, customization method and customization system thereof
US8560602B2 (en) Data sharing in a stream processing system
US8490118B2 (en) Wait on address synchronization interface
US20120222003A1 (en) Distributed application definition
CN110569250B (en) Management method and device for analysis library of Internet of things network element
CA2713622A1 (en) Dynamic configuration system
CN110362363A (en) A method of model realization controls terminal applies when based on operation
CN111147291B (en) Service maintenance method and device
CN112860345B (en) Plug-in management method and device
US9594548B2 (en) Dynamically updating templated applications
CN101251796A (en) Distributed element dependent relationship managing method based on dependent injection
CN112987936A (en) Interactive processing method, system, device, equipment and medium
US9253286B2 (en) Computer program composed from tabular storage structures that includes data and code
Bosch et al. Product instantiation in software product lines: A case study
CN106802805B (en) Application service management method and device suitable for server management
CN119938033A (en) Methods for page rendering, execution engines, and page building methods
CN114064094A (en) Thermal updating method, device, computer storage medium and system
CN112256355A (en) Data-driven system function loading method, device and storage medium
CN113923210B (en) Method and system for downloading file according to divided areas

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant