WO2009076877A1 - 部署、管理sip servlet应用的方法及osgi服务平台 - Google Patents

部署、管理sip servlet应用的方法及osgi服务平台 Download PDF

Info

Publication number
WO2009076877A1
WO2009076877A1 PCT/CN2008/073386 CN2008073386W WO2009076877A1 WO 2009076877 A1 WO2009076877 A1 WO 2009076877A1 CN 2008073386 W CN2008073386 W CN 2008073386W WO 2009076877 A1 WO2009076877 A1 WO 2009076877A1
Authority
WO
WIPO (PCT)
Prior art keywords
sip
servlet application
container
sip servlet
osgi
Prior art date
Application number
PCT/CN2008/073386
Other languages
English (en)
French (fr)
Inventor
Haijun Deng
Kishore E Nanda
Original Assignee
Huawei Technologies Co., Ltd.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co., Ltd. filed Critical Huawei Technologies Co., Ltd.
Priority to EP08861489.6A priority Critical patent/EP2216962B1/en
Publication of WO2009076877A1 publication Critical patent/WO2009076877A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/10Architectures or entities
    • H04L65/102Gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/1066Session management
    • H04L65/1101Session protocols
    • H04L65/1104Session initiation protocol [SIP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content

Definitions

  • the present invention relates to a SIP container and a SIP Servlet application technology, and more particularly to a technology in which a SIP container and an OSGI service platform are integrated to implement a common management of a SIP Servlet application.
  • the OSGI service platform (OSGI is the Open Services Gateway initiative) is a plug-in architecture that is open and provides a unified interface standard. Based on this architecture, service providers, program developers, and software providers. Vendors, service network management operators, and equipment providers can coordinately develop, deploy, and manage the various services offered to users.
  • the OSGI service platform is a Java-based platform. At the beginning of OSGI's introduction and creation, its purpose was mainly to enable flexible and convenient remote management of interconnected network embedded devices.
  • OSGI provides support for dynamic expansion, modification of system functions, and changes to system behavior.
  • Many OSGI components, OSGI Bundle can be deployed on the OSGI service platform.
  • OSGI has a complete set of mechanisms to dynamically change system behavior.
  • OSGI-based systems can be plugged and unplugged by installing new Bundles, updating or stopping existing Bundles.
  • the pluggable, dynamically changeable behavior fundamentally guarantees the flexibility and scalability of the system at runtime.
  • the Bundle is a jar file. The difference between the jar file and the ordinary jar file is that the jar file is different from the normal jar file.
  • the OSGI service platform controls the life cycle of the Bundle by calling each Bundle's Bundle activation program.
  • the Bundle activation program is a program called BundleActivator.
  • BundleActivator the work that Bundle needs to start and stop is written.
  • the event state information of the framework can be published or monitored in the BundleActivator to judge the running state of the frame according to the event state information, and make corresponding adjustments.
  • each Bundle can register the externally provided services through the BundleContext registered on the OSGI service platform, and can also obtain the services to be referenced through the Bundle context.
  • the basic structure of the OSGI service platform framework is described above.
  • the OSGI service platform enables systems built on the platform to have the ability to dynamically change system behavior. Users can deploy multiple hot-swappable OSGI Bundles on the OSGI service platform, and users can install, update, or stop these OSGI Bundles at runtime.
  • SIP Session Initiation Protocol
  • IETF Internet Engineering Task Force
  • IP Internet Protocol
  • SIP Session Initiation Protocol
  • a meeting can be any type of communication between end devices, such as video meetings, instant messaging, or collaborative meetings.
  • the protocol does not define or limit the services that can be used. Transmission, quality of service, billing, security, etc. are handled by the underlying core network and other protocols.
  • the SIP Servlet application is a SIP-based server applet that can theoretically be used to implement any Java language. In practice, it is generally used to implement background logic operations for web applications.
  • the SIP Servlets specification provides a set of Java APIs and a development model based on SIP Container or Application Server to improve the development efficiency of server-side SIP applications.
  • SIP Servlets are also based on the Java Servlet architecture. With the SIP container provided by the SIP Servlets specification, developers can easily develop complex SIP Servlet applications. Multiple SIP Servlet applications form a set of SIP Servlets.
  • a set of SIP Servlets is packaged with resources and deployment descriptors and deployed and run on a SIP Container.
  • SIP containers provide services such as session state management, transaction management, retransmission, network connectivity, message scheduling, thread management, resource management, and application management.
  • the application only needs to include advanced message processing and business logic, and developers no longer need to put too much effort into the protocol itself, which makes the development of SIP services a breeze.
  • Each SIP Servlet application is a component of the SIP container and accepts management and scheduling of the SIP container. For example, when the SIP container receives a SIP request, the SIP container makes a series of judgments to determine which SIP Servlet application to invoke to implement the request.
  • the SIP Servlet application developed and applied in the SIP container of the prior art cannot have the characteristics of hot pluggable and dynamic change behavior, and the SIP Servlet application cannot pass the standard form and is not the OSGI Bundle of the OSGI service platform. OSGI Bundle communication. Summary of the invention
  • the embodiment of the invention provides a method for deploying a SIP Servlet application, managing a SIP Servlet application, and an OSGI service platform, so that the SIP Servlet application is managed and scheduled by the SIP container, and also has the hot pluggability of the OSGI Bundle.
  • a method for deploying a server applet Servlet application of a session initiation protocol comprising: deploying a SIP Servlet application to an open service gateway initiator OSGI service platform in the form of an Open Service Gateway Initiator Service Platform component OSGI Bundle, and The SIP Servlet application is deployed into a SIP container.
  • An OSGI service platform for managing SIP Servlet applications including: a SIP container and a SIP Servlet application, wherein:
  • the SIP Servlet application is deployed in the OSGI service platform in the form of an OSGI Bundle and deployed in a SIP container.
  • the SIP Servlet application communicates with other OSGI Bundles in the OSGI service platform through a mechanism of the OSGI service platform.
  • a method of managing a SIP Servlet application including:
  • the OSGI service platform deploys the SIP Servlet application, and invokes a Bundle activation program of the SIP Servlet application;
  • the servlet application is deployed to the SIP container.
  • a method for managing a SIP Servlet application based on an OSGI service platform including:
  • the SIP Servlet application is deployed to the OSGI service platform in the form of an OSGI Bundle, and the SIP Servlet application is deployed into the SIP container.
  • the SIP Servlet application is deployed in the OSGI service platform in the form of an OSGI Bundle, so that the SIP Servlet application has better dynamic performance, can be hot swapped, and can communicate with other OSGIs through the BGI communication method defined by the OSGI specification.
  • the Bundle communicates.
  • the SIP Servlet application is registered in the SIP container, and the method of loading the SIP Servlet application class by the SIP container is established, thereby implementing the management and scheduling of the SIP Servlet application by the SIP container, and implementing the OSGI service platform and
  • the SIP container is integrated to manage the SIP Servlet application, so that the SIP Servlet application is managed and scheduled by the SIP container, and also has the hot pluggability of the OSGI Bundle.
  • FIG. 1 is a flowchart of a method for implementing an application of an OSGI service platform and a SIP container to manage a SIP Servlet application according to an embodiment of the present invention
  • 2 is a flowchart of deploying a SIP Servlet application to an OSGI monthly service platform in the form of an OSGI Bundle according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a SIP Servlet application organized according to the SIP Servlet specification according to Embodiment 1 of the present invention, and a schematic diagram of adding a SIP file;
  • FIG. 4 is a schematic diagram of organizing a directory structure and adding a Bundle configuration file according to the requirements of the OSGI service platform according to the first embodiment of the present invention
  • 5a is a flowchart of a method for implementing a start method in a BundleActivator of a SIP Servlet application according to Embodiment 1 of the present invention
  • FIG. 5b is a schematic diagram of a SIP Servlet application and a SIP container deployed on an OSGI service platform according to Embodiment 1 of the present invention
  • 5c is a schematic diagram of a SIP Servlet application deployed on an OSGI service platform according to Embodiment 1 of the present invention
  • FIG. 5 is a flow chart of steps for initializing an OSGISipApplication object according to the first embodiment of the present invention
  • FIG. 6a is a flow chart showing the steps of registering a SIP Servlet application into a SIP container according to Embodiment 1 of the present invention
  • 6b is a flow chart showing the steps of a method for implementing a SIP container loading a Bundle instance of a SIP Servlet application according to Embodiment 1 of the present invention
  • FIG. 7A is a schematic diagram of an OSGI service platform for managing a SIP Servlet application by combining an OSGI service platform and a SIP container according to Embodiment 1 of the present invention
  • FIG. 7b is a schematic diagram of another OSGI service platform in which an OSGI service platform and a SIP container jointly manage a SIP Servlet application according to Embodiment 1 of the present invention.
  • FIG. 8 is a flowchart of a method for implementing a start method in a BundleActivator of a SIP Servlet application according to Embodiment 2 of the present invention. detailed description
  • the SIP container and the SIP Servlet application are deployed in the OSGI service platform in the form of an OSGI Bundle.
  • the SIP container and the SIP Servlet application have the OSGI.
  • the characteristics of Bundle, OSGI service platform can manage its life cycle, such as activation, registration, deactivation and so on.
  • the SIP Servlet application is registered in the SIP container, and the SIP Servlet can manage and schedule the SIP Servlet application. This achieves the purpose of the OSGI service platform and the SIP container to jointly manage the SIP Servlet application.
  • the OSGI service platform manages its lifecycle and manages its communication with other Bundles.
  • the SIP Servlet application can be hot swapped, and the OSGI service platform controls its life by calling the Bundle's Bundle activation program, the Bundle Activator interface.
  • the OSGI service platform After the Servlet application is activated, the OSGI service platform does not manage how the SIP Servlet application schedules, calls, and so on.
  • SIP Servlet applications For SIP Servlet applications that have been registered in the SIP container, operations such as scheduling, calling, etc. are managed by the SIP container. After the SIP container receives an external SIP request, the SIP container determines whether to invoke the SIP Servlet application to complete the task based on the information registered by the SIP Servlet application.
  • the first embodiment describes a step of deploying a SIP container and a SIP Servlet application into an OSGI service platform in the form of an OSGI Bundle and registering the SIP Servlet application into a SIP container;
  • the second embodiment completes the steps of deploying the SIP container and the SIP Servlet application into the OSGI service platform in the form of an OSGI Bundle, and completing the step of registering the SIP Servlet application into the SIP container by referring to the Bundle of the deployment service.
  • the embodiment of the present invention implements a method for deploying a SIP container and a SIP Servlet application to an OSGI service platform in the form of an OSGI Bundle, including the following steps:
  • Step S101 Deploy the SIP container to the OSGI service platform in the form of an OSGI Bundle.
  • a Bundle Bundle activation program for writing a SIP container as an OSGI service platform (BundleActivator), add the MANIFEST.MF configuration file of the SIP container, which is the Bundle configuration file of the SIP container; package the SIP container into a Jar file, activate all OSGI Bundles, and the OSGI service platform will be activated by the Bundle of the SIP container.
  • the program (BundleActivator) starts the SIP container.
  • the operation of starting, updating, and stopping the SIP container is included in the Bundle activation program of the SIP container.
  • the Bundle name, description, developer, path, etc. of the SIP container are included in the Bundle configuration file of the SIP container.
  • the technicians in the field may not deploy the SIP container to the OSGI service platform in the form of an OSGI Bundle, and the OSGI service platform and the SIP container jointly manage the SIP Servlet application.
  • the specific implementation method will be introduced later.
  • Step S102 deploy the SIP Servlet application to the OSGI service platform in the form of an OSGI Bundle, and deploy the SIP Servlet application to the SIP container.
  • step S102 The specific steps in the above step S102 are as shown in FIG. 2:
  • Step S201 After writing a SIP Servlet application, the SIP configuration file is written according to the SIP Servlet specification, and the directory structure is organized according to the specification.
  • the configuration of the SIP Servlet application is described in this configuration file.
  • the SIP configuration file will be used by the SIP container to identify the functions that the SIP Servlet application can implement.
  • Step S202 Add the META-INFO directory and the MANIFEST.MF configuration file to the SIP Servlet application root directory according to the requirements of the OSGI service platform.
  • the premise of a Bundle as an OSGI service platform is to have a directory organization structure and a Bundle configuration file that meets the requirements of the OSGI service platform, so that the OSGI service platform can manage the Bundle.
  • the SIP Servlet application in the embodiment of the present invention is added in its root directory.
  • the META-INFO directory and add the MANIFEST.MF file in the META-INFO directory, which is the SIP Servlet application as a Bundle configuration file for the OSGI service platform.
  • the name, description, developer, path, package to be imported, and output package of the SIP Servlet application Bundle are described in the information of the configuration file.
  • Step S203 Write a BundleActivator implementation code of the SIP Servlet application, so that the SIP Servlet application can be deployed as an OSGI Bundle to the OSGI service platform.
  • BundleActivator of the SIP Servlet application.
  • the activation, registration, and deactivation of the SIP Servlet application are mainly implemented.
  • the SIP Servlet application is registered in the SIP container, and the SIP container loads the application class, as shown in Figure 5a.
  • the way to implement the above BundleActivator can be to write the implementation code directly in the BundleActivator.
  • the SIP Servlet application has been successfully deployed as an OSGI Bundle to the OSGI service platform, but to implement the SIP Servlet application to be managed by the SIP container, the SIP Servlet application must be registered in the SIP container and implemented.
  • the method in which the SIP container loads the class of the application As shown in FIG. 5a, the foregoing step S203 specifically includes:
  • SIP Servlet application instance object for Servlet application SIP Servlet application instance object for Servlet application.
  • the startup method in the BundleActivator of the Bundle activation program of the SIP Servlet application is generally the start method.
  • Step S502 Initialize a SIP Servlet application instance object of the SIP Servlet application.
  • the SIP container can complete the call to the SIP Servlet application through the OSGISipApplication object.
  • the OSGISipApplication object is used to describe a SIP Servlet application.
  • a SIP Servlet application When a SIP Servlet application is deployed to the SIP container, a new one should be created. Object to represent it.
  • the SIP Servlet application In the process of initializing the OSGISipApplication object, the SIP Servlet application needs to be deployed into the SIP container, and the method of loading the class of the SIP Servlet application by the SIP container is implemented.
  • the deployApplication method of the deployment service of the SIP container is invoked to implement the deployment of the SIP Servlet application into the SIP container.
  • the deployApplication method of calling the deployment service of the SIP container If the SIP container has been deployed as an OSGI Bundle to the OSGI service platform, then the deployApplication of the deployment service of the SIP container is called. The method may be to obtain an instance of the deployment service of the SIP container by using a Bundle context of the OSGI service platform to invoke the deployApplication method of the deployment service of the SIP container, as shown in FIG.
  • the deployment service's deployApplication method is invoked by the singleton mode or the naming service to directly obtain the class of the SIP container's deployment service, as shown in Figure 5c.
  • the SIP Servlet application is deployed in the SIP container, as shown in FIG. 5d, which specifically includes the following steps:
  • Step S511 Register the SIP Servlet application into the SIP container.
  • the content in the SIP configuration file of the SIP Servlet application is registered in the SIP container, and the SIP container can decide whether to invoke the SIP Servlet application according to the registered content.
  • Step S512 The SIP container loads the Bundle instance of the SIP Servlet application.
  • the SIP container can control the classes and resources of the SIP Servlet application.
  • the specific steps of registering the SIP Servlet application in the SIP container in the above step S511 are as shown in FIG. 6a, and specifically include the following steps:
  • Step S601 Parse the SIP configuration file of the SIP Servlet application.
  • the file sip.xml is the SIP configuration file for the SIP Servlet application, which describes the Servlet class information and pattern mode information of the SIP Servlet application.
  • the pattern mode information describes the expression in text form, which is the main function implemented by the SIP Servlet application. Parsing SIP Servlet
  • the applied SIP expression file gets the text expression.
  • Step S602 Create a rule expression object, parse the rule expression according to the text expression in the SIP configuration file, and inject the SIP Servlet application instance object into the rule expression object.
  • Step S603 Register the rule expression into the manager of the SIP container.
  • Step S611 Create a load object.
  • OSGIAppClassLoader object which can be used to load the resources of the SIP Servlet application.
  • Step S612 Obtain a Bundle instance of the SIP Servlet application, and pass the instance to the constructor parameter of the loaded object.
  • the Bundle instance of the SIP Servlet application which is the Bundle of the previously created OSGISipApplication object.
  • the Bundle instance is passed to the constructor parameter of the OSGIAppClassLoader object.
  • the SIP container loads the SIP Servlet application using OSGIAppClassLoader, the Bundle instance of the SIP Servlet application is obtained, so that the SIP container can manage and use the resources of the SIP Servlet application Bundle.
  • the SIP Servlet application is deployed into the SIP container.
  • the SIP container queries the rule expression registered in the manager according to the message content in the SIP request, and obtains a matching rule expression object, and takes out the matching rule expression object.
  • the SIP Servlet application instance object in the SIP Servlet
  • the application object uses the load object of the SIP Servlet application to load the resources and classes of the SIP Servlet application corresponding to the rule expression object, and creates an instance for the SIP Servlet application class to process the SIP request.
  • the embodiment of the present invention further provides an OSGI service platform, in which an SIP container and a SIP Servlet application are deployed in the form of an OSGI Bundle, wherein the SIP Servlet application is deployed in a SIP container, thereby implementing an OSGI-based service platform.
  • the OSGI service platform and the SIP container jointly manage the purpose of the SIP Servlet application.
  • the SIP Servlet application After the SIP container and the SIP Servlet application are deployed as Bundles to the OSGI service platform, the SIP Servlet application registers itself into the SIP container, and the SIP container loads the class of the SIP Servlet application by using the OSGIAppClassLoader, thereby implementing the OSGI service platform. Cooperate with the SIP container to manage the SIP Servlet application.
  • the SIP Servlet application can also be used as a hot pluggability feature of the OSGI Bundle. It can also be scheduled and managed by the SIP container, which combines the advantages of both.
  • the OSGI service platform and the SIP container can be integrated to manage the SIP Servlet application.
  • the OSGI service platform is integrated with the SIP container to manage the OSGI service platform of the SIP Servlet application.
  • Figure 7a shows the schematic diagram.
  • the SIP container is deployed as a standard OSGI Bundle to the OSGI service platform.
  • the SIP Servlet application is also deployed as a standard OSGI Bundle to the OSGI service platform. Therefore, the SIP Servlet application and the SIP container can be used as standard OSGI Bundles and other Bundles can communicate through the mechanism of the OSGI service platform.
  • the SIP container also delegates the relevant management functions for each SIP Servlet application to the OSGI service platform. Specifically, when the SIP Servlet application bundle is deployed by the OSGI service platform, the activation program of the Bundle Activator of the SIP Servlet application is automatically invoked.
  • the Bundle Activator of the SIP Servlet application implements the function of automatically deploying the SIP Servlet application to the SIP container. In this way, the SIP container does not need to be applied from the SIP Servlet when loading the resources of the SIP Servlet application. The resource is loaded in the path, but the resources of the SIP Servlet application are loaded through the SIP Servlet application.
  • the Bundle Activator deactivation program of the SIP Servlet application is invoked, and the SIP Servlet application is automatically uninstalled from the SIP container.
  • the SIP Servlet Container needs to delegate the management functions (ClassLoader, App's dynamic deployment and uninstallation mechanism) of each SIP Servlet Ap to the OSGI framework through the adaptation mechanism to avoid conflicts between the Container and the OSGI framework on the same management function.
  • Management functions ClassLoader, App's dynamic deployment and uninstallation mechanism
  • the OSGI service platform that does not deploy the SIP container to the OSGI service platform, and the OSGI service platform and the SIP container jointly manage the SIP Servlet application, as shown in FIG. 7b.
  • the activation program of the Bundle Activator of the SIP Servlet application is automatically invoked.
  • the Bundle Activator activation program the deployApplication method of calling the deployment service of the SIP container through the singleton mode or naming service is implemented, thereby realizing the function of automatically deploying the SIP Servlet application to the SIP container.
  • the SIP container does not need to load resources from the path of the SIP Servlet application when loading the resources of the SIP Servlet application, but loads the resources of the SIP Servlet application through the SIP Servlet application.
  • the embodiment of the present invention deploys the SIP Servlet application to the OSGI service platform in the form of an OSGI Bundle, so that the SIP Servlet application has better dynamic performance, can be hot swapped, and can communicate with other OSGI Bundles in a standard manner.
  • the embodiment of the present invention implements a SIP container by deploying a SIP Servlet application into a SIP container after the OSGI Bundle is deployed to the OSGM service platform, and establishing a SIP container to load a class of the SIP Servlet application.
  • the management of the SIP Servlet application realizes the integration of the OSGI service platform and the SIP container to manage the SIP Servlet application.
  • an OSGI Bundle for deploying a service may be deployed on the OSGI service platform, and the deployment service bundle is used to complete the task of deploying the SIP Servlet application into the SIP container.
  • the main steps of the method for implementing the method for managing the SIP Servlet application by the OSGI service platform and the SIP container in the embodiment of the present invention are the same as those in the first embodiment, as shown in FIG. 1 .
  • the embodiment of the present invention implements the same process of deploying the SIP Servlet application to the OSGI service platform in the form of an OSGI Bundle, and deploying the SIP Servlet application into the SIP container, as shown in FIG. 2 .
  • Step S801 Obtain a Bundle instance of the SIP Servlet application.
  • the Bundle instance will be passed to the deployment service as a constructor parameter and retrieved.
  • Step S802 Obtain a Bundle instance of the deployment service Bundle.
  • the prerequisite for obtaining a Bundle instance of the deployment service Bundle is that the deployment service is deployed to the OSGI service platform in the form of an OSGI Bundle.
  • OSGI Service platform in the form of an OSGI Bundle.
  • Those skilled in the art are familiar with the technical means of packaging the code implemented in the deployment service into a jar file and then deploying it to the OSGI service platform. The functionality of the code completion implemented in the deployment service is described later.
  • Step S803 Invoke the deployment method of the deployment service to deploy the SIP Servlet application to the SIP container.
  • the deployment method of the deployment service is invoked according to the Bundle instance of the deployment service Bundle to complete the task of deploying the SIP Servlet application to the SIP container.
  • the deployment task specifically completed in the foregoing deployment method is completely the same as the step S203 of the first embodiment, as shown in FIG. 5a and FIG. 5b.
  • the SIP container and the SIP Servlet application are deployed to the OSGI, and the SIP Servlet application is deployed to the SIP container by referring to the deployment service, thereby implementing the OSGI service platform, and the SIP container and the OSGI service platform jointly manage the SIP Servlet.
  • the purpose of the application Using the deployment service to complete the task of deploying the SIP Servlet application to the SIP container is like writing a subroutine. Each time you perform the same step, you don't need to rewrite the code that executes the step, and directly call the subroutine. The program is fine.
  • the Bundle of the deployment service is actually providing a service for the SIP Servlet application to be deployed to the SIP container, so that each time a new SIP Servlet application is deployed, the Bundle that directly references the deployment service implements the task of deploying the SIP Servlet application into the SIP container.
  • the embodiment of the present invention deploys the SIP Servlet application to the OSGI service platform in the form of an OSGI Bundle, so that the SIP Servlet application has better dynamic performance, can be hot swapped, and can communicate with other OSGI Bundles in a standard manner.
  • the SIP Servlet application is registered in the SIP container, and the SIP container loads the class of the SIP Servlet application, thereby implementing the SIP container pair.
  • the management of the SIP Servlet application realizes that the OSGI service platform and the SIP container are integrated to manage the SIP Servlet application.
  • the embodiment of the present invention improves the code efficiency by using the reference deployment service to deploy the SIP Servlet application into the SIP container, so that the task of deploying each SIP Servlet application into the SIP container is faster and more convenient.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Telephonic Communication Services (AREA)
  • Stored Programmes (AREA)

Description

部署、 管理 SIP Servlet应用的方法及 0SGI服务平台 技术领域
本发明涉及 SIP容器以及 SIP Servlet应用的技术, 尤其涉及 SIP容器与 OSGI服务平台相融合实现对 SIP Servlet应用的共同管理的技术。 背景技术
OSGI服务平台 (OSGI service platform, 其中 OSGI 为 Open Services Gateway initiative即开放服务网关发起者 )是一个开放并且提供统一接口标准 的插件体系框架, 基于这个体系框架, 服务提供商、 程序开发人员、 软件提 供商、 服务网管运营商和设备提供商能够协调地联合起来开发、 部署以及管 理向用户提供的各种服务。 OSGI服务平台是一个基于 Java的平台, OSGI的 提出和诞生之初, 其目的主要是能够灵活方便并远程管理互联的网络嵌入设 备。
大部分的路由器都支持模块的热插拔, 这就意味着可以在路由器运行的 状况下, 动态的增加或卸载具有某种功能的功能模块, 硬件界的这种热插拔 技术一直就是软件界所追求的,而 OSGI则使得热插拔技术在软件界成为现实。
OSGI为动态扩充、 修改系统功能和改变系统行为提供了支撑, 在 OSGI 服务平台上可以部署许多 OSGI的组件, 即 OSGI Bundle。 OSGI有一整套完整 的机制去实现动态改变系统行为, 基于 OSGI的系统运行时就可通过安装新的 Bundle, 更新或停止现有的 Bundle来实现系统功能的插拔。 可插拔、 可动态改 变行为从根本上保证了系统在运行期足够的灵活性和扩展性。
OSGI服务平台框架中所有的模块都需要运行在容器范围内,在 OSGI中所 有模块的部署都必须以 Bundle的方式进行, Bundle是一个 jar文件,该 jar文件和 普通的 jar文件的不同之处在于 Meta-inf目录下的 MANIFEST.MF文件的内容, 关于 Bundle的所有信息都在 MANIFEST.MF中进行描述, 可以称它为 bundle的 元数据,这些信息中包含有例如 Bundle的名称、描述、开发商、路径( classpath )、 需要导入的包(Package ) 以及输出的包(Package )等。
OSGI服务平台通过调用每个 Bundle的 Bundle激活程序去控制该 Bundle的 生命周期。 一般地, 该 Bundle激活程序为名为 BundleActivator的程序。 在 BundleActivator中编写了 Bundle启动、 停止时所需要进行的工作, 同时也可以 在 BundleActivator中发布或者监听框架的事件状态信息,以根据这些事件状态 信息判断框架的运行状态, 从而做出相应的调整。
在 OSGI框架中每个 Bundle可以通过注册在 OSGI服务平台上的 Bundle上 下文(BundleContext ) , 注册对外提供的服务, 同时也可以通过 Bundle上下 文来获得需要引用的服务。
以上介绍了 OSGI服务平台框架的基本构成。 OSGI服务平台能够使基于该 平台构建的系统具备动态改变系统行为的能力。 用户可以在 OSGI服务平台上 部署多个可热插拔的 OSGI Bundle, 且用户可以在运行时安装、 更新或停止这 些 OSGI Bundle。
SIP ( Session Initiation Protocol, 会话初始协议)是由 IETF ( Internet Engineering Task Force , 因特网工程任务组)定义, 基于 IP ( Internet Protocol , 网络互连协议) 的一个应用层控制协议。 SIP是基于纯文本的信令协议, 可以 管理不同接入网络上的会晤等。 会晤可以是终端设备之间任何类型的通信, 如视频会晤、 即时信息处理或协作会晤。 该协议不会定义或限制可使用的业 务, 传输、 服务质量、 计费、 安全性等问题都由基本核心网络和其它协议处 理。
SIP Servlet应用是基于 SIP协议的服务端小程序, 理论上可以用它实现任 何 java语言能实现的功能。 实际中, 一般用它来实现 web应用程序的后台逻辑 操作。
SIP Servlets规范, 提供了一系列的 Java API和一个基于 SIP容器 (SIP Container)或应用服务器 (Application Server)的开发模型, 用于提高服务器端 SIP应用的开发效率。 SIP Servlets同样基于 Java Servlet架构。 通过 SIP Servlets规范提供的 SIP容器, 开发人员可以非常简单的开发出复 杂的 SIP Servlet应用程序。多个 SIP Servlet应用程序形成一组 SIP Servlets。一组 SIP Servlets连同资源和部署描述文件打包后部署并运行在一个 SIP容器 (SIP Container)上。
SIP容器提供了例如会话状态管理、 事务管理、 重发、 网络连接、 消息 调度、 线程管理、 资源管理和应用程序管理等服务。 应用程序中只需包含高 级的消息处理和业务逻辑,开发人员不再需要在协议本身上投入过多精力, 这 使 SIP服务的开发成为一件轻而易举的事情。
每一个 SIP Servlet应用为 SIP容器的一个组件,接受 SIP容器的管理、调度。 比如, 当 SIP容器接收到一个 SIP请求的时候, SIP容器做出一系列的判断, 判 断通过调用哪个 SIP Servlet应用来实现该请求。
在现有技术中,在 SIP容器上开发 SIP Servlet应用时,可以使用 SIP容器 提供的各种管理和资源, 这为开发者带来很大的方便。 但是基于 SIP Servlets 规范的 SIP容器却不能支持系统的动态扩充, 亦即不支持对 SIP Servlet应用 的热插拔, 这在很大程度上限制了系统的灵活性。
显然现有技术的在 SIP容器中开发、 应用的 SIP Servlet应用无法具备可 热插拔、动态改变行为的特点, 而且 SIP Servlet应用程序由于不是 OSGI服务 平台的 OSGI Bundle, 所以也无法通过标准形式与 OSGI Bundle 通信。 发明内容
本发明实施例提供一种部署 SIP Servlet应用、 管理 SIP Servlet应用的方 法及 OSGI服务平台,使得 SIP Servlet应用既受 SIP容器的管理和调度, 同时 也具备 OSGI Bundle的可热插拔性能。
一种部署会话初始协议的服务端小程序 SIP Servlet应用的方法, 包括: 将 SIP Servlet应用以开放服务网关发起者服务平台组件 OSGI Bundle的 形式部署到开放服务网关发起者 OSGI服务平台中,并将所述 SIP Servlet应用 部署到 SIP容器中。 一种管理 SIP Servlet应用的 OSGI服务平台, 包括: SIP容器以及 SIP Servlet应用, 其中:
所述 SIP Servlet应用以 OSGI Bundle的形式部署在所述 OSGI服务平台 中, 并被部署到 SIP容器中, 所述 SIP Servlet应用与 OSGI服务平台中的其它 OSGI Bundle通过 OSGI服务平台的机制进行通信。
一种管理 SIP Servlet应用的方法, 包括:
OSGI服务平台部署所述 SIP Servlet应用, 调用所述 SIP Servlet应用的 Bundle激活程序;
在调用所述 SIP Servlet应用的 Bundle激活程序的过程中,实现将所述 SIP
Servlet应用部署到 SIP容器。
一种基于 OSGI服务平台管理 SIP Servlet应用的方法, 包括:
将 SIP容器以 OSGI Bundle的形式部署到 OSGM良务平台中;
将 SIP Servlet应用以 OSGI Bundle的形式部署到所述 OSGI服务平台中, 并 且将所述 SIP Servlet应用部署到所述 SIP容器中。
本发明实施例由于将 SIP Servlet应用以 OSGI Bundle的形式部署到 OSGI 服务平台中, 使得 SIP Servlet应用具有更好的动态性能, 可以热插拔, 并可 以通过 OSGI规范定义的 Bundle通信方式与其它 OSGI Bundle进行通信。 务平台后, 又釆用将 SIP Servlet应用注册到 SIP容器中,并建立 SIP容器加载 SIP Servlet应用的类的方法, 从而实现 SIP容器对该 SIP Servlet应用的管理和调度, 实现了 OSGI服务平台与 SIP容器相融合共同管理 SIP Servlet应用, 使得 SIP Servlet应用既受 SIP容器的管理和调度,同时也具备 OSGI Bundle的可热插拔性 能。
附图说明
图 1 为本发明实施例一实现 OSGI服务平台与 SIP容器相融合管理 SIP Servlet应用的方法的流程图; 图 2为本发明实施例一将 SIP Servlet应用以 OSGI Bundle的形式部署到 OSGI月良务平台中的流程图;
图 3为本发明实施例一的按照 SIP Servlet规范组织的 SIP Servlet应用的目 录结构图、 添加 SIP文件的示意图;
图 4为本发明实施例一的按照 OSGI服务平台的要求组织目录结构、 添加 Bundle配置文件的示意图;
图 5a为本发明实施例一的 SIP Servlet应用的 BundleActivator中 start方法实 现步骤流程图;
图 5b为本发明实施例一的 SIP Servlet应用、 SIP容器部署到 OSGI服务平台 上的示意图;
图 5c为本发明实施例一的 SIP Servlet应用部署到 OSGI服务平台上的示意 图;
图 5d为本发明实施例一的初始化 OSGISipApplication对象的步骤流程图; 图 6a为本发明实施例一的将 SIP Servlet应用注册到 SIP容器中的步骤流程 图;
图 6b为本发明实施例一的实现 SIP容器加载 SIP Servlet应用的 Bundle实例 的方法的步骤流程图;
图 7a为本发明实施例一的 OSGI服务平台与 SIP容器相融合共同管理 SIP Servlet应用的 OSGI服务平台示意图;
图 7b为本发明实施例一的另一种 OSGI服务平台与 SIP容器共同管理 SIP Servlet应用的 OSGI服务平台示意图;
图 8为本发明实施例二的 SIP Servlet应用的 BundleActivator中 start方法 实现步骤流程图。 具体实施方式
本发明实施例中,将 SIP容器以及 SIP Servlet应用以 OSGI Bundle的形式 部署到 OSGI服务平台中, 此时, SIP容器以及 SIP Servlet应用具备了 OSGI Bundle的特性, OSGI服务平台可以对其生命周期进行管理,比如激活、注册、 去激活等。 将 SIP Servlet应用注册到 SIP容器中, SIP容器就可以对该 SIP Servlet应用进行管理和调度了。这样就实现了 OSGI服务平台与 SIP容器相融 合共同管理 SIP Servlet应用的目的。
这里解释一下 OSGI服务平台与 SIP容器相融合共同管理 SIP Servlet应用的 含义。 对于已经以 OSGI Bundle的形式部署到 OSGI服务平台中的 SIP Servlet应 用来说, OSGI服务平台主要是对其生命周期进行管理,以及对其和其它 Bundle 的通信进行管理。 这种情况下, SIP Servlet应用就可以实现热插拔, OSGI服务 平台通过调用 Bundle的 Bundle激活程序, 即 Bundle Activator接口去控制其生命
Servlet应用激活后, OSGI服务平台并不管理该 SIP Servlet应用如何调度、 调用 等操作。
对于已经注册到 SIP容器中的 SIP Servlet应用, 其调度、 调用等操作由 SIP 容器进行管理。 在 SIP容器接收到外部一个 SIP请求后, SIP容器会根据 SIP Servlet应用注册的信息, 决定是否调用该 SIP Servlet应用来完成此任务。
下面以具体实施例详细说明本发明提供的技术方案, 其中实施例一描述 了 SIP容器以及 SIP Servlet应用以 OSGI Bundle的形式部署到 OSGI服务平台 中以及将 SIP Servlet应用注册到 SIP容器中的步骤;实施例二完成 SIP容器以 及 SIP Servlet应用以 OSGI Bundle的形式部署到 OSGI服务平台中的步骤,并 通过引用部署服务的 Bundle来完成将 SIP Servlet应用注册到 SIP容器中的步 骤。
实施例一
如图 1所示, 本发明实施例实现 SIP容器以及 SIP Servlet应用以 OSGI Bundle的形式部署到 OSGI服务平台的方法, 包括如下步骤:
步骤 S101: 将 SIP容器以 OSGI Bundle的形式部署到 OSGI服务平台中。 编写 SIP容器的作为 OSGI服务平台的一个 Bundle的 Bundle激活程序 ( BundleActivator ) , 增加 SIP容器的 MANIFEST.MF配置文件 , 该配置文件 为 SIP容器的 Bundle配置文件;将 SIP容器打包成 Jar文件,激活所有的 OSGI Bundle 后, OSGI 服务平台会通过 SIP 容器的 Bundle 激活程序 ( BundleActivator ) 启动 SIP容器。 在 SIP容器的 Bundle激活程序中包含有 启动、 更新、停止 SIP容器的操作。在 SIP容器的 Bundle配置文件中包括 SIP 容器的 Bundle名称、 描述、 开发商、 路径等。
当然, 在具体实施过程中, 本领域技术人员也可以不将 SIP容器以 OSGI Bundle的形式部署到 OSGI服务平台,同样实现 OSGI服务平台与 SIP容器共 同管理 SIP Servlet应用的目的。 具体的实现方法, 将在后续进行介绍。
步骤 S102: 将 SIP Servlet应用以 OSGI Bundle的形式部署到 OSGI服务 平台中, 并将 SIP Servlet应用部署到 SIP容器中。
上述步骤 S102中的具体步骤如图 2所示:
步骤 S201 :在写好一个 SIP Servlet应用后,按照 SIP Servlet规范编写 SIP 配置文件, 并按规范组织好目录结构。
写好 SIP Servlet应用后, 必须按照 SIP Servlet规范来组织目录结构并编 写配置文件,以便于 SIP容器的管理。组织的目录结构如图 3所示, SIP Servlet 应用的根目录下要设置 WEB-INF的目录,在 WEB-INF目录下有 classes和 lib 目录, 扩展名为 xml的文件, 即 sip.xml文件为 SIP Servlet应用的配置文件。
在该配置文件中描述了该 SIP Servlet应用所能实现的功能, 这个 SIP配 置文件将会被 SIP容器用来识别该 SIP Servlet应用所能实现的功能。
步骤 S202: 根据 OSGI服务平台的要求, 在 SIP Servlet应用根目录下增 加 META-INFO目录和 MANIFEST.MF配置文件。
作为 OSGI服务平台的一个 Bundle的前提是要具有符合 OSGI服务平台 的要求的目录组织结构与 Bundle配置文件,以便于 OSGI服务平台对该 Bundle 进行管理。
如图 4 所示, 本发明实施例中的 SIP Servlet应用在其根目录下添加 META-INFO 目录, 并在 META-INFO 目录中添加 MANIFEST.MF文件, 该 文件即为 SIP Servlet应用作为 OSGI服务平台的一个 Bundle的配置文件。 在 该配置文件的信息中描述了该 SIP Servlet应用 Bundle的名称、描述、开发商、 路径、 其需要导入的包以及输出的包等。
步骤 S203: 编写一个 SIP Servlet应用的 BundleActivator的实现代码, 使 得 SIP Servlet应用能够作为一个 OSGI Bundle部署到 OSGI服务平台中。
编写一个 SIP Servlet应用的 Bundle 激活程序, 即 SIP Servlet应用的 BundleActivator, 在该 BundleActivator中主要是实现 SIP Servlet应用的激活、 注册、 去激活。 而在实现激活 SIP Servlet应用的同时要实现将 SIP Servlet应 用注册到 SIP容器中, 并实现 SIP容器加载该应用的类, 如图 5a所示。 对于 本领域的技术人员来说, 实现上述 BundleActivator 的方法可以是直接在 BundleActivator中编写实现代码。
实现了上述的步骤, 已经成功地将 SIP Servlet应用作为 OSGI Bundle部 署到 OSGI服务平台中了,但是要实现该 SIP Servlet应用能够被 SIP容器进行 管理必须将 SIP Servlet应用注册到 SIP容器中, 并实现 SIP容器加载该应用 的类的方法。 如图 5a所示, 上述步骤 S203具体包括:
Servlet应用的 SIP Servlet应用实例对象。
在 SIP Servlet应用的 Bundle激活程序 BundleActivator中的启动方法一般是 start方法。在 start方法中创建一个 SIP Servlet应用实例对象 OSGISipApplication, 这个对象用以在 SIP容器中表示 SIP Servlet应用的实例对象。
步骤 S502: 初始化 SIP Servlet应用的 SIP Servlet应用实例对象。
只有在初始化 OSGISipApplication对象后 , SIP容器才能通过 OSGISipApplication对象完成对 SIP Servlet应用 的调用 , 其 中 , OSGISipApplication对象用来描述一个 SIP Servlet应用, 当一个 SIP Servlet应用 部署到 SIP容器中时, 就要创建一个该对象来表示它。 在初始化 OSGISipApplication对象的过程中需要将 SIP Servlet应用部署到 SIP容器中, 并且实现 SIP容器加载 SIP Servlet应用的类的方法。 具体的, 在初 始化 OSGISipApplication对象的过程中调用 SIP容器的部署服务的 deployApplication方法来实现将 SIP Servlet应用部署到 SIP容器中。 对于本领域 技术人员来说, 可以有多种技术手段来实现调用 SIP容器的部署服务的 deployApplication方法: 如果, SIP容器已经作为 OSGI Bundle部署到 OSGI服务 平台中, 那么调用 SIP容器的部署服务的 deployApplication方法可以是通过 OSGI服务平台的 Bundle上下文获得 SIP容器的部署服务的实例来调用 SIP容器 的部署服务的 deployApplication方法, 如图 5b所示; 如果, SIP容器没有作为 OSGI Bundle部署到 OSGI服务平台中,则通过单例模式或者命名服务直接获得 SIP容器的部署服务的类而调用部署服务的 deployApplication方法, 如图 5c所 示。
在调用 SIP容器的部署服务的 deployApplication方法的过程中, 实现了将 SIP Servlet应用部署到 SIP容器中, 如图 5d所示, 具体包括如下步骤:
步骤 S511 : 将 SIP Servlet应用注册到 SIP容器中。
将 SIP Servlet应用的 SIP配置文件中的内容注册到 SIP容器中, SIP容器就可 以根据注册的内容决定是否调用该 SIP Servlet应用。
步骤 S512: SIP容器加载 SIP Servlet应用的 Bundle实例。
只有实现了 SIP容器加载 SIP Servlet应用的 Bundle实例, SIP容器才可以支 配 SIP Servlet应用的类和资源。
上述步骤 S511中的将 SIP Servlet应用注册到 SIP容器中的具体步骤如图 6a 所示, 具体包括如下步骤:
步骤 S601 : 解析 SIP Servlet应用的 SIP配置文件。
文件 sip.xml 为 SIP Servlet应用的 SIP配置文件, 其中描述了 SIP Servlet应 用的 Servlet class信息以及 pattern模式信息等等。 其中 pattern模式信息以文本方 式描述了表达式,该表达式为 SIP Servlet应用主要实现的功能。解析 SIP Servlet 应用的 SIP配置文件, 得到该文本表达式。
步骤 S602: 创建规则表达式对象, 根据 SIP配置文件中的文本表达式解析 得到规则表达式, 并将 SIP Servlet应用实例对象注入到该规则表达式对象中。
创建一个 Rule对象,在该 Rule对象中根据上述的文本表达式在 Rule对象中 实现对该文本表达式的转换, 将该文本表达式转换成 SIP容器可以识别并运算 的格式—— rule表达式, 并调用该规则表达式对象的 setter方法, SIP Servlet应 用实例对象将自己的引用注入到该规则表达式对象中。
步骤 S603: 将规则表达式注册到 SIP容器的管理器中。
调用 SIP容器中 Rule Manager方法,把规则表达式注册到 SIP容器的管理器 中。
上述步骤 S512中的实现 SIP容器加载 SIP Servlet应用的类的方法的具体步 骤如图 6b所示:
步骤 S611 : 创建一个加载对象。
创建一个加载对象, OSGIAppClassLoader对象, 这个对象 SIP容器可以用 来加载 SIP Servlet应用的资源。
步骤 S612: 获取 SIP Servlet应用的 Bundle实例, 并将该实例传入加载对象 的构造方法参数中。
获取 SIP Servlet应用的 Bundle实例,即获取先前创建的 OSGISipApplication 对象的 Bundle。 在获取 SIP Servlet应用的 Bundle实例后, 将该 Bundle实例传入 OSGIAppClassLoader对 象的构造方 法参数中 。 当 SIP容器使用 OSGIAppClassLoader加载 SIP Servlet应用时就会取得该 SIP Servlet应用的 Bundle实例,从而 SIP容器就可以管理、使用该 SIP Servlet应用的 Bundle的资源。
通过步骤 S601-S603和步骤 S611-S612,实现了将 SIP Servlet应用部署到 SIP 容器中。 这样, 在 SIP容器接收到外部 SIP请求后, SIP容器根据 SIP请求中的消 息内容查询管理器中注册的规则表达式, 并获得匹配的规则表达式对象, 从 匹配的规则表达式对象中取出所述 SIP Servlet应用实例对象, 在该 SIP Servlet 应用实例对象中使用 SIP Servlet应用的加载对象加载该规则表达式对象对应 的 SIP Servlet应用的资源和类, 并为所述 SIP Servlet应用的类创建实例, 处理 该 SIP请求。
本发明实施例还提供了一种 OSGI服务平台, 在该 OSGI服务平台上以 OSGI Bundle的形式部署了 SIP容器和 SIP Servlet应用, 其中 SIP Servlet应用部 署到 SIP容器中, 从而实现基于 OSGI服务平台, OSGI服务平台与 SIP容器共同 管理 SIP Servlet应用的目的。
在实现了将 SIP容器、 SIP Servlet应用作为 Bundle部署到了 OSGI服务 平台中后, SIP Servlet应用将自己注册到 SIP容器中, 并且 SIP容器通过使用 OSGIAppClassLoader来加载 SIP Servlet应用的类, 从而实现 OSGI服务平台 与 SIP容器相融合共同管理 SIP Servlet应用。 SIP Servlet应用可以同时具有作 为 OSGI Bundle的可热插拔性的特点, 同时也可以被 SIP容器调度、 管理, 集中了两者的优点。
在将 SIP容器、 SIP Servlet应用作为 Bundle部署到了 OSGI服务平台中 后, 可以实现 OSGI服务平台与 SIP容器相融合共同管理 SIP Servlet应用。 OSGI服务平台与 SIP容器相融合共同管理 SIP Servlet应用的 OSGI服务平台 示意图如图 7a所示。
其中, SIP容器作为一个标准的 OSGI Bundle部署到 OSGI服务平台上, SIP Servlet应用也作为一个标准的 OSGI Bundle部署到 OSGI服务平台上。 因 此 SIP Servlet应用、 SIP容器就可以作为标准的 OSGI Bundle与其它的 Bundle 可以通过 OSGI服务平台的机制来进行通信。
另外, SIP容器把对每个 SIP Servlet应用的相关管理功能也代理给 OSGI 服务平台。 具体的, 当 OSGI服务平台部署该 SIP Servlet应用 Bundle时, 会 自动调用 SIP Servlet应用的 Bundle Activator的激活程序。 而 SIP Servlet应用 的 Bundle Activator中又实现了将 SIP Servlet应用自动部署到 SIP容器的功能。 这样, SIP容器在加载 SIP Servlet应用的资源的时候不用从 SIP Servlet应用的 路径中加载资源, 而是通过 SIP Servlet应用加载 SIP Servlet应用的资源。 在 OSGI服务平台上卸载 SIP Servlet应用时, 调用 SIP Servlet应用的 Bundle Activator的去激活程序, 该 SIP Servlet应用会自动从 SIP容器中卸载。
SIP Servlet Container 需要把每个 SIP Servlet Ap 相关的管理功能 ( ClassLoader, App的动态部署和卸载机制 )通过适配机制代理给 OSGI框 架, 以避免 Container和 OSGI框架在同一个管理功能上的冲突。
当然,对于本领域技术人员也可以釆用不将 SIP容器部署到 OSGI服务平 台上, 而实现 OSGI服务平台与 SIP容器共同管理 SIP Servlet应用的 OSGI服 务平台, 如图 7b所示。 当 OSGI服务平台部署该 SIP Servlet应用 Bundle时, 会自动调用 SIP Servlet应用的 Bundle Activator的激活程序。在 Bundle Activator 的激活程序中实现了通过单例模式或者命名服务来调用 SIP容器的部署服务 的 deployApplication方法,从而实现了将 SIP Servlet应用自动部署到 SIP容器 的功能。这样, SIP容器在加载 SIP Servlet应用的资源的时候不用从 SIP Servlet 应用的路径中加载资源, 而是通过 SIP Servlet应用加载 SIP Servlet应用的资 源。
本发明实施例由于将 SIP Servlet应用以 OSGI Bundle的形式部署到 OSGI 服务平台中, 使得 SIP Servlet应用具有更好的动态性能, 可以热插拔, 并可 以通过标准方式与其它 OSGI Bundle进行通信。
本发明实施例由于在将以 OSGI Bundle的形式部署到 OSGM良务平台后,又 釆用将 SIP Servlet应用注册到 SIP容器中, 并建立 SIP容器加载 SIP Servlet应用 的类的方法,从而实现 SIP容器对该 SIP Servlet应用的管理,此时即实现了 OSGI 服务平台与 SIP容器相融合共同管理 SIP Servlet应用。
实施例二
在具体实施本发明实施例时, 可以在 OSGI服务平台上部署一个部署服务 的 OSGI Bundle, 即部署服务 bundler,该部署服务 Bundle用以完成将 SIP Servlet 应用部署到 SIP容器中的任务。 本发明实施例实现 OSGI服务平台与 SIP容器相融合管理 SIP Servlet应用的 方法的主要步骤与实施例一的相同, 如图 1所示。
本发明实施例实现将 SIP Servlet应用以 OSGI Bundle的形式部署到 OSGI 服务平台中, 并将 SIP Servlet应用部署到 SIP容器中的步骤与实施例一中的 相同, 如图 2所示。
本发明实施例中编写的 SIP Servlet应用的 Bundle Activator的实现代码完成 的步骤, 如图 8所示, 具体包括如下步骤:
步骤 S801: 获取 SIP Servlet应用的 Bundle实例。
从 Bundle上下文中获取 SIP Servlet应用自己的 Bundle实例, 该 Bundle实例 将会作为构造方法参数传入部署服务并被获取。
步骤 S802: 获取部署服务 Bundle的 Bundle实例。
从 Bundle上下文中获取部署服务 Bundle的 Bundle实例。 获取该部署服务 Bundle的 Bundle实例的前提是部署服务以 OSGI Bundle的形式部署到了 OSGI 服务平台中。 本领域技术人员都熟悉将部署服务中实现的代码打包成 jar文件, 然后部署到 OSGI服务平台的技术手段。 而部署服务中实现的代码完成的功能 在后续中会介绍到。
步骤 S803 : 调用部署服务的部署方法来将 SIP Servlet应用部署到 SIP容器 中。
在获取部署服务 Bundle的 Bundle实例后, 根据部署服务 Bundle的 Bundle实 例调用部署服务的部署方法来完成将 SIP Servlet应用部署到 SIP容器中的任 务。
其中在上述部署方法中具体完成的部署任务与实施例一的步骤 S203完全 相同, 如图 5a、 图 5b所示。
通过以上步骤完成了将 SIP容器以及 SIP Servlet应用部署到 OSGI中, 并且 通过引用部署服务将 SIP Servlet应用部署到 SIP容器中, 从而实现了基于 OSGI 服务平台, SIP容器与 OSGI服务平台共同管理 SIP Servlet应用的目的。 利用部署服务来完成将 SIP Servlet应用部署到 SIP容器中的任务的做法就 好比编写了一个子程序, 每次执行相同步骤的时候就不需要再重新编写一段 执行该步骤的代码, 而直接调用子程序就可以了。该部署服务的 Bundle其实就 是为 SIP Servlet应用提供部署到 SIP容器的服务, 这样每次部署新的 SIP Servlet 应用时直接引用部署服务的 Bundle就实现了将 SIP Servlet应用部署到 SIP容器 中的任务。
本发明实施例由于将 SIP Servlet应用以 OSGI Bundle的形式部署到 OSGI 服务平台中, 使得 SIP Servlet应用具有更好的动态性能, 可以热插拔, 并可 以通过标准方式与其它 OSGI Bundle进行通信。
本发明实施例由于在将以 OSGI Bundle的形式部署到 OSGI服务平台后, 又釆用将 SIP Servlet应用注册到 SIP容器中,并建立 SIP容器加载 SIP Servlet 应用的类的方法, 从而实现 SIP容器对该 SIP Servlet应用的管理, 此时即实 现了 OSGI服务平台与 SIP容器相融合共同管理 SIP Servlet应用。
本发明实施例由于釆用了引用部署服务将 SIP Servlet应用部署到 SIP容 器中的方法, 提高了代码效率, 使得实现每个 SIP Servlet应用部署到 SIP容 器中的任务更加快捷、 方便。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流 程, 是可以通过计算机程序来指令相关的硬件来完成, 所述的程序可存储于 一计算机可读取存储介质中, 该程序在执行时, 可包括如上述各方法的实施 例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体( Read-Only Memory, ROM )或随机存 己忆体 ( Random Access Memory, RAM )等。
以上所述仅是本发明的优选实施方式, 应当指出, 对于本技术领域的普 通技术人员来说, 在不脱离本发明原理的前提下, 还可以作出若干改进和润 饰, 这些改进和润饰也应视为本发明的保护范围。

Claims

权 利 要求 书
1、 一种部署会话初始协议的服务端小程序 SIP Servlet应用的方法, 其特征 在于, 包括:
将 SIP Servlet应用以开放服务网关发起者服务平台组件 OSGI Bundle的形 式部署到开放服务网关发起者 OSGI服务平台中, 并
将所述 SIP Servlet应用部署到 SIP容器中。
2、如权利要求 1所述的方法,其特征在于,所述将 SIP Servlet应用以 OSGI Bundle的形式部署到 OSGI服务平台中, 并将 SIP Servlet应用部署到 SIP容器 中的方法包括:
组织符合所述 OSGI服务平台的要求的 SIP Servlet应用的目录结构并增加 Bundle配置文件;
编写所述 SIP Servlet应用的 Bundle激活程序,在所述 Bundle激活程序的启 动方法中, 对于所述 SIP容器, 创建 SIP Servlet应用的 SIP Servlet应用实例对 象, 并初始化该 SIP Servlet应用实例对象; 并
在初始化所述 SIP Servlet应用实例对象的过程中, 将所述 SIP Servlet应用 注册到所述 SIP容器中;以及为所述 SIP容器提供加载 SIP Servlet应用资源的方 法。
3、 如权利要求 1所述的方法, 其特征在于, 还包括:
将所述 SIP容器以 OSGI Bundle的形式部署到所述 OSGI服务平台中; 以及, 在部署过程中将 SIP容器的部署服务的实例注册到 Bundle上下文服 务中。
4、如权利要求 3所述的方法,其特征在于,所述将 SIP Servlet应用以 OSGI Bundle的形式部署到 OSGI服务平台中, 并将 SIP Servlet应用部署到 SIP容器 中的方法包括:
组织符合所述 OSGI服务平台的要求的 SIP Servlet应用的目录结构并增加 Bundle配置文件;
编写所述 SIP Servlet应用的 Bundle激活程序,在所述 Bundle激活程序的启 动方法中, 从 Bundle上下文服务中取得 SIP容器的部署服务的实例并调用该部 署服务 Bundle的部署方法,所述部署方法将 SIP Servlet应用部署到 SIP容器中。
5、如权利要求 1所述的方法,其特征在于,所述将 SIP Servlet应用以 OSGI Bundle的形式部署到 OSGI服务平台中, 并将 SIP Servlet应用部署到 SIP容器 中的方法包括:
组织符合所述 OSGI服务平台的要求的 SIP Servlet应用的目录结构并增加 Bundle配置文件;
编写所述 SIP Servlet应用的 Bundle激活程序,在所述 Bundle激活程序的启 动方法中, 通过单例模式或命名服务调用 SIP容器的部署服务的实例中的部署 方法, 所述部署方法将 SIP Servlet应用部署到 SIP容器中。
6、如权利要求 4或 5所述的方法,其特征在于,所述部署方法将 SIP Servlet 应用部署到 SIP容器中的方法包括:
对于所述 SIP容器, 创建所述 SIP Servlet应用的 SIP Servlet应用实例对象, 并初始化该 SIP Servlet应用实例对象; 并
在初始化所述 SIP Servlet应用实例对象的过程中, 将所述 SIP Servlet应用 注册到 SIP容器中; 为所述 SIP容器提供加载 SIP Servlet应用资源的方法。
7、 如权利要求 6所述的方法, 其特征在于, 将所述 SIP Servlet应用注册到 所述 SIP容器中的方法包括:
解析所述 SIP Servlet应用的 SIP配置文件,得到 SIP配置文件中的文本表达式; 创建规则表达式对象, 在规则表达式对象中根据所述 SIP配置文件中的文本 表达式解析得到规则表达式, 并把 SIP Servlet应用实例对象注入到该规则表达式 对象中;
将所述规则表达式注册到 SIP容器的管理器中。
8、 如权利要求 6所述的方法, 其特征在于, 所述为所述 SIP容器提供加载 SIP Servlet应用资源的方法包括:
创建 SIP Servlet应用的加载对象, 使得所述 SIP容器使用所述加载对象加载 SIP Servlet应用的资源;
获取 SIP Servlet应用的 Bundle实例, 并将获取的实例传入所述加载对象的 构造方法参数中。
9、 如权利要求 8所述的方法, 其特征在于, 所述 SIP容器使用所述加载对象 加载 SIP Servlet应用的资源的方法, 包括:
当 SIP容器接收到 SIP请求时, 根据所述 SIP请求中的消息内容查询匹配的规 则表达式对象;
从所述匹配的规则表达式对象中取出所述 SIP Servlet应用实例对象; 在所述 SIP Servlet应用实例对象中使用 SIP Servlet应用的加载对象加载所规 则表达式对象对应的 SIP Servlet应用的资源和类, 并为所述 SIP Servlet应用的类 创建实例, 由该实例处理所述 SIP请求。
10、 一种管理 SIP Servlet应用的 OSGI服务平台, 其特征在于, 包括: SIP 容器以及 SIP Servlet应用, 其中:
所述 SIP Servlet应用以开放服务网关发起者服务平台组件 OSGI Bundle的 形式部署在 OSGI服务平台中, 并被部署到所述 SIP容器中, 所述 SIP Servlet 信。
11、 如权利要求 10所述的 OSGI服务平台, 其特征在于, 所述 SIP容器以 OSGI Bundle的形式部署在所述 OSGI服务平台中。
12、 如权利要求 11所述的 OSGI服务平台, 其特征在于, 所述 SIP容器以 服务平台的机制进行通信。
13、 如权利要求 10或 11或 12所述的 OSGI服务平台, 其特征在于, 当所 述 OSGI服务平台部署所述 SIP Servlet应用,调用所述 SIP Servlet应用的 Bundle 激活程序时, 实现将所述 SIP Servlet应用部署到所述 SIP容器。
14、 如权利要求 10或 11或 12所述的 OSGI服务平台, 其特征在于, 所述 SIP容器通过 SIP Servlet应用加载 SIP Servlet应用的资源。
15、 一种管理 SIP Servlet应用的方法, 其特征在于, 包括:
OSGI服务平台部署所述 SIP Servlet应用, 调用所述 SIP Servlet应用的 Bundle激活程序;
在调用所述 SIP Servlet应用的 Bundle激活程序的过程中, 实现将所述 SIP Servlet应用部署到 SIP容器。
16、 如权利要求 15所述的方法, 其特征在于, 还包括: 所述 SIP容器通过 SIP Servlet应用加载 SIP Servlet应用的资源。
17、一种基于 OSGI服务平台管理 SIP Servlet应用的方法,其特征在于,包括: 将 SIP容器以 OSGI Bundle的形式部署到 OSGM良务平台中;
将 SIP Servlet应用以 OSGI Bundle的形式部署到所述 OSGM良务平台中, 并且 将所述 SIP Servlet应用部署到所述 SIP容器中。
PCT/CN2008/073386 2007-12-14 2008-12-09 部署、管理sip servlet应用的方法及osgi服务平台 WO2009076877A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
EP08861489.6A EP2216962B1 (en) 2007-12-14 2008-12-09 A method for deploying and managing the sip servlet application and the osgi service platform thereof

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200710199571.2A CN101459740B (zh) 2007-12-14 2007-12-14 部署SIP Servlet应用、管理SIP Servlet应用的方法及其系统
CN200710199571.2 2007-12-14

Publications (1)

Publication Number Publication Date
WO2009076877A1 true WO2009076877A1 (zh) 2009-06-25

Family

ID=40770355

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2008/073386 WO2009076877A1 (zh) 2007-12-14 2008-12-09 部署、管理sip servlet应用的方法及osgi服务平台

Country Status (3)

Country Link
EP (1) EP2216962B1 (zh)
CN (1) CN101459740B (zh)
WO (1) WO2009076877A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101834868B (zh) * 2010-04-30 2012-10-17 中国科学院地理科学与资源研究所 一种Web空间分析服务中空间分析方法包的部署和管理方法
CN101977274A (zh) * 2010-10-25 2011-02-16 中兴通讯股份有限公司 一种进行业务平台部署的系统及方法
CN102316163B (zh) * 2011-09-07 2014-01-15 山东中创软件工程股份有限公司 一种实现Web容器扩展的方法及实现Web容器扩展的装置
CN105095970B (zh) * 2014-04-25 2018-09-21 阿里巴巴集团控股有限公司 第三方应用的执行方法及系统
CN104407904B (zh) * 2014-12-15 2018-01-02 深圳市科漫达智能管理科技有限公司 一种模块信息配置的方法及系统
CN105511902B (zh) * 2015-11-09 2019-11-12 Tcl集团股份有限公司 一种安卓平台模块动态加载的方法及系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1662004A (zh) * 2004-02-27 2005-08-31 华为技术有限公司 一种实现会话发起协议应用服务器多业务处理的方法
CN101051943A (zh) * 2006-03-15 2007-10-10 阿尔卡特朗讯公司 用于OSGi捆绑件的基于TR69的服务接口
JP2007279959A (ja) * 2006-04-05 2007-10-25 Fuji Xerox Co Ltd ソフトウェアコンポーネントのインストール方法、インストーラ、及び複合機
US20070280226A1 (en) * 2006-04-04 2007-12-06 Rohit Sonalkar Servlet model for media rich applications

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005055549A1 (en) * 2003-12-01 2005-06-16 France Telecom System for providing services in response to a communications session message
US8549541B2 (en) * 2004-03-26 2013-10-01 Intellectual Ventures Ii Llc Bridging local device communications across the wide area

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1662004A (zh) * 2004-02-27 2005-08-31 华为技术有限公司 一种实现会话发起协议应用服务器多业务处理的方法
CN101051943A (zh) * 2006-03-15 2007-10-10 阿尔卡特朗讯公司 用于OSGi捆绑件的基于TR69的服务接口
US20070280226A1 (en) * 2006-04-04 2007-12-06 Rohit Sonalkar Servlet model for media rich applications
JP2007279959A (ja) * 2006-04-05 2007-10-25 Fuji Xerox Co Ltd ソフトウェアコンポーネントのインストール方法、インストーラ、及び複合機

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2216962A4 *

Also Published As

Publication number Publication date
CN101459740A (zh) 2009-06-17
EP2216962A1 (en) 2010-08-11
CN101459740B (zh) 2011-09-14
EP2216962B1 (en) 2013-10-23
EP2216962A4 (en) 2011-02-23

Similar Documents

Publication Publication Date Title
KR101219855B1 (ko) 동적 서비스 대리자
Issarny et al. A perspective on the future of middleware-based software engineering
US7640542B2 (en) Managing midlet suites in OSGI environment
US8856734B2 (en) Type-safe dependency injection of services into enterprise components
US20120246316A1 (en) Automatic Registration of Enterprise Resources in a Dynamic Module System Services Registry
KR20060099392A (ko) 웹 서비스 환경 내에서 통신하도록 개발되지 않은 레거시애플리케이션 컴포넌트를 위한 동적인 웹 서비스를생성하는 방법 및 컴퓨터 프로그램 제품
WO2009076877A1 (zh) 部署、管理sip servlet应用的方法及osgi服务平台
US9152384B2 (en) System and method for referencing a dynamic module system within a component oriented application development framework
US11411812B2 (en) Dynamic service creation for microservice-based integration service
JP2004151800A (ja) 呼出規約変換処理の生成方法
CN115248692A (zh) 一种支持多种深度学习框架模型云端部署的装置及方法
CN112698930B (zh) 一种获取服务器标识的方法、装置、设备及介质
US7584302B1 (en) Business integration component for containers
US8024746B2 (en) Common handler framework
Srinivasmurthy et al. Web2exchange: A model-based service transformation and integration environment
Abdellatif Enhancing the management of a j2ee application server using a component-based architecture
Jololian et al. A framework for a meta-semantic language for smart component-adapters
Bettini et al. A software framework for rapid prototyping of run-time systems for mobile calculi
Timm et al. Dynamic web service orchestration applied to the device profile for web services in hierarchical networks
US8849631B2 (en) Protocol independent telephony call lifecycle management scheme
Robert et al. The corba connector model
Faure et al. User-defined scenarios in ubiquitous environments: creation, execution control and sharing
Juneau et al. Jakarta Servlets
Verhoosel et al. The FRIENDS Platform: Conquering Complexity using Distributed Software Components
Yassine et al. Service Oriented Approach State of the Art

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 08861489

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2008861489

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE