COTS Application Development Framework (4)

xiaoxiao2021-04-08  416

Multiple COTS-based applications

COTS-based application structure

COTS-based applications contain the following components:

ü

A set of display logic (JSP file);

ü

A blcontext instance and a configuration file;

ü

A set of business components;

ü

A set of databases;

ü

Cots frame package provided by the COTS framework;

Therefore, it can be considered: a BlContext is an application's business logic agent. The interaction between COTS-based applications can be seen as an interaction between their BLCONTEXT.

We mainly discuss interactions between COTS-based Web Application in a JVM process

Interaction between multiple local BLCONTEXTs based on COTS

As shown in the figure above, there are two COTS-based applications in a servlet container. These two applications are referenced by local BLCONTEXT objects. In this case, the business method in BLCONTEXT1 and the method in BLCONText2 can be freely invocated, which is called the local Java method.

Multiple remote BLCONTEXT interactions based on COTS

In this case, the method in the business component in BlContext1 can freely call the method in BlContext2, and the method in BlContext2 can also freely call the method in BlContext1, and the mutual calls between them are implemented by EJB calls.

Interaction based on COTS multiple local and remote BLCONText

In the above figure, the methods in BLCONTEXT1 and BLCONTEXT2 can be called mutual, but the method in BlContext3 can be invoked, and BLCONTEXT3 can call the method in BlCONText1 and BLCONTEXT2.

Implementation of business method interaction in different blcontext

Assuming a business method in BLContext in a name A, BLTEST needs to call the business method Calledbl in the blcontext name B, and the actual code is as follows:

Public Int A (BizData Rd, BizData SD) {

.......

IBLCONText Bcontext = _Context.getCallableBlContext ("b");

// Check if the bcontext is available

IF (bcontext! = null) {

Blresult RS = BCONText.execbl ("Calledblc", "Calledbl", RD, SD);

} else {

// blcontext named b is not available currently;

}

.......

}

Analysis The above code We can see that when you call another BLCONText, we only need to know his name, the name of the business component being called, and the method called by the call, not to manage this BLCONTEXT is deployed. Is it a local or remote BlconText object (of course, it is necessary to ensure that this BLCONText can be called); at the same time, when multiple applications exist, the name of each BlContext must be guaranteed to be unique.

转载请注明原文地址:https://www.9cbs.com/read-132705.html

New Post(0)