Chapter 20 corba fm



Download 234.39 Kb.
View original pdf
Page15/28
Date06.12.2022
Size234.39 Kb.
#60082
1   ...   11   12   13   14   15   16   17   18   ...   28
Chapter 20 CORBA
Soft computing Lab Mannual, Distributed systems
IDL interfaces
◊ As we have seen, an IDL interface describes the methods that are available in CORBA objects that implement that interface. Clients of a CORBA object maybe developed just from the knowledge of its IDL interface. From a study of our examples, readers will see that an interface defines a set of operations and attributes and generally depends on a set of types defined with it. For example, the PersonList interface in Figure 5.2 defines an attribute and three methods and depends on the type Person.

CHAPTER 20
CORBA CASE STUDY
IDL methods
◊ The general form of a method signature is:
[oneway] (parameter, parameterL)
[raises (except, exceptN)] context (name, nameM)]
where the expressions in square brackets are optional. For an example of a method signature that contains only the required parts, consider:
void getPerson(in string name, out Person p);
As explained in the introduction to Section 20.2, the parameters are labelled as in, out
or inout, where the value of an in parameter is passed from the client to the invoked
CORBA object and the value of an out parameter is passed back from the invoked
CORBA object to the client. Parameters labelled as inout are seldom used, but they indicate that the parameter value maybe passed in both directions. The return type maybe specified as void if no value is to be returned.
The optional oneway expression indicates that the client invoking the method will not be blocked while the target object is carrying out the method. In addition, oneway
invocations are executed once or not at all – that is, with maybe invocation semantics.
We saw the following example in Section 20.2.1:
oneway void callback(in int version);
In this example, where the server calls a client each time anew shape is added, an occasional lost request is not a problem to the client, because the call just indicates the latest version number and subsequent calls are unlikely to be lost. The optional raises expression indicates user-defined exceptions that can be raised to terminate an execution of the method. For example, consider the following example from Figure 20.1:
exception FullException{ };
Shape newShape(in GraphicalObject g) raises (FullException);
The method newShape specifies with the raises expression that it may raise an exception called FullException, which is defined within the ShapeList interface. In our example,

Download 234.39 Kb.

Share with your friends:
1   ...   11   12   13   14   15   16   17   18   ...   28




The database is protected by copyright ©ininet.org 2024
send message

    Main page