CN103116510B - Class based on OSGI loads shielding system and method - Google Patents

Class based on OSGI loads shielding system and method Download PDF

Info

Publication number
CN103116510B
CN103116510B CN201310026972.3A CN201310026972A CN103116510B CN 103116510 B CN103116510 B CN 103116510B CN 201310026972 A CN201310026972 A CN 201310026972A CN 103116510 B CN103116510 B CN 103116510B
Authority
CN
China
Prior art keywords
virtual component
filtrator
component set
application
class
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
CN201310026972.3A
Other languages
Chinese (zh)
Other versions
CN103116510A (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.)
SHANGHAI DONGFANGTONG SOFTWARE TECHNOLOGY CO., LTD.
Beijing Tongtech Co Ltd
Original Assignee
SHANGHAI DONGFANGTONG SOFTWARE TECHNOLOGY Co Ltd
Beijing Tongtech 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 SHANGHAI DONGFANGTONG SOFTWARE TECHNOLOGY Co Ltd, Beijing Tongtech Co Ltd filed Critical SHANGHAI DONGFANGTONG SOFTWARE TECHNOLOGY Co Ltd
Priority to CN201310026972.3A priority Critical patent/CN103116510B/en
Publication of CN103116510A publication Critical patent/CN103116510A/en
Application granted granted Critical
Publication of CN103116510B publication Critical patent/CN103116510B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides a kind of class based on OSGI and load shielding system and method, described system comprises: converter, for web application is converted to standard wab; Processor, for creating virtual component set for described web application; Filtrator, for arranging isolated relation for described virtual component set.Described method comprises: S1: convert web application to standard wab, and is that described web applies the set of establishment virtual component; S2: for described virtual component set creates filtrator; S3: according to the observability list in described filtrator, for described virtual component set arranges isolated relation.The present invention loads shielding system and method by proposing a kind of class based on OSGI, and be towards the web application under JavaEE platform, according to the fine-grained isolation controlling class isolation and service between application of real needs, and configuration is more flexible.

Description

Class based on OSGI loads shielding system and method
Technical field
The present invention relates to network and field of computer technology, particularly a kind of class based on OSGI loads shielding system and method.
Background technology
Along with the develop rapidly of computer networking technology, for application server, how design class loading structure meet class in application server time and isolate, time and shared problem is day by day lofty.
The Classloader of tradition application server realizing is all chain structure, and the last-of-chain of Classloader chain is all responsible for the privately owned class under load application usually, and the closer to the front end of chain, the class being responsible for loading gets over system-level common class.Therefore the practice of traditional application server is exactly to need the class shared to be placed on the position that Classloader chain front end can be loaded into, such as system lib catalogue, or under general class common catalogue, then the class configuring application loads and adopts parents' way of bailment, that is, the class in web application is preferentially loaded by parent loader.When needs are isolated, the class just will isolated is placed on the privately owned class position that Classloader last-of-chain is responsible for loading, such as, under the WEB-INF/lib catalogue of web application, the class load mechanism then configuring web application is that son is preferential, and the class namely in web application is preferentially loaded by the Classloader applied.Relatively more typical, just can make to control isolation to each other or sharing in this way as the multiple web application in EAR (EnterpriseArchiveFile) application.
But this implementation underaction, and granularity is too thick.The class that such as cannot realize in independent web application A is isolation to independent web application B, but the class in application A is shared independent web application C.And the isolation that jar wraps this rank can only be controlled to, if wrap for certain jar, the class of some package is wanted to be shared, and the class of some package is wanted to be isolated, and so also cannot accomplish.In addition, the control of traditional isolation just determines in deployment, cannot implement to change during operation.
Along with OSGi(OpenServiceGatewayInitiative) technology growing, new version has all done based on OSGi framework in a lot of application server manufacturer.Utilize the netted class loading structure of the two-stage of OSGi framework uniqueness, the class isolation design being different from traditional application server completely can be made.Wherein typical design be exactly for each application distribute an independent OSGi run a time, when the OSGi at each like this application place runs, there is natural isolation, also just ensure that application class isolation to each other.But this design also exists an open defect, that is applied exactly and can not remove isolation.
Summary of the invention
(1) technical matters solved
The technical matters that the present invention solves proposes a kind of class based on OSGI to load shielding system and method, and to solve, the dirigibility of current class loading shielding system is low, the problem of coarseness.
(2) technical scheme
The present invention proposes a kind of class based on OSGI and load shielding system, it is characterized in that, described system comprises:
Converter, for being converted to standard wab by web application;
Processor, for creating virtual component set for described web application;
Filtrator, for arranging isolated relation for described virtual component set.
Preferably, described web is applied as bundle form or war form.
Preferably, described virtual component set operates in when same OSGI runs interior.
Preferably, described virtual component set is made up of application component bundles and filtrator.
Preferably, described filtrator comprises: bundle visibility list, package visibility list or service visibility list.
The invention allows for a kind of class based on OSGI and load partition method, it is characterized in that, described method comprises:
S1: convert web application to standard wab, and be that described web applies the set of establishment virtual component;
S2: for described virtual component set creates filtrator;
S3: according to the observability list in described filtrator, for described virtual component set arranges isolated relation.
Preferably, described web is applied as bundle form or war form.
Preferably, described virtual component set operates in when same OSGI runs interior.
Preferably, also comprise upon step s 2: the observability list that described filtrator is set.
Preferably, also comprise after step S3: described web application is arranged in described virtual component set, and start described web and apply.
(3) beneficial effect
The present invention loads shielding system and method by proposing a kind of class based on OSGI, and be towards the web application under JavaEE platform, according to the fine-grained isolation controlling class isolation and service between application of real needs, and configuration is more flexible.
Accompanying drawing explanation
Fig. 1 is the system construction drawing that the present invention proposes;
Fig. 2 is the virtual component collecting structure figure that the present invention proposes;
Fig. 3 is the filtration device structure figure that the present invention proposes;
Fig. 4 is the method flow diagram that the present invention proposes;
Fig. 5 is the method flow schematic diagram that the present invention proposes.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described.
The present invention proposes a kind of class based on OSGI and load shielding system, as shown in Figure 1, described system comprises:
Converter, for being converted to standard wab by web application;
Processor, for creating virtual component set for described web application;
Filtrator, for arranging isolated relation for described virtual component set.
Described system also comprises web application class loader, and wherein, the class isolation between web application is by the filtrator Collaborative Control between web application class loader and virtual component set.
Described web is applied as bundle form or war form.Wab converter converts the web application of traditional war form or bundle Informal development to standard wab, and creates virtual component set for this web applies.
Described virtual component set operates in when same OSGI runs interior, and described virtual component set not only can control class isolation to each other, and the OSGI that can also control to each other serves isolation.
Be illustrated in figure 2 the virtual component collecting structure figure of the class load server of the JavaEE application server based on OSGI, described virtual component set is made up of application component bundles and filtrator.Application component bundles is the concrete element of composition web application, and application component bundle is exactly a module in web application.Described filtrator is for arranging the isolated relation between virtual component set.
Be illustrated in figure 3 the filtration device structure figure of the class load server of the JavaEE application server based on OSGI, described filtrator comprises: bundle visibility list, package visibility list or service visibility list.Which bundle that bundle visibility list controls in this virtual component set is visible to destination virtual assembly set; Which bag that package visibility list controls in this virtual component set is visible to destination virtual assembly set; Which OSGiservice that service visibility list controls to expose in this virtual component set is visible to destination virtual assembly set.
Because the observability between virtual component set is two-way, therefore need to be respectively it according to the actual requirements and filtrator is set.If do not arrange filtrator between two virtual component set, so these two virtual component set are by completely isolated, i.e. bundle, class, and service is sightless each other.Between the application that this acquiescence effect is just applicable to JavaEE application server, class loads isolation requirement, if want to remove isolation, or past release isolation, so only need add corresponding filtrator.
And for the class of JavaEE application server system level and service, usually all need the virtual component set of application layer visible, to complete application deployment and request processing flow smoothly.On the contrary, class in the set of application layer virtual component to the operation of JavaEE application server without any effect, but the service in the set of application layer virtual component needs the set of JavaEE application server system level virtual component visible, to complete the function of some distribution subscription models.
For realizing above-mentioned general requirment, need the set of add-on system level virtual component to the filtrator of application layer virtual component set and the set of application layer virtual component to the filtrator of system-level virtual component set.In the filtrator of wherein system-level virtual component set end, need system-level core classes place bundle, package belonging to core classes, the OSGiservice of core exposure adds in the bundle visibility list of isolated relation filtrator, package visibility list and service visibility list respectively; In the isolated relation filtrator of application layer virtual component set, the OSGiservice by application exposes only is needed to add in the service visibility list of isolated relation filtrator.
The invention allows for a kind of class based on OSGI and load partition method, as shown in Figure 4, described method comprises:
S1: convert web application to standard wab, and be that described web applies the set of establishment virtual component;
S2: for described virtual component set creates filtrator;
S3: according to the observability list in described filtrator, for described virtual component set arranges isolated relation.
Described web is applied as bundle form or war form.
Described virtual component set operates in when same OSGI runs interior.
Also comprise upon step s 2: the observability list that described filtrator is set.
Also comprise after step S3: described web application is arranged in described virtual component set, and start described web and apply.
As shown in Figure 5, the class that the present invention is based on the JavaEE application server of OSGi loads partition method and is: first use converter that traditional war is converted to standard wab, virtual component geometric processor is that traditional war creates an empty virtual component set, then be that this virtual component set creates filtrator, according to the actual requirements, if needing to arrange has different isolations to other different virtual assembly sets, so just need the filtrator creating multiple correspondence, again due to the amphicheirality of isolation, also need to be that other virtual component set create corresponding filtrator from direction on the contrary, the observability list of each filtrator is set afterwards, preliminary work is substantially ready herein, related virtual component set isolated relation filtrator couples together by the api that then starting to call virtual component collection manager provides, again web application component is installed in this virtual component set, such web application component to the observability of other virtual component set just and its place virtual component set to the same visi-bility of other virtual component set.Finally start web application component, so far isolation arranges and all completes.
Above embodiment is only for illustration of the present invention; and be not limitation of the present invention; the those of ordinary skill of relevant technical field; without departing from the spirit and scope of the present invention; can also make a variety of changes and modification; therefore all equivalent technical schemes also belong to category of the present invention, and scope of patent protection of the present invention should be defined by the claims.

Claims (7)

1. the class based on OSGI loads a shielding system, and it is characterized in that, described system comprises:
Converter, for being converted to standard wab by web application;
Processor, for creating virtual component set for described web application;
Filtrator, for arranging isolated relation for described virtual component set;
The observability list of described filtrator comprises: bundle visibility list, package visibility list or service visibility list;
Described filtrator comprises: system-level virtual component set to the filtrator of application layer virtual component set and the set of application layer virtual component to the filtrator of system-level virtual component set;
Described virtual component set is made up of application component bundles and filtrator;
Described system also comprises web application class loader, the class isolation between described web application class loader and described filtrator Collaborative Control web apply.
2. system according to claim 1, is characterized in that, described web is applied as bundle form or war form.
3. system according to claim 1, is characterized in that, described virtual component set operates in when same OSGI runs interior.
4. the class based on OSGI loads a partition method, and it is characterized in that, described method comprises:
S1: convert web application to standard wab, and be that described web applies the set of establishment virtual component;
S2: for described virtual component set creates filtrator;
The observability list of described filtrator is set; Described observability list comprises: bundle visibility list, package visibility list or service visibility list;
Described virtual component set is made up of application component bundles and filtrator;
Described filtrator comprises: system-level virtual component set to the filtrator of application layer virtual component set and the set of application layer virtual component to the filtrator of system-level virtual component set;
S3: according to the observability list in described filtrator, for described virtual component set arranges isolated relation;
Described method also comprises the class isolation utilized between web application class loader and described filtrator Collaborative Control web application.
5. method according to claim 4, is characterized in that, described web is applied as bundle form or war form.
6. method according to claim 4, is characterized in that, described virtual component set operates in when same OSGI runs interior.
7. method according to claim 4, is characterized in that, also comprises after step S3: described web application be arranged in described virtual component set, and starts described web and apply.
CN201310026972.3A 2013-01-21 2013-01-21 Class based on OSGI loads shielding system and method Active CN103116510B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310026972.3A CN103116510B (en) 2013-01-21 2013-01-21 Class based on OSGI loads shielding system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310026972.3A CN103116510B (en) 2013-01-21 2013-01-21 Class based on OSGI loads shielding system and method

Publications (2)

Publication Number Publication Date
CN103116510A CN103116510A (en) 2013-05-22
CN103116510B true CN103116510B (en) 2016-04-27

Family

ID=48414895

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310026972.3A Active CN103116510B (en) 2013-01-21 2013-01-21 Class based on OSGI loads shielding system and method

Country Status (1)

Country Link
CN (1) CN103116510B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105404524B (en) * 2014-09-15 2019-01-15 阿里巴巴集团控股有限公司 Class load partition method and device in Java application
CN112084397B (en) * 2020-07-14 2023-12-05 山东中创软件商用中间件股份有限公司 Filter registration method, device, equipment and readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101105757A (en) * 2007-08-31 2008-01-16 金蝶软件(中国)有限公司 Class loading separation method and class loading separation device
CN102073506A (en) * 2011-02-24 2011-05-25 北京中电普华信息技术有限公司 Java 2 enterprise edition (J2EE) based method and system for processing Web application request

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060161898A1 (en) * 2005-01-18 2006-07-20 Brian Bauman Method and system for project library dependency management
GB2459682B (en) * 2008-04-30 2012-04-25 Vmware Inc A computer system and a method of deploying an application in a computer system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101105757A (en) * 2007-08-31 2008-01-16 金蝶软件(中国)有限公司 Class loading separation method and class loading separation device
CN102073506A (en) * 2011-02-24 2011-05-25 北京中电普华信息技术有限公司 Java 2 enterprise edition (J2EE) based method and system for processing Web application request

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
OSGi-based Open Mobile Asset Management System;Xiaolin Ma 等;《Proceedings 2010 IEEE 2nd Symposium on Web Society》;20100816;第568-572页 *
一种基于OSGi组件的SCA服务模型实现方案;张浩 等;《微计算机信息》;20100930;第26卷(第9期);第118-120页 *
为WebSphere Application Server开发企业OSGi应用程序;Ian Robinson;《http://www.ibm.com/developerworks/cn/websphere/techjournal/1007_robinson/1007_robinson.html》;20100925;第1-13页 *
面向OSGi的应用服务器重构;周明辉 等;《计算机科学与探索》;20100228;第108-114页 *

Also Published As

Publication number Publication date
CN103116510A (en) 2013-05-22

Similar Documents

Publication Publication Date Title
CN103440376B (en) Distributed operation mode and centralized operation mode integrated simulation system operation supporting platform based on components
CN102736900B (en) A kind of system and design method of the application system platform framework based on SOA
CN106484509A (en) A kind of output intent of pop-up, device and terminal
CN101833465B (en) Embedded system supporting dynamic loading operation of application programs
CN104298512B (en) A kind of functional unit formula integrated development system based on OSGi standards
CN103677843B (en) Native capacity development method and device across mobile terminals
CN109451065A (en) A kind of soft load balancing shunts automated system and its operation method
CN103634165B (en) Method, terminal device and system for realizing network testing based on reverse proxy
CN109271170A (en) A kind of distributed system dispositions method, system, electronic equipment and storage medium
CN106302074A (en) A kind of moving method virtualizing network function VNF and device
CN101593134A (en) Virtual machine cpu resource distribution method and device
CN105897484A (en) Traffic management device, server and method
CN101876906A (en) Method and device for running Linux application in Android system
CN103793275B (en) Realize the system and processing method of load balancing
CN103116510B (en) Class based on OSGI loads shielding system and method
CN102681825A (en) System and method for managing service run container
CN106648559A (en) Android application pluggable development system and method
CN103873534A (en) Method and device for application cluster migration
CN105959302A (en) Terminal management framework and method
CN100571156C (en) A kind of in Upper NM Station the method for integrating lower network management function
CN102316163B (en) Method for realizing Web container expansion and Web container
CN105406983A (en) Cloud calculation network management control method based on user demands
CN102999371B (en) Interface Development method and system based on Lua script
CN102831494A (en) Scheduling method, scheduling device and scheduling system
CN107291411A (en) The method of information sharing, device and storage medium in wireless screen transmission

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
ASS Succession or assignment of patent right

Owner name: SHANGHAI DONGFANG TONGTAI SOFTWARE TECHNOLOGY CO.,

Effective date: 20131029

C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20131029

Address after: Beijing City 100080 square Haidian District Road No. 10 Building 3 layer 1+1

Applicant after: Beijing Tongtech Co.,Ltd.

Applicant after: SHANGHAI DONGFANGTONG SOFTWARE TECHNOLOGY CO., LTD.

Address before: Beijing City 100080 square Haidian District Road No. 10 Building 3 layer 1+1

Applicant before: Beijing Tongtech Co.,Ltd.

C14 Grant of patent or utility model
GR01 Patent grant