Beruflich Dokumente
Kultur Dokumente
• CORBA
– Common Object Request Broker Architecture
• Allows programs written in various languages to
communicate with each other as would two
processes in the same address space.
• Features leveraged by clients:
– Invocation transparency
– Implementation transparency
– Location transparency
• IDL
– Interface Definition Language
• a pure description language.
– enables developers to describe an interface they wish to use
remotely in a language-independent fashion.
• language specific compiler required for each
participating language.
– creates files required by each language for CORBA related
tasks.
• Components of Interoperability
– Object reference pointing to a remote object.
• comes from an object adapter
• information contained:
1. location (network address)
2. reference to the adapter that created object reference
3. object ID
– Parsing object reference to transmit
• GIOP
– Defines messages needed by ORBs to communicate with
each other.
– IIOP (Internet Inter-ORB Protocol)-GIOP implementation.
Line 4
denote single line comments module keyword maps given
name to a Java package Lines 4, 10
curly braces denote scope
boundaries of block semicolon identifies end of Lines 9-10
block
Line 7
server type from client’s perspective
and return type - maps to Java
long ( single long maps to
server implemented interface
Java int)
6. run client
java com.deitel.advjhtp1.idl.clock.SystemClockClient
-ORBInitialPort 1050
c a ll p a th in re a lity
C lie n t Se rve r
ORB ORB
Clie n ts Se rv a n ts
ORB
Fig. 26.8 ORB request-interface structure. Courtesy of Object Management Group, Inc.
9. Query Service
10. Licensing Service
11. Property Service
12. Time Service
13. Security Service
14. Notification Service
15. Trader Service
16. Collections Service
7. Transportation
8. Life Science Research
9. Utilities
10. C4I (Command, Control, Communications, Computers, and
Intelligence)
11. Space
O b je c t Re q u e st Bro ke r
Ob je c t Se rv ic e s
G e n e ra l se rvic e in te rfa c e s
IDL J a va
module package
interface interface
struct class
const public static final
boolean boolean
char char
wchar wchar
octet octet
string java.lang.String
wstring java.lang.String
short short
unsigned short short
long int
unsigned long int
long long long
unsigned long long long
float float
double double
fixed (not supported in idlj) java.math.BigDecimal
sequence [] (array)
[] (array) [] (array)
Fig . 26.9 IDL ke yw o rd s, typ e s a n d th e ir m a p p in g s to J a va ke yw o rd s.
Line 51
2002 Prentice Hall.
All rights reserved.
1 package maptest; Outline
2
3
4 /**
5 * maptest/StructMap.java Fig. 26.11 IDL-
6 * Generated by the IDL-to-Java compiler (portable), version "3.0" generated file
7 * from maptest.idl StructMap.java
8 * Monday, May 14, 2001 4:18:09 PMcannot
PDT inherit from this class
9 */
10 Line 33
11
12 // This comment appears in the generated files for StructMap
13 public final class StructMap implements Lines 12, 17
14 org.omg.CORBA.portable.IDLEntity
comments appearing in IDL file
15 { Line 13
16
17 // This comment appears at start of the type declarations
18 public boolean boolValue = false;
19 public char charValue = ( char ) 0;
20 public char wCharValue = ( char ) 0;
21 public byte octetValue = ( byte ) 0;
22 public String stringValue = null;
23 public String wStringValue = null;
24 public short shortValue = ( short ) 0;
25 public short uShortValue = ( short ) 0;
26 public int longValue = ( int ) 0;
27 public int uLongValue = ( int ) 0;
28 public long longLongValue = ( long ) 0;
29 public long uLongLongValue = ( long ) 0;
30 public float floatValue = ( float ) 0;
31 public double doubleValue = ( double ) 0;
32
33 public StructMap () default constructor-all fields
34 { initialized to 0,
false, or null
2002 Prentice Hall.
35 } // ctor
All rights reserved.
36 Outline
37 public StructMap( boolean _boolValue, char _charValue,
38 char _wCharValue, byte _octetValue, String _stringValue,
39 String wStringValue, short _shortValue,
40 short _uShortValue, int _longValue, int _uLongValue, Fig. 26.11 IDL-
41 long _longLongValue, long _uLongLongValue, generated file
42 float _floatValue, double _doubleValue ) StructMap.java
43 {
44 boolValue = _boolValue;
45 charValue = _charValue;
46 wCharValue = _wCharValue;
47 octetValue = _octetValue;
48 stringValue = _stringValue;
49 wStringValue = _wStringValue;
50 shortValue = _shortValue;
51 uShortValue = _uShortValue;
52 longValue = _longValue;
53 uLongValue = _uLongValue;
54 longLongValue = _longLongValue;
55 uLongLongValue = _uLongLongValue;
56 floatValue = _floatValue;
57 doubleValue = _doubleValue;
58 } // ctor
59
60 } // class StructMap
1. registerClient( this )
Clie n t Se rve r
2. clent.endMessage()
C lie n t a n d se rve r a re n o w d e a d lo c ke d .
Fig. 26.14 Deadlock caused by client calling a server that calls the client.
Fig. 26.18
AlarmClockClient
is the AlarmClock
client.
Line 7
Ke yw o rd s sp e c ific to valuetypes
valuetype
private
public
factory
custom
supports
truncatable
Fig . 26.28 Ke yw o rd s sp e c ific to valuetypes.