Summary of the invention:
The purpose of this invention is to provide a kind of software component and realize the multi-protocols service method, make and member has externally provides service by multiple interaction protocol ability specifically adopt any agreement to determine by CLIENT PROGRAM.
On this basis, the present invention also provides increases the support method of member to new interaction protocol in the time of running.
On this basis, the present invention also provides the method for adjusting interaction protocol during client access according to user's request.
Technical scheme of the present invention is as follows:
Software component is realized the multi-protocols service method, may further comprise the steps:
Be that member generates different skeleton programs when (1) disposing.In order to improve the dirigibility of system, do not comprise code in the application program of forming by member about the component interactive agreement.When in a concrete running environment, disposing a concrete application, the multiple interaction protocol that can specify the member in the application to support by the deployment personnel, the interaction protocol of extensively having been supported at present as IIOP, JRMP, SOAP etc.System layer software (as application server) is that member generates a plurality of skeleton programs specific to interaction protocol automatically according to this information.The skeleton program is used to resolve from the message client, that meet specific interaction protocol, and the message branch is tasked concrete member example.Then, after member is finished service, result is returned to the client by the message format of interaction protocol.
(2) quote to searching the different member of server registration.It is the information with special format for client accurate align member that member is quoted, it can be in the member client space to a kind of concrete expression of member, also can be to be stored in a record of searching in the server.Member in the network environment is quoted and has been comprised many details, for example the network address of the type of interaction protocol and version, member place node, communication port, instance identification or the like.Have different forms or manifestation mode because the member of distinct interaction agreement is quoted, therefore, system layer software need be quoted for same member generates a plurality of members specific to different agreement, and registers to searching server.Like this, different clients searches in the server to searching of correspondence according to the interaction protocol that own institute grasps or understands, and the member that can retrieve required member is quoted, and utilize the information of member in quoting to set up and being connected of member, send concrete message to member then.
(3) start different interaction protocol audiomonitors.The interaction protocol audiomonitor is to be specifically designed to the mechanism of monitoring client's message, generally speaking, for certain concrete interaction protocol, can allow a plurality of or whole members in the application program share a protocol listening device, to save system resource, as communication port etc., and help the centralized control that realizes that some is special, as safe access control etc.Like this, the system layer software of an application program generates a protocol listening device for each interaction protocol, be responsible for receiving the client and quote the request message that sends to member according to member, and when receiving concrete client's message, according in the message about the information of member name, decision is by the work of treatment of the skeleton program continuation message of which member, and the function that provides of final component invoking.
If member finds some client and adopted a kind of new agreement, and this agreement promptly needs to increase the support to this agreement when important.Therefore ingredient owing to the support scheme of interaction protocol being belonged to system layer software, need carry out off-line or online evolution to system layer software.The off-line evolution method need stop system, increases the code of supporting New Deal, restarts application system then; And the online evolution method is keeping application system to continue to increase the support to New Deal online under the prerequisite of operation.On function, quality and the scope of application, all be better than off-line method at line method, the large software system of the uninterrupted service of carrier-class, 7 * 24 (7 days weekly, 24 hours every days) especially need be provided those.The support of online increase New Deal comprises following key step in system software: at first, system layer software need obtain the detail content about New Deal, for example data representation mode, various message format, to the mapping of lower layer protocol, member reference formats or the like; Then,, write skeleton program generator corresponding and protocol listening device with agreement according to protocol contents, and after compiling dynamic load in system software; At last, for existing software component generates the skeleton program of supporting New Deal respectively, startup New Deal audiomonitor also will be quoted to be registered to and search in the server specific to the member of New Deal.At this moment, the agreement that the member in the system promptly can be new externally provides and has served.
In addition, the client owing to special demand, may need to adjust some attribute of interaction protocol in reciprocal process.At this moment, interaction protocol is constant, only adjust some attribute of agreement, can adjust to the ssl protocol that adopts safety from adopting common TCP host-host protocol as IIOP, perhaps increase IIOP message max cap. to improve transfer efficiency, this moment, the client only need be responsible for proposing to adjust requirement, was supported by interaction protocol realization mechanism (for example controllability of skeleton program).
Advantage of the present invention and good effect: adopt method of the present invention, by improving the adaptive faculty of software component to interaction protocol, making needs the CLIENT PROGRAM of a plurality of members of visit to visit different members according to the mode of single-protocol, not only simplify the program of client greatly, also improved the dirigibility of whole software system.On this basis, also providing in the time of running increases the support method of new interaction protocol and adjusts the method for interaction protocol during the visit according to user's request, can carry out the upgrading or the adjustment of interaction protocol under the current system of maintenance continuous service, the impregnable prerequisite of service quality.This at present based on the large software system of Web integrated, developing has crucial meaning.In addition, another patent---" the online evolution method of component-based software " (application number: 01136385.1) have complementary effect of the present invention and applicant application.
Embodiment:
This section provides a realization based on the J2EE application server, and Fig. 1 has provided synoptic diagram.
Application server is the high-rise operation platform of application program in the network environment, makes that the code of application system is more succinct, the exploitation is more convenient.Application server is considered to after operating system, data base management system (DBMS), the landmark system software that occurs along with the development of computer network environment.In application server based on J2EE, the agreement that can adopt member in the deployment descriptor (Application.xml) of the descriptor (ejb-jar.xml) of member or application system describes, and needn't comprise the information about agreement in the piece code.In this example, by the support of multi-protocols support platform (application server), services component wherein can provide service by four kinds of agreements altogether.These four kinds of agreements are respectively: IIOP, SOAP, JRMP and RPC agreement.
When the concrete application of one of application server deploy, each agreement that application server will be at first intended supporting for this member in using generates audiomonitor, and makes them enter active state, promptly can receive client's solicited status; Then, search in the deployment descriptor statement, support member skeleton, the member of different agreement to quote, and member quoted to be registered to search in the server (utilizing the JNDI interface) for each member generates about agreement.In this example, each member is quoted and has been registered to respectively in CORBA name service, UDDI registration table, RMI registration table and the COM registration table.
When CLIENT PROGRAM need be used the service that member provides, the member of at first searching required member is quoted, information in quoting according to member then, for example: the network address of member place computing machine, the port that this protocol listening device uses, the binding name of member, and possible member example, or the like.Then, CLIENT PROGRAM is sent various requests to member, for example connection request, concrete service request or the like.In this example, these clients are respectively CORBA client, service requester, RMI client and COM client.
If the client searches in searching server less than the quoting of member, show that this member do not support the employed agreement of client at present, can consider to increase support by the system manager of other approach notice member place system to New Deal.
When CLIENT PROGRAM need be adjusted agreement, for example when the HOP based on TCP becomes HOP based on SSL, the agency by agreement of client will set up that SSL is connected with the member skeleton and by this connections exchange IIOP message, thereby realize safe transmission of messages.