OMG IDL grammar rules and ORB

zhaozj2021-02-08  472

OMG IDL grammar rules and ORB

(This article is reproduced from Software Engineering Expert Network www.21cmm.com)

Su Yang

9. Inheritance of the interface

Similar to the inheritance of C and Java, the inheritance of the interface is divided into two types in the omg IDL:

● Single inheritance: An interface inherits the properties and method characteristics of another interface;

● Multi-inheritance: An interface inherits the properties and method of two or more interfaces.

When writing interface definitions with inheritance relationship, if the parent interface of the interface is not defined before the interface definition, you need to declare the parent interface before defining the interface, the so-called pre-declaration. The interface inherit is explained below.

In the previous lecture, the Human Resource Management Interface JobManager has been defined. Due to the actual needs, the resource service interface is defined according to the interface, and the interface should inherit the feature of the management interface. Therefore, define a new interface JobServer with a management interface for the parent object:

Interface JobServer: JobManager

{Void Mailtomanager (in long managerid, out string status);

JobServer: JobManager indicates that the interface JobServer inherits the object features of JobManager.

In the above example, only the type of inheritance is explained, and more inheritance needs to be separated by a comma will be inherited, such as:

Interface JobCenter: JobServer, JobManager {}

10. Exception (Exception)

Similar to C and Java syntax rules, CORBA also provides an exception handling mechanism called "Raising An Exception). CORBA itself defines a part of an exception that is triggered by the call request or ORB, called the system exception (please refer to the relevant information about the CORBA system exception). Therefore, exceptions defined in OMG IDL are often referred to as "custom abnormalities".

The OMG IDL defines the user anomaly with an Exception keyword. After the defined method, add the Raise keyword, if an exception trigger condition is met, the definition type exception is triggered. As shown in the following example:

Enum errorstatus {fat, important, slight, nomeing};

Exception Reasonofmail

{Errorstatus status;

Interface JobManager

{String QueryJobStatus (in long number, out string print "

Raises (Reasonofmail);

11. Definition method passed the context

In the previous few lectures, how to pass the context, how the context is transmitted in the interface defined method? The context object includes a name value called a feature name-eigenvalue, using the context keyword definition in the method. The ORB matches the feature value in the object implementation when each client issues a call request. As shown in the following example:

String queryjobstatus (in long number, out string print ")

Raise (RASONOFMAIL) Context ("WHO");

When the QueryJobStatus method is executed, the ORB matches the characteristic value of "WHO" in the context sequence of the service object implementation end.

Interoperability is embodied in multiple objects distributed in the network with the Internet ORB Agreement (IIOP) and General OR OR Agreement (Giop) to achieve consistency between different manufacturers orb .

Specifically, ORB interoperability refers to a method of using a client application in an ORB that uses OOMG IDL to be implemented in another ORB. The basic conditions for achieving interoperability are:

● There is no need to know the details of the other party between multi-vendor ORBs;

● Each ORB must implement all the content defined in its specification;

● Reserve the implementation of each ORB independent service.

The implementation of inter-ORB interoperability has greatly enriched the connotation of distributed programming ideas, making it possible to construct distributed applications based on the entire Internet.

By introducing in-line bridging and request-level bridging in CORBA, the ORB can implement inter-ORB interoperability in the case where the other OR BRIDGING is not needed.

The bridge mode between the two ORBs above is just a virtual connection mode when the ORB is transmitted. In order to implement communication between ORBs, two protocols for communicating between different vendors orbs are defined in the CORBA specification, namely, universal ORB Inter-ORTOCOL, GIOPs, and environment-related ORB interconnection protocols. (Environment-Specific Inter-ORB Protocol, ESIP). These two protocols shield the operating system type, realize language and specific manufacturers. As long as the ORB supports the protocol, communication can be implemented between different ORBs.

1. General ORB Interoperability Agreement (Giop)

A connection-oriented interoperability defined in CORBA is a universal ORB interconnection protocol (General Inter_orb Protocol, Giop). In the CORBA specifications, the protocol is just a framework, which has left sufficient space to the user in the specific implementation process. The Giop specification includes the following:

● The definition of common data representation (CDR): This data defines a binary data type that can be understood by bridges that map the OMG IDL data type into ORBs.

● Giop Message: Seven types of messages for implementing communication between ORBs are defined in the CORBA specification, which are: request, response (reply), requestCancel, request positioning (Locaterequest), Response Location (CloseConnection) and message error (MessageError).

By defining these messages, it is possible to support the positioning of the object, the dynamic activation of the object, and dynamic management of the communication resource can be supported by supporting all functions defined in the CORBA specification between different ORBs.

● Giop Message: Giop Message Transfer is used to specify how to deliver application data and Giop messages in the network. Giop message delivery has the following characteristics: connection, maintain the transmission order of the word throttle, ensuring reliable transmission, the length of the transfer content is independent, reaching the initialization performance of the TCP / IP protocol specification.

The Giop Interoperability Protocol specifies the way to implement ORB interoperability in the network. The Giop protocol also has an image relative to the specific network protocol type, most typical is the implementation of Giop in the TCP / IP protocol: Based on Internet OR-ORB Protocol, IIOP. The IIOP specification inherits all the contents of the Giop specification and adds the following elements: ● Open the TCP / IP connection;

● Use the connection to implement the Giop message delivery.

You can understand the IIOP protocol: In the premise of complying with the public data representation and message format definition, the TCP / IP protocol is implemented in the transmission method of the GIOP message.

2. Environment-related ORB interoperability protocol

Another ORB intercaocal protocol defined in the CORBA specification is an environment-related ORB inter-ORB Protocol, ESIOP, which specifies inter-ORB interconnection in a specific application environment. The way. Since the protocol has a close relationship with a distributed application environment, the protocol has a large change in different implementations and application methods, so that the ESIP-based specific environmental protocol is an ORB interoperability protocol.

The most representative of the ESIOP protocol, and also clearly illustrates the public ORB interoperability in the distributed computing environment in the CORBA specification (Distributed Computing Environment Common Inter-ORB Protocol, DCE-CIOP). In this protocol, the representation of the data is identical to the foregoing Giop protocol, but in the definition of the message, in the transmission method, the Locate and Invoke method in the remote method call (RPC) are used to implement the message to parameters In form in form, thereby achieving interoperability between ORBs.

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

New Post(0)