08 - Middleware - RWTH Aachen University€¦ · • A (raw) abstract object model • An interface...
Transcript of 08 - Middleware - RWTH Aachen University€¦ · • A (raw) abstract object model • An interface...
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
26
Ch
ap
ter
8:
Mid
dle
ware
CO
RB
A
•D
istr
ibut
ed o
bjec
t-ba
sed
syst
em
•C
omm
on O
bjec
t Req
uest
Bro
ker
Arc
hite
ctur
e (C
OR
BA
) •
CO
RB
A is
a s
peci
ficat
ion
of a
dis
trib
uted
sys
tem
. The
re a
re n
o su
gges
tions
mad
e ab
out t
he im
plem
enta
tion
of th
e m
iddl
ewar
e its
elf
•T
hese
spe
cific
atio
ns h
ave
been
dra
wn
up b
y th
e O
bjec
t Man
agem
entG
roup
(O
MG
), a
non
-pro
fit o
rgan
isat
ion
with
mor
e th
an 8
00 m
embe
rs•
Goa
ls:
�m
ake
bette
r us
e of
dis
trib
uted
sys
tem
s�
use
obje
ct-o
rient
ed p
rogr
amm
ing
�de
fine
a di
strib
uted
sys
tem
that
cou
ld o
verc
ome
man
y of
the
inte
rope
rabi
lity
prob
lem
s w
ith in
tegr
atin
g ne
twor
ked
appl
icat
ions
•C
ore
com
pone
nt: t
he o
bjec
t req
uest
bro
ker
(OR
B),
a 's
oftw
are
bus'
for
enab
ling
and
man
agin
g co
mm
unic
atio
n
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
27
Ch
ap
ter
8:
Mid
dle
ware
CO
RB
A
•N
o im
plem
enta
tion
guid
elin
es w
ere
mad
e, b
ut m
any
orga
nisa
tions
thou
ght t
hat
CO
RB
A w
ould
be
a go
od p
rodu
ct:
�La
rge
set o
f opt
ions
to d
efin
e ev
ery
aspe
ct o
f a d
istr
ibut
ed s
yste
m�
Com
petit
ion:
fast
impl
emen
tatio
ns to
be
first
-on-
the-
mar
ket
�P
oor
perf
orm
ance
due
to fa
st im
plem
enta
tion
and
larg
e se
t of s
peci
fied
optio
ns�
In th
e fir
st v
ersi
ons:
inco
mpa
tibili
ties
betw
een
impl
emen
tatio
nsof
diff
eren
t ve
ndor
s
�P
robl
ems
with
the
spec
ifica
tion
lead
to n
ew s
peci
ficat
ions
, for
cing
ven
dors
to
re-b
uild
thei
r im
plem
enta
tions
�R
e-bu
ildin
g im
plem
enta
tions
lead
to r
e-de
sign
of t
he d
evel
oper
s so
ftwar
e
•T
oday
, lot
of d
iffer
ent i
mpl
emen
tatio
ns e
xist
, e.g
.�
Com
mer
cial
: Orb
ix, V
isiB
roke
r, …
�F
reew
are:
MIC
O, O
mni
OR
B, .
..�
Inte
grat
ed: e
.g. J
ava-
OR
B
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
28
Ch
ap
ter
8:
Mid
dle
ware
Co
mp
on
ents
of
the
CO
RB
A
Fra
mew
ork
CO
RB
A s
peci
fies.
..•
A (
raw
) ab
stra
ct o
bjec
t mod
el
•A
n in
terf
ace
defin
ition
lang
uage
(ID
L)•
Map
ping
from
IDL
to d
iffer
ent p
rogr
amm
ing
lang
uage
s: A
da, C
, C+
+,
CO
BO
L, J
ava,
Lis
p, P
ytho
n, S
mal
lTal
k, …
•A
rep
osito
ry fo
r m
anag
ing
IDL
spec
ifica
tions
•T
he O
RB
as
com
mun
icat
ion
infr
astr
uctu
re
•A
com
mun
icat
ion
prot
ocol
(G
IOP
/IIO
P),
toge
ther
with
a tr
ansf
er s
ynta
x an
d m
essa
ge fo
rmat
s•
A c
lient
inte
rfac
e to
the
OR
B (
prox
y)
•A
ser
ver
inte
rfac
e to
the
OR
B (
skel
eton
)•
Inte
rope
rabi
lity
with
oth
er s
tand
ards
, e.g
. DC
OM
•S
ervi
ces
supp
ortin
g m
anag
emen
t and
use
of d
istr
ibut
ed a
pplic
atio
ns:
Nam
ing,
Tra
nsac
tions
, ...
•…
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
29
Ch
ap
ter
8:
Mid
dle
ware
CO
RB
A A
rch
itec
ture
•R
efer
ence
mod
el c
onsi
sts
of fo
urco
mpo
nent
s
�T
heO
bjec
t Req
uest
Bro
ker
(OR
B)
as c
omm
unic
atio
n in
fras
truc
ture
�C
OR
BA
serv
ices
as u
sefu
l ser
vice
s fo
r al
l dis
trib
uted
app
licat
ions
�C
OR
BA
faci
litie
sas
add
ition
al s
ervi
ces
used
by
som
e ap
plic
atio
ns
�A
pplic
atio
n O
bjec
tsas
the
dist
ribut
ed a
pplic
atio
ns im
plem
ente
d by
a
prog
ram
mer
for
its s
peci
al p
urpo
ses
Ap
plic
atio
n O
bje
cts
CO
RB
Ase
rvic
es
...
Nam
ing
Tra
din
g
Eve
nt
Sec
urity
No
tific
atio
nLife
Cyc
le
CO
RB
Afa
cilit
ies
Ve
rtic
al
Ho
rizo
nta
l
Ob
ject
Req
ues
t B
rok
er
Ap
plic
atio
n O
bje
cts
CO
RB
Ase
rvic
es
...
Nam
ing
Tra
din
g
Eve
nt
Sec
urity
No
tific
atio
nLife
Cyc
le
CO
RB
Afa
cilit
ies
Ve
rtic
al
Ho
rizo
nta
l
Ob
ject
Req
ues
t B
rok
er
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
30
Ch
ap
ter
8:
Mid
dle
ware
CO
RB
A C
om
po
nen
tsO
bjec
t Req
uest
Bro
ker
•C
ore
of a
ny C
OR
BA
sys
tem
•R
espo
nsib
le fo
r en
ablin
g ba
sic
(syn
chro
nous
!) c
omm
unic
atio
n be
twee
n ob
ject
s an
d th
eir
clie
nts
whi
le h
idin
g is
sues
rel
ated
to d
istr
ibut
ion
and
hete
roge
neity
CO
RB
Ase
rvic
es•
Set
of b
asic
ser
vice
s (u
sed
by m
any
appl
icat
ions
) su
ppor
ting
a pr
ogra
mm
er in
co
nstr
uctin
g a
dist
ribut
ed a
pplic
atio
n an
d su
ppor
ting
the
appl
icat
ion
at r
untim
e•
Exa
mpl
es: N
amin
g, L
ifeC
ycle
, Eve
nt, S
ecur
ity
CO
RB
Afa
cilit
ies
•G
ener
al p
urpo
se h
igh
leve
l ser
vice
s w
ith u
sefu
l fun
ctio
ns n
eede
dby
sev
eral
ap
plic
atio
ns, b
ut w
hich
are
not
nec
essa
ry fo
r ba
sic
func
tioni
ng•
Hor
izon
tal f
acili
ties
(CO
RB
Afa
cilit
ies)
:ser
vice
s th
at a
re in
depe
nden
t of a
n ap
plic
atio
n do
mai
n su
ch a
s us
er in
terf
aces
or
syst
em m
anag
emen
t•
Ver
tical
faci
litie
s (C
OR
BA
dom
ains
):se
rvic
es th
at a
re ta
rget
ed to
a s
peci
fic a
pplic
atio
n do
mai
n su
ch a
s el
ectr
onic
com
mer
ce, b
anki
ng, m
edic
ine,
tele
com
mun
icat
ions
, ...
App
licat
ion
Obj
ects
•N
ot s
tand
ardi
sed,
thes
e ar
e al
l obj
ects
pro
gram
med
by
a us
er fo
ra
spec
ial p
urpo
se
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
31
Ch
ap
ter
8:
Mid
dle
ware
Ob
ject
Mo
del
•C
OR
BA
use
s th
e re
mot
e ob
ject
mod
el w
ith R
MI a
s co
mm
unic
atio
n pr
inci
ple:
us
ed is
mul
ti-la
ngua
ge R
MI
•O
bjec
ts a
nd s
ervi
ces
are
spec
ified
in th
e C
OR
BA
Inte
rfac
e D
efin
ition
Lan
guag
e(C
OR
BA
IDL)
•ID
Lpr
ovid
es p
reci
se s
ynta
x fo
r ex
pres
sing
met
hods
and
thei
r pa
ram
eter
s, b
ut
not t
he s
eman
tics.
By
usin
g ID
L, th
e w
hole
inte
rfac
e of
an
obje
ct is
spe
cifie
d
•T
he C
OR
BA
impl
emen
tatio
n pr
ovid
es c
ompi
lers
to tr
ansl
ate
the
IDL
spec
ifica
tion
into
an
obje
ct w
ith p
roxi
es r
esp.
stu
bs (
clie
nt)
and
skel
eton
s (s
erve
r) fo
r ha
ndlin
g th
e co
mm
unic
atio
n. T
he p
rogr
amm
er o
nly
has
to s
peci
fy
the
appl
icat
ion-
spec
ific
code
, not
the
com
mun
icat
ion
mec
hani
sm
•It
is n
eces
sary
to p
rovi
de e
xact
rul
es c
once
rnin
g th
e m
appi
ng o
fID
L sp
ecifi
catio
ns to
exi
sitin
gpr
ogra
mm
ing
lang
uage
s (C
, C+
+, J
ava,
Sm
allta
lk,
Ada
and
Cob
ol)
•E
ach
obje
ct is
'nam
ed' b
y an
uni
que
obje
ct r
efer
ence
•T
he te
rm C
OR
BA
obj
ecti
s us
ed to
ref
er to
rem
ote
obje
cts.
A C
OR
BA
obj
ect
impl
emen
ts a
n ID
L in
terf
ace,
has
a r
emot
e ob
ject
ref
eren
ce a
nd it
s m
etho
ds
can
be in
voke
d re
mot
ely
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
32
Ch
ap
ter
8:
Mid
dle
ware
Co
mp
aris
on
to
DC
OM
•D
CO
M g
ener
ates
bin
ary
inte
rfac
es
•C
OR
BA
gen
erat
es la
ngua
ge-d
epen
dent
stub
s
•O
ne s
peci
ficat
ion
of a
n in
terf
ace
•R
e-us
e of
the
spec
ifica
tion
•A
new
spe
cific
atio
n fo
r ea
ch m
appi
ng to
a
prog
ram
min
g la
ngua
ge
•S
epar
ate
tran
slat
ion
of
the
inte
rfac
e fo
r ea
ch
lang
uage
CO
RB
A
DC
OM
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
33
Ch
ap
ter
8:
Mid
dle
ware
CO
RB
A ID
L
•A
bstr
act i
nter
face
def
initi
on•
IDL
has
the
sam
e le
xica
l rul
es a
s C
++
but
has
add
ition
al k
eyw
ords
to s
uppo
rt
dist
ribut
ion
•T
he g
ram
mar
of I
DL
is a
sub
set o
f AN
SI C
++
with
add
ition
al c
onst
ruct
s to
sup
port
m
etho
d si
gnat
ures
•ID
L pr
ovid
es fa
cilit
ies
for
defin
ing
mod
ules
, int
erfa
ces,
type
s,at
trib
utes
and
met
hod
sign
atur
es
•It
allo
ws
stan
dard
C+
+ p
re-p
roce
ssin
g fa
cilit
ies,
e.g
. #include
for
incl
udin
g ot
her
inte
rfac
e de
finiti
on fi
les
in th
e ne
w fi
le (
inhe
ritan
ce)
•T
hrou
gh a
n in
terf
ace,
onl
y C
OR
BA
dat
a ty
pes
can
be p
asse
d fo
r an
invo
catio
n.
CO
RB
A p
rovi
des
a lo
t of d
ata
type
s, b
ut o
wn
data
type
s w
hich
hav
e to
be
pass
ed
are
to b
e de
fined
toge
ther
with
the
inte
rfac
e sp
ecifi
catio
n•
Not
ice:
poi
nter
s ar
e no
t sup
port
ed!
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
34
Ch
ap
ter
8:
Mid
dle
ware
IDL
Bas
ic T
ypes
Sup
port
of b
asic
key
wor
ds a
nd d
ata
type
s:
any
default
inout
out
switch
attribute
double
interface
raises
TRUE
boolean
enum
long
readonly
typedef
case
exception
module
sequence
unsigned
char
FALSE
Object
short
union
const
float
octet
string
void
context
in
oneway
struct
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
35
Ch
ap
ter
8:
Mid
dle
ware
IDL
Def
init
ion
s
IDL
defin
ition
: def
initi
on o
f
•M
odul
esto
gro
up in
terf
ace
defin
ition
s in
to n
ame
spac
esmodule
<M
odul
Nam
e> {
... }
;
•In
terf
aces
as a
cces
s po
ints
to o
bjec
ts. I
nter
face
s ca
n in
herit
from
sev
eral
oth
er
inte
rfac
esinterface
<In
terf
aceN
ame>
{ ..
. };
•C
onst
ants
const
<T
yp>
<C
onst
antN
ame>
= <
Wer
t>
•T
ypes
to g
roup
bas
ic d
ata
type
stypedef
<Typ
eNam
e> ..
.enum
<E
num
Nam
e> {
... }
;struct
<S
truc
tNam
e> {
... }
;
•E
xcep
tions
for
rece
ivin
g O
RB
-spe
cific
or
othe
r (s
elf-
defin
ed)
dist
ribut
ion-
spec
ific
erro
r m
essa
ges
exception
<E
xcep
tionN
ame>
...
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
36
Ch
ap
ter
8:
Mid
dle
ware
IDL
Att
rib
ute
s
•C
ompo
nent
s of
inte
rfac
es
•E
quiv
alen
t to
two
oper
atio
ns: r
ead
and
writ
e an
attr
ibut
e va
lue
•D
efin
ition
:
attribute
<T
ypeI
dent
ifier
> <
Attr
ibut
eNam
e>;
Exa
mpl
e: attribute short x;
•S
peci
al a
ttrib
utes
for
read
-onl
y:readonlyattribute short x;
Mea
ning
: a c
lient
can
't m
odify
the
attr
ibut
e va
lue,
but
the
obje
ct it
self
poss
ibly
ca
n
•T
he ID
L co
mpi
ler
gene
rate
s a
writ
e op
erat
ion
and
a re
ad o
pera
tion
for
such
a
defin
ition
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
37
Ch
ap
ter
8:
Mid
dle
ware
IDL
Met
ho
ds
•S
imila
r to
func
tion
decl
arat
ions
in C
++
•C
onsi
st o
f an
iden
tifie
r fo
r th
e re
sulti
ng ty
pe, o
ne fo
r th
e fu
nctio
n na
me,
and
a li
st
of id
entif
iers
for
argu
men
ts
short operation(in short arg1, in short arg2);
•O
ptio
nal:
onew
ay(t
he c
lient
get
s no
res
pons
e)oneway
void operation(in char arg);
•O
ptio
nal:
Exc
eptio
ns (
for
catc
hing
err
or m
esss
ages
)void operation(out short arg2) raises (Except);
•A
rgum
ents
: diff
eren
tiatio
n be
twee
n th
ree
type
s:
�in
for
para
met
ers
only
use
d to
pas
s in
form
atio
n to
the
obje
ct
�out
for
para
met
ers
only
use
d to
giv
e ba
ck a
res
ult t
o th
e cl
ient
�inout
for
para
met
ers
used
in b
oth
dire
ctio
ns
•G
ener
al m
etho
d si
gnat
ure:
[oneway] <return_type> <method_name> (parameter1,...,parameterL)
[raises (except1,..., exceptN)] [context (name1,..., nameM)]
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
38
Ch
ap
ter
8:
Mid
dle
ware
Dat
a T
ypes
•B
asic
typ
esAny char float
Object short void unsigned short
boolean
double long
octet string unsigned long
-boolean
: def
ined
val
ues
TR
UE
, FA
LSE
-char
: 1 B
yte.
-octet
: sim
ilar
to char
, but
with
a c
onst
ant v
alue
-any
: can
con
tain
eac
h co
mbi
natio
n of
oth
er ID
L da
ta ty
pes
-Object
: Int
erfa
ce ty
pe; a
ll in
terf
aces
inhe
rit fr
om th
is ty
pe to
offe
rsp
ecia
l
func
tions
for
bind
ing
or n
ame
reso
lvin
g
•S
tru
cts
-C
ombi
nes
seve
ral d
ata
type
to a
new
one
-E
xam
ple:
struct
structure {
char element1;
short element2;
};
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
39
Ch
ap
ter
8:
Mid
dle
ware
Dat
a T
ypes
Typ
eE
xam
ples
Use
sequ
ence
type
defs
eque
nce
<S
hape
, 100
> A
ll;ty
pede
fseq
uenc
e <
Sha
pe>
All
boun
ded
and
unbo
unde
d se
quen
ces
of S
hape
s
Def
ines
a ty
pe fo
r a
varia
ble-
leng
thse
quen
ce o
f ele
men
ts o
f a s
peci
fied
IDL
type
. An
uppe
r bo
und
on th
ele
ngth
may
be
spec
ified
.
strin
gS
trin
g na
me;
ty
pede
fstr
ing<
8> S
mal
lStr
ing;
un
boun
ded
and
boun
ded
sequ
ence
s of
cha
ract
ers
Def
ines
a s
eque
nces
of c
hara
cter
s,te
rmin
ated
by
the
null
char
acte
r. A
nup
per
boun
d on
the
leng
th m
ay b
esp
ecifi
ed.
arra
yty
pede
foct
et u
niqu
eId[
12];
type
defG
raph
ical
Obj
ectG
O[1
0][8
]D
efin
es a
type
for
a m
ulti-
dim
ensi
onal
fixed
-leng
th s
eque
nce
of e
lem
ents
of
a sp
ecifi
ed ID
L ty
pe.
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
40
Ch
ap
ter
8:
Mid
dle
ware
Dat
a T
ypes
Typ
eE
xam
ples
Use
reco
rdst
ruct
Gra
phic
alO
bjec
t{st
ring
type
;R
ecta
ngle
enc
losi
ng;
bool
ean
isF
illed
;};
Def
ines
a ty
pe fo
r a
reco
rd c
onta
inin
g a
grou
p of
rel
ated
ent
ities
. Str
ucts
are
pass
ed b
y va
lue
in a
rgum
ents
and
resu
lts.
enum
erat
eden
umR
and
(Exp
, Num
ber,
Nam
e);
The
enu
mer
ated
type
in ID
L m
aps
aty
pe n
ame
onto
a s
mal
l set
of i
nteg
erva
lues
.
unio
nun
ion
Exp
sw
itch
(Ran
d) {
case
Exp
: str
ing
vote
;ca
se N
umbe
r: lo
ng n
;ca
se N
ame:
str
ing
s;
The
IDL
disc
rimin
ated
uni
on a
llow
son
e of
a g
iven
set
of t
ypes
to b
e pa
ssed
as a
n ar
gum
ent.
The
hea
der
ispa
ram
eter
ised
by
an e
num
whi
chsp
ecifi
es w
hich
mem
ber
is in
use
.};
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
41
Ch
ap
ter
8:
Mid
dle
ware
IDL
Inte
rfac
es a
nd
Mo
du
les
interface Grid
{readonlyattribute short height;
readonlyattribute short width;
void set(in short n, in short m, in long value);
long get(in short n, in short m);
};
Inte
rfac
es g
roup
all
met
hods
and
par
amet
ers:
…an
d m
odul
es fo
rm a
nam
e sp
ace:
module Whiteboard {
struct
Rectangle{...} ;
struct
GraphicalObject{...};
interface Shape {...};
typedef
sequence <Shape, 100> All;
interface ShapeList{...};
};
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
42
Ch
ap
ter
8:
Mid
dle
ware
CO
RB
A ID
L In
terf
aces
Sh
ape
and
S
hap
eLis
tst
ruct
Rec
tang
le
{lo
ng w
idth
; lo
ng h
eigh
t;lo
ng x
;lo
ng y
;}
;
stru
ctG
raph
ical
Obj
ect
{st
ring
type
; R
ecta
ngle
enc
losi
ng;
bool
ean
isF
illed
;};
inte
rfac
e S
hape
{lo
ng g
etV
ersi
on()
;G
raph
ical
Obj
ectg
etA
llSta
te()
;//
retu
rns
stat
e of
the
Gra
phic
alO
bjec
t}; ty
pede
fseq
uenc
e <
Sha
pe, 1
00>
All;
inte
rfac
e S
hape
List
{ex
cept
ion
Ful
lExc
eptio
n{ }
; S
hape
new
Sha
pe(in
Gra
phic
alO
bjec
tg)
rais
es (
Ful
lExc
eptio
n);
All
allS
hape
s();
// re
turn
s se
quen
ce o
f rem
ote
obje
ct r
efer
ence
slo
ng g
etV
ersi
on()
;};
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
43
Ch
ap
ter
8:
Mid
dle
ware
Par
amet
ers
in C
OR
BA
IDL
•P
assi
ng C
OR
BA
obj
ects
:
–A
ny p
aram
eter
or
retu
rn v
alue
who
se ty
pe is
spe
cifie
d by
the
nam
e of
a
IDL
inte
rfac
e, e
.g. S
hape
, is
a re
fere
nce
to a
CO
RB
A o
bjec
t (se
e ne
wS
hape
)
–an
d th
e va
lue
of a
rem
ote
obje
ct r
efer
ence
is p
asse
d
•P
assi
ng C
OR
BA
prim
itive
and
con
stru
cted
type
s:
–A
rgum
ents
of p
rimiti
ve a
nd c
onst
ruct
ed ty
pes
are
copi
ed a
nd p
asse
d by
va
lue.
On
arriv
al, a
new
val
ue is
cre
ated
in th
e re
cipi
ent’s
pro
cess
. E.g
., th
e st
ruct
Gra
phic
alO
bjec
t(ar
gum
ent o
f new
Sha
pean
d re
sult
of
getA
llSta
te)
•N
ote:
the
met
hod
allS
hape
sre
turn
s an
arr
ay o
f rem
ote
obje
ct r
efer
ence
s as
fo
llow
s: type
defs
eque
nce
<S
hape
, 100
> A
ll;
All
allS
hape
s();
•T
ype
Obj
ect-
is a
sup
erty
peof
all
IDL
inte
rfac
es (
its v
alue
s ar
e ob
ject
re
fere
nces
)
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
44
Ch
ap
ter
8:
Mid
dle
ware
Clie
ntS
erve
r
Clie
ntA
pplic
atio
n(O
bjec
tCod
e)
Ser
ver
App
licat
ion
(Obj
ectC
ode)
IDL
IDL-
Com
pile
r
Clie
nt
Stu
bH
eade
rS
erve
r S
tub
Com
pile
r &
Lin
ker
Com
pile
r &
Lin
ker
Clie
nt-
Cod
eS
erve
r-C
ode
IDL
Co
mp
iler
The
IDL
com
pile
r ge
nera
tes
prog
ram
min
g la
ngua
ge c
onst
ruct
s fr
om th
e in
terf
ace
defin
ition
s:
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
45
Ch
ap
ter
8:
Mid
dle
ware
IDL
Lan
gu
age
Map
pin
g•
Map
ping
of I
DL
defin
ition
s to
dat
a st
ruct
ures
. Her
e: C
++
(ge
nera
ted
code
depe
nds
on C
OR
BA
impl
emen
tatio
n –
here
: onl
y on
e ex
ampl
e, O
rbix
)
•G
ener
ated
: Stu
bs o
f clie
nt a
nd s
erve
r. A
dditi
onal
ly: M
anag
emen
t of d
ynam
ical
ly
allo
cate
d m
emor
y fo
r ID
L da
ta ty
pes
•D
eter
min
atio
n of
how
to e
xecu
te a
n op
erat
ion
call
for
an o
bjec
t ref
eren
ce
Sim
ple
map
ping
rul
es:
module M { ... };
namespace M { ... };
interface I { ... };
class I { ... };
struct
S { ... };
struct
S { ... };
Ver
y si
mpl
e: in
terf
aces
can
be
map
ped
to c
lass
es; b
y th
is, o
bjec
ts to
an
inte
rfac
e ca
n be
inst
antia
ted
easi
ly.
Map
ping
of b
asic
type
s: e
.g.
short
CORBA::Short
unsigned short
CORBA::UShort
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
46
Ch
ap
ter
8:
Mid
dle
ware
IDL
Lan
gu
age
Map
pin
g•
Arg
umen
ts
�T
he m
appi
ng o
f arg
umen
ts d
epen
ds o
n th
eir
usag
e:ID
L:type0 op(in
type1 arg1, inout
type2 arg2, outtype3 arg3);
C+
+:type0 op(type1 arg1,
type2& arg2, type3& arg3);
interface example {
readonly
attribute long ro_value;
attribute long value;
void op(in long in_par, out long out_par);
};
class example : public virtual CORBA::Object {
public:
virtual CORBA::Long ro_value();
virtual CORBA::Long value();
virtual void value(CORBA::Long val);
virtual void op(CORBA::Long in_par,
CORBA::Long& out_par);
};
Not
e: th
e vi
rtua
l cla
ss is
gen
erat
ed
by th
e ID
L co
mpi
ler
and
has
to b
e im
plem
ente
d as
a c
lass
by
the
prog
ram
mer
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
47
Ch
ap
ter
8:
Mid
dle
ware
IDL
Lan
gu
age
Map
pin
gS
trin
gs•
Are
def
ined
as char*
•O
RB
man
ages
mem
ory
for
char
acte
r st
rings
•T
wo
poss
ible
def
initi
ons
of s
trin
g va
riabl
es:
char* string1;
CORBA::String_var
string2;
•O
RB
offe
rs s
ome
func
tions
for
wor
king
with
str
ings
(re
com
men
ded
to u
se th
em):
char* CORBA::string_alloc(CORBA::Ulong
len);
char* CORBA::string_dup(const char*);
char* CORBA::string_free(char*);
Oth
er ty
pes,
e.g
.sequence
•_var
is d
efin
ed a
s ab
ove
(reg
ardi
ng m
emor
y m
anag
emen
t)•
Map
ped
to a
list
, acc
essi
ble
by g
ivin
g th
e in
dex:
IDL:
typedef
sequence<Content> Example
C++:
Example_var
ex_variable;
ex_variable[2] = ...
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
48
Ch
ap
ter
8:
Mid
dle
ware
Wri
tin
g C
lien
t an
d S
ever
usi
ng
th
e ID
L-g
ener
ated
Stu
bs
(Orb
ix)
Def
inin
g t
he
inte
rfac
e•
Spe
cify
the
IDL
defin
ition
in fi
le.id
l•
Use
IDL
com
pile
r to
map
it to
C+
+. G
ener
ally
, som
e st
ub fi
les
like
fileS
.cc
for
serv
er s
tub
and
fileC
.cc
for
clie
nt s
tub
are
gene
rate
d.
Wri
tin
g t
he
ob
ject
imp
lem
enta
tio
n•
Incl
ude
fileS
.cc
(ser
ver
stub
)•
Impl
emen
t the
ope
ratio
ns w
hich
wer
e de
fined
in ID
L
•R
egis
ter
the
serv
er w
ith th
e O
RB
Wri
tin
g t
he
clie
nt
•In
clud
e fil
eC.c
c(c
lient
stu
b)
•Im
plem
ent c
lient
func
tiona
lity,
incl
udin
g op
erat
ion
requ
ests
•B
ind
to th
e se
rver
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
49
Ch
ap
ter
8:
Mid
dle
ware
Sim
ple
Exa
mp
le –
gri
d /
C++
•S
peci
fyin
g th
e in
terf
ace
IDL
// In
file
grid
.idl
interface Grid {
readonly
attribute short height;
readonly
attribute short width;
void set(in short n, in short m, in long value);
long get(in short n, in short m);
};
•C
ompi
ling
the
inte
rfac
e de
finiti
on p
rodu
ces
�grid.hh
(gen
eral
type
info
rmat
ion
for
type
s de
fined
in fi
le.id
l)
�gridC.cc
(clie
nt s
tub)
�gridS.cc
(ser
ver
stub
)
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
50
Ch
ap
ter
8:
Mid
dle
ware
Sim
ple
Exa
mp
le –
gri
d /
C++
•T
he g
rid.h
hfil
e pr
oduc
ed b
y th
e ID
L co
mpi
ler
cont
ains
the
follo
win
g:// Automatically produced (in grid.hh).
class Grid : public virtual CORBA::Object {
public:
virtual CORBA::Short height(CORBA::Environment& IT_env
=
CORBA::default_environment);
virtual CORBA::Short width(CORBA::Environment& IT_env
=
CORBA::default
environment);
virtual void set(CORBA::Short n, CORBA::Short m, CORBA::Long value,
CORBA::Environment& IT_env
=
CORBA::default_environment);
virtual CORBA::Long get(CORBA::Short n, CORBA::Short m,
CORBA::Environment& IT_env
=
CORBA::default_environment);
};
Not
ice:
eac
h cl
ass
inhe
rits
from
the
gene
ral C
OR
BA
ob
ject
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
51
Ch
ap
ter
8:
Mid
dle
ware
Sim
ple
Exa
mp
le –
gri
d /
C++
•(p
artly
) ge
nera
ted
head
er fi
le fo
r yo
ur im
plem
enta
tion
-grid_i.h
#include "grid.hh"
class Grid_i : public virtual GridBOAImpl
{
CORBA::Short m_height;
CORBA::Short m_width;
CORBA::Long** m_a;
public: Grid_i(CORBA::Short h, CORBA::Short w);
// Constructor
virtual ~Grid_i();
// Destructor
virtual CORBA::Short width(CORBA::Environment&);
virtual CORBA::Short height(CORBA::Environment&);
virtual void set(CORBA::Short n, CORBA::Short m,
CORBA::Long value, CORBA::Environment&);
virtual CORBA::Long get(CORBA::Short n, CORBA::Short m,
CORBA::Environment&);
};
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
52
Ch
ap
ter
8:
Mid
dle
ware
Sim
ple
Exa
mp
le –
gri
d /
C++
•Y
our
serv
er im
plem
enta
tion
-grid_i.C
#include "grid_i.h"
Grid_i::Grid_i(CORBA::Short h, CORBA::Short w) : m_height(h), m_width(w) {
m_a = new CORBA::Long*[h];
CORBA::Short i;
for (i = 0; i < h; i++) m_a[i] = new CORBA::Long[w];
} Grid_i::~Grid_i() {
CORBA::Short i;
for (i = 0; i < m_height; i++) delete[] m_a[i];
delete[] m_a;
} CORBA::Short Grid_i::height(CORBA::Environment&) {
return m_height;
} ... // the same for Grid_i::weight
void Grid_i::set(CORBA::Short n, CORBA::Short m, CORBA::Long value,
CORBA::Environment&) {
m_a[n][m] = value;
} CORBA::Long Grid_i::get(CORBA::Short n, CORBA::Short m, CORBA::Environment&) {
return m_a[n][m];
}
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
53
Ch
ap
ter
8:
Mid
dle
ware
Sim
ple
Exa
mp
le –
gri
d /
C++
•P
rovi
ding
the
serv
er -Srv_Main.C
#include "grid_i.h"
#include <iostream.h>
main() {
// We could create any number of objects
// here but we just create one.
Grid_i myGrid(100,100);
// Orbix objects can be explicitly named,
// but this is not required in this simple
// example.
CORBA::Orbix.impl_is_ready("GridSrv");
cout
<< "Server terminating" << endl;
}
Not
e: a
dditi
onal
ly it
is n
eces
sary
now
to m
ake
an e
ntry
for
Grid
Srv
in th
e so
-cal
led
Inte
rfac
e R
epos
itory
whi
ch e
nabl
es a
map
ping
of t
he s
erve
r na
me
to a
n ex
ecut
able
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
54
Ch
ap
ter
8:
Mid
dle
ware
Sim
ple
Exa
mp
le –
gri
d /
C++
•W
ritin
g a
clie
nt -Client.C
#include "grid.hh"
#include <iostream.h>
main() {
Grid_var
gVar;
gVar
= Grid::_bind(":GridSrv");
cout
<< "height is " << gVar->height() << endl;
cout
<< "width is " << gVar->width() << endl;
gVar->set(2,4,123);
cout
<< "Grid[2,4] is "
<< gVar->get(2,4) << endl;
}
Sim
ple
exam
ple
–O
rbix
pro
vide
s a
com
fort
able
bin
d fu
nctio
n. In
oth
er
impl
emen
tatio
ns, y
ou w
ould
hav
e to
wor
k w
ith
obje
ct r
efer
ence
s –
try
on y
our
own
in
exer
cise
5.
Now
: wha
t mak
es a
ll th
at w
ork?
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
55
Ch
ap
ter
8:
Mid
dle
ware
•T
he O
RB
is n
ot a
sin
gle
com
pone
nt, r
athe
r it
is a
ser
vice
exe
cute
d on
eac
h co
mpu
ter
(may
be a
s a
daem
on)
•T
he s
kele
ton
is th
e ge
nera
ted
stub
for
the
serv
er s
ide,
the
gene
rate
d pr
oxy
is
the
stub
for
the
clie
nt s
ide
(impl
emen
ts th
e sa
me
inte
rfac
e as
the
obje
ct th
e cl
ient
is u
sing
). B
oth
stub
s ar
e sp
ecifi
c fo
r th
e cu
rren
t app
licat
ion
and
are
the
only
par
ts th
e cl
ient
res
p. th
e se
rver
see
; the
OR
B is
invi
sibl
e fo
r th
em
Impl
emen
tatio
nR
epos
itory
Inte
rfac
eR
epos
itory
CO
RB
A A
rch
itec
ture
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
56
Ch
ap
ter
8:
Mid
dle
ware
CO
RB
A A
rch
itec
ture
OR
B s
ervi
ces
(fro
m th
e pe
rspe
ctiv
e of
a p
roce
ss):
•T
he O
RB
is o
fferin
g a
few
func
tions
by
itsel
f:1.
Man
ipul
atin
g ob
ject
ref
eren
ces
(mar
shal
and
unm
arsh
alob
ject
ref
eren
ces
to
exch
ange
them
bet
wee
n pr
oces
ses,
com
parin
g ob
ject
ref
eren
ces)
2.F
indi
ng th
e se
rvic
es th
at a
re a
vaila
ble
to a
pro
cess
(an
initi
alre
fere
nce
to a
n ob
ject
impl
emen
ting
a sp
ecifi
c C
OR
BA
ser
vice
, in
gene
ral a
nam
ing
serv
ice)
Obj
ect A
dapt
er
•B
ridge
s th
e ga
p be
twee
n C
OR
BA
obj
ects
with
IDL
inte
rfac
es a
nd th
e pr
ogra
mm
ing
lang
uage
inte
rfac
es o
f the
cor
resp
ondi
ng s
erve
r •
Cre
ates
obj
ect r
efer
ence
s fo
r C
OR
BA
obj
ects
•E
ach
activ
e C
OR
BA
obj
ect i
s re
gist
ered
with
its
obje
ct a
dapt
er, w
hich
kee
ps a
re
mot
e ob
ject
tabl
e to
map
nam
es o
f CO
RB
A o
bjec
ts to
ser
vers
•
Res
pons
ible
for
disp
atch
ing
inco
min
g re
ques
ts v
ia a
ske
leto
n to
the
addr
esse
d ob
ject
•P
ossi
bly
has
to a
ctiv
ate
an o
bjec
t whe
n a
requ
est c
omes
in
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
57
Ch
ap
ter
8:
Mid
dle
ware
Po
rtab
le O
bje
ct A
dap
ter
Obj
ect a
dapt
er
•Im
plem
ents
an
activ
atio
n po
licy
for
a gr
oup
of o
bjec
ts (
sing
le th
read
, m
ultit
hrea
ding
, ...)
•R
espo
nsib
le fo
r pr
ovid
ing
a co
nsis
tent
imag
e of
wha
t an
obje
ct•
Ada
pts
a pr
ogra
m s
uch
that
clie
nts
can
see
the
prog
ram
as
an o
bjec
t
Por
tabl
e O
bjec
t Ada
pter
(P
OA
)•
Ser
ver-
side
cod
e ca
n be
writ
ten
inde
pend
ently
of s
peci
fic O
RB
-it
is p
orta
ble
in
mea
ns o
f OR
Bs
from
diff
eren
t ven
dors
•A
ssum
es: o
bjec
t im
plem
enta
tions
are
par
tly p
rovi
ded
by s
erva
nts
-th
e pa
rt o
f an
obje
ct th
at im
plem
ents
the
met
hods
that
clie
nts
can
invo
ke. S
erva
nts
are
prog
ram
min
g-la
ngua
ge d
epen
dent
•E
ach
PO
A o
ffers
the
follo
win
g op
erat
ion:
Objectld
activate_object(in
Servant p_servant);
•T
his
oper
atio
n ta
kes
a po
inte
r to
a s
erva
nt a
s in
put p
aram
eter
and
ret
urns
a
CO
RB
A o
bjec
t ide
ntifi
er a
s a
resu
lt•
No
univ
ersa
l def
initi
on o
f typ
e se
rvan
t; it
is m
appe
d to
a la
ngua
ge d
epen
dent
dat
a ty
pe•
The
ret
urne
d ObjectId
is a
n in
dex
into
the
PO
A's
Act
ive
Obj
ect M
ap
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
58
Ch
ap
ter
8:
Mid
dle
ware
Dyn
amic
Invo
cati
on
s
Dyn
amic
Invo
catio
n In
terf
ace
(DII)
/ Dyn
amic
Ske
leto
n In
terf
ace
(DS
I)•
The
re a
re o
ccas
ions
in w
hich
sta
tical
ly d
efin
ed in
terf
aces
are
sim
ply
not a
vaila
ble
to a
clie
nt, i
nste
ad it
has
to fi
nd o
ut w
hat i
t nee
ds d
urin
g ru
ntim
e
•D
SI a
nd D
II ar
e pr
ovid
ing
gene
ric in
terf
aces
for
send
ing/
rece
ivin
g ea
ch r
eque
st,
inde
pend
ent o
f spe
cific
pro
xies
and
ske
leto
ns
•E
.g. u
sed
for
impl
emen
ting
gate
way
s to
ach
ieve
inte
rope
rarb
ility
betw
een
diffe
rent
pla
tform
s, e
.g. C
OR
BA
and
DC
OM
•R
equi
red
know
ledg
e: w
hat d
oes
the
inte
rfac
e to
a s
peci
fic o
bjec
tloo
ks li
ke?
•S
ubse
quen
tly c
ompo
se a
n in
voca
tion
requ
est f
or th
at o
bjec
t
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
59
Ch
ap
ter
8:
Mid
dle
ware
Dyn
amic
Inte
rfac
es
Wha
t doe
s D
II do
?•
CO
RB
A o
ffers
DII
to c
lient
s, w
hich
allo
ws
them
to c
onst
ruct
an
invo
catio
n re
ques
t at
run
time
•It
prov
ides
a g
ener
ic in
voke
ope
ratio
n, w
hich
take
s •
(1)
an o
bjec
t ref
eren
ce,
•(2
) a
met
hod
iden
tifie
r, a
nd•
(3)
a lis
t of i
nput
val
ues
as p
aram
eter
s.
•T
hese
info
rmat
ion
are
mar
shal
led
into
a r
eque
st a
nd s
end
to a
n ob
ject
•La
ter
it re
turn
s th
e re
sult
in a
list
of o
utpu
t var
iabl
es p
rovi
ded
by th
e ca
ller
Wha
t doe
s D
SI d
o?•
In th
e sa
me
way
, a s
erve
r ob
ject
has
a D
SIw
hich
is a
ble
to r
ecei
ve a
ny
requ
est a
nd d
ecom
pose
it in
to o
bjec
t ref
eren
ce, m
etho
d id
entif
ier
and
para
met
ers.
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
60
Ch
ap
ter
8:
Mid
dle
ware
Inte
rfac
e R
epo
sito
ry
How
to fi
nd in
form
atio
n ab
out i
nter
face
s to
con
stru
ct a
dyn
amic
req
uest
? F
or th
is,
the
Inte
rfac
e R
epos
itory
is n
eede
d.•
Sto
res
all i
nter
face
def
initi
ons
•O
ften
impl
emen
ted
by m
eans
of a
sep
arat
e pr
oces
s of
ferin
g a
stan
dard
inte
rfac
e to
sto
re a
nd r
etrie
ve in
terf
ace
defin
ition
s•
Can
be
view
ed a
s th
e pa
rt o
f CO
RB
A th
at a
ssis
ts in
run
time
type
che
ckin
g fa
cilit
ies
•W
hene
ver
an in
terf
ace
defin
ition
is c
ompi
led,
the
IDL
com
pile
r as
sign
s a
repo
sito
ry id
entif
ier
to th
at in
terf
ace
•T
he r
epos
itory
ID c
an b
e us
ed to
ret
rieve
an
inte
rfac
e de
finiti
on fr
om th
e re
posi
tory
•B
y de
faul
t it i
s de
rived
from
the
nam
e of
the
inte
rfac
e an
d its
met
hods
(no
gu
aran
tees
are
giv
en w
ith r
espe
ct to
its
uniq
uene
ss)
•B
ecau
se in
terf
ace
info
rmat
ion
are
stor
ed in
IDL,
it is
pos
sibl
e to
str
uctu
re e
ach
inte
rfac
e re
posi
tory
in th
e sa
me
way
. The
inte
rfac
e re
posi
torie
sin
CO
RB
A a
ll of
fer
the
sam
e op
erat
ions
for
navi
gatin
g th
roug
h in
terf
ace
defin
ition
s
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
61
Ch
ap
ter
8:
Mid
dle
ware
Imp
lem
enta
tio
n R
epo
sito
ry
How
to a
ssig
n ob
ject
ref
eren
ces
with
rea
l file
s?•
CO
RB
A s
yste
ms
offe
r an
Impl
emen
tatio
n re
posi
tory
•C
onta
ins
all t
hat i
s ne
eded
to im
plem
ent,
regi
ster
and
act
ivat
e ob
ject
s, a
s w
ell a
s lo
catin
g ru
nnin
g se
rver
s•
Sto
res
a m
appi
ng o
f the
nam
es o
f obj
ect a
dapt
ers
to th
e fil
e co
ntai
ning
the
obje
ct
impl
emen
tatio
n•
Suc
h fu
nctio
nalit
y is
rel
ated
to th
e O
RB
(an
d its
impl
emen
tatio
n) it
self
as w
ell a
s to
the
unde
rlyin
g op
erat
ing
syst
em. F
or th
is, i
t is
diffi
cult
topr
ovid
e a
stan
dard
im
plem
enta
tion
for
each
CO
RB
A s
yste
m.
•M
ainl
y us
ed b
y an
obj
ect a
dapt
er, w
hich
is r
espo
nsib
le fo
r di
spat
chin
g a
requ
est
to th
e rig
ht o
bjec
t. If
this
obj
ect i
sn't
runn
ing
in th
e ad
dres
ssp
ace
of a
ser
ver,
the
obje
ct a
dapt
er c
ould
con
tact
the
impl
emen
tatio
n re
posi
tory
to fi
nd o
ut w
hat n
eeds
to
be
done
: map
the
obje
ct r
efer
ence
to a
bin
ary
file,
sta
rt th
is fi
le a
s a
CO
RB
A
serv
er in
a s
peci
fic w
ay, …
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
62
Ch
ap
ter
8:
Mid
dle
ware
Co
mm
un
icat
ion
in C
OR
BA
Sim
ple
com
mun
icat
ion
mod
el: o
nly
sync
hron
ous
com
mun
icat
ion
(But
: with
the
time,
som
e in
voca
tion
faci
litie
s w
ere
adde
d to
this
mod
el)
Obj
ect i
nvoc
atio
n m
odel
:
•W
hen
a cl
ient
invo
kes
an o
bjec
t, it
send
s a
requ
est t
o th
e co
rres
pond
ing
obje
ct
serv
er a
nd b
lock
s un
til it
rec
eive
s a
resp
onse
. The
se s
eman
tics
corr
espo
nd
exac
tly to
a n
orm
al m
etho
d in
voca
tion
whe
n th
e ca
ller
and
calle
ere
side
in th
e sa
me
addr
ess
spac
e.
•In
the
pres
ence
of f
ailu
res,
a c
lient
will
rec
eive
an
exce
ptio
n in
dica
ting
that
the
invo
catio
n di
d no
t ful
ly c
ompl
ete.
One
-way
req
uest
: •
Pro
blem
with
syn
chro
nous
com
mun
icat
ion:
if th
e cl
ient
doe
s no
t get
bac
k a
resu
lt,
it is
blo
cked
unn
eces
saril
y•
Sol
utio
n: a
form
of i
nvoc
atio
n, in
whi
ch n
o re
sult
is e
xpec
ted.
The
clie
nt is
n't
bloc
ked,
but
it h
as n
o gu
aran
tees
that
the
requ
est i
s de
liver
ed
Def
erre
d sy
nchr
onou
s co
mm
unic
atio
n:
•O
ne-w
ay r
eque
sts
are
used
by
a cl
ient
to m
ake
a re
ques
t and
by
a se
rver
to p
ass
back
the
resu
lt
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
63
Ch
ap
ter
8:
Mid
dle
ware
Inte
rop
erab
ility
CO
RB
A o
nly
spec
ifies
func
tiona
litie
s, n
ot im
plem
enta
tion
issu
es.
•E
ach
vend
or o
f a C
OR
BA
impl
emen
tatio
n ha
d hi
s ow
n w
ay o
f ena
blin
g co
mm
unic
atio
n be
twee
n cl
ient
s an
d ob
ject
ser
vers
as
wel
l as
refe
renc
ing
obje
cts
→la
ck o
f int
erop
erab
ility
•T
his
prob
lem
was
sol
ved
by th
e
Gen
eral
Inte
r-O
RB
Pro
toco
l (G
IOP
)•
Sta
ndar
d pr
otoc
ol fo
r co
mm
unic
atio
n in
CO
RB
A•
Bui
lds
upon
a r
elia
ble,
con
nect
ion
orie
nted
tran
spor
t pro
toco
l
•S
peci
fies
mes
sage
type
s, a
'Com
mon
Dat
a R
epre
sent
atio
n' (
CD
R)
astr
ansf
er
synt
ax, i
nter
oper
able
obj
ect r
efer
ence
s (I
OR
s), a
nd m
ore
Inte
rnet
Inte
r-O
RB
Pro
toco
l (IIO
P)
•T
he r
ealis
atio
n of
GIO
P r
unni
ng o
n to
p of
TC
P•
Not
the
only
com
mun
icat
ion
prot
ocol
impl
emen
ted,
but
the
wid
est u
sed
one
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
64
Ch
ap
ter
8:
Mid
dle
ware
Mes
sag
e T
ypes
Par
t (fr
agm
ent)
of a
larg
er m
essa
geB
oth
Fra
gmen
t
Con
tain
s in
form
atio
n on
an
erro
rB
oth
Mes
sage
Err
or
Indi
catio
n th
at c
onne
ctio
n w
ill b
e cl
osed
Bot
hC
lose
Con
nect
ion
Indi
cate
s cl
ient
no
long
er e
xpec
ts a
rep
lyC
lient
Can
celR
eque
st
Con
tain
s lo
catio
n in
form
atio
n on
an
obje
ctS
erve
rLo
cate
Rep
ly
Con
tain
s a
requ
est o
n th
e ex
act l
ocat
ion
of a
n ob
ject
Clie
ntLo
cate
Req
uest
Con
tain
s th
e re
spon
se to
an
invo
catio
nS
erve
rR
eply
Con
tain
s an
invo
catio
n re
ques
tC
lient
Req
uest
Des
crip
tio
nO
rig
inat
or
Mes
sag
e ty
pe
GIO
P (
and
thus
IIO
P o
r an
y ot
her
real
isat
ion
of G
IOP
) kn
ows
eigh
t diff
eren
t m
essa
ge ty
pes:
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
65
Ch
ap
ter
8:
Mid
dle
ware
Ob
ject
Ref
eren
ces
•A
clie
nt n
eeds
an
obje
ct r
efer
ence
to in
voke
a m
etho
d at
an
obje
ct•
A c
lient
res
p. a
ser
ver
uses
a la
ngua
ge s
peci
fic im
plem
enta
tion
of a
n ob
ject
re
fere
nce
-in
mos
t cas
es th
is is
a p
oint
er to
a lo
cal r
epre
sent
atio
n of
the
obje
ct
•T
hat r
efer
ence
can
not b
e pa
ssed
from
a p
roce
ss A
to p
roce
ss B
•P
roce
ss A
will
firs
t hav
e to
mar
shal
the
poin
ter
into
a p
roce
ss in
depe
nden
t re
pres
enta
tion
(don
e by
the
OR
B)
•T
he O
RB
use
s an
ow
n, la
ngua
ge-in
depe
nden
t rep
rese
ntat
ion
•P
roce
ss B
unm
arsh
als
it
•W
hen
a pr
oces
s re
fers
to a
n ob
ject
its
unde
rlyin
g O
RB
is im
plic
itly
pass
ed e
noug
h in
form
atio
n to
kno
w w
hich
obj
ect i
s ac
tual
ly b
eing
ref
eren
ced
•C
omm
on r
epre
sent
atio
n of
an
obje
ct r
efer
ence
: Int
erop
erab
le O
bjec
t Ref
eren
ce
(IO
R)
•T
he IO
R is
use
d to
pas
s re
fere
nces
to o
ther
OR
Bs.
Inte
rnal
ly, O
RB
sca
n ha
ve th
eir
own
repr
esen
tatio
n.
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
66
Ch
ap
ter
8:
Mid
dle
ware
Ob
ject
Ref
eren
ces
Org
aniz
atio
n of
an
IOR
with
spe
cific
info
rmat
ion
for
IIOP
:
•T
agge
d P
rofil
e: c
ompl
ete
info
rmat
ion
to in
voke
an
obje
ct. I
f the
obj
ect s
erve
rsu
ppor
ts s
ever
al p
roto
cols
, mul
tiple
tagg
ed p
rofil
es a
re in
clud
ed
•O
bjec
t key
: ser
ver-
spec
ific
info
rmat
ion
for
dem
ultip
lexi
ngin
com
ing
requ
ests
to th
e ob
ject
•C
ompo
nent
s: o
ptio
nally
con
tain
sad
ditio
nal i
nfor
mat
ion
need
ed fo
r in
voki
ng th
e re
fere
nced
obj
ect (
e.g.
sec
urity
info
rmat
ion)
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
67
Ch
ap
ter
8:
Mid
dle
ware
Bin
din
gH
ow d
oes
a cl
ient
bin
d to
an
obje
ct to
invo
ke a
met
hod?
•U
se a
nam
e se
rvic
e to
res
olve
a g
iven
nam
e to
an
obje
ct r
efer
ence
(IO
R)
•B
ecau
se th
is IO
R r
efer
ence
s di
rect
ly to
an
obje
ct, t
he fo
llow
ing
is c
alle
d di
rect
bi
ndin
g•
The
clie
nt's
OR
B u
ses
the
repo
sito
ry ID
to p
lace
a p
roxy
at t
he c
lient
and
pas
s a
poin
ter
to th
is p
roxy
on
to th
e cl
ient
•T
he O
RB
use
s a
tagg
ed p
rofil
e, e
.g. f
or II
OP
and
set
s up
a T
CP
con
nect
ion
with
th
e ob
ject
's s
erve
r•
A c
lient
's in
voca
tion
is m
arsh
aled
into
an
IIOP
req
uest
mes
sage
and
sen
t ove
r th
e T
CP
con
nect
ion
to th
e P
OA
ass
ocia
ted
with
the
obje
ct k
ey•
The
PO
A fo
rwar
ds th
e re
ques
t to
the
prop
er s
erva
nt w
here
it is
unm
arsh
aled
and
tran
sfor
med
into
an
actu
al m
etho
d ca
ll
Alte
rnat
ive:
indi
rect
bin
ding
•A
n im
plem
enta
tion
repo
sito
ry is
invo
lved
•T
he im
plem
enta
tion
repo
sito
ry is
iden
tifie
d in
the
IOR
•It
acts
as
a re
gist
ry to
loca
te a
nd a
ctiv
ate
an o
bjec
t bef
ore
tran
smitt
ing
invo
catio
ns•
prim
arily
use
d fo
r pe
rsis
tent
obj
ects
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
68
Ch
ap
ter
8:
Mid
dle
ware
Ind
irec
t B
ind
ing
•F
irst s
tep:
bin
ding
to th
e im
plem
enta
tion
repo
sito
ry
•T
he r
epos
itory
che
cks
if th
e se
rver
is a
lread
y ru
nnin
g. If
yes
, it c
heck
s, w
here
it is
lo
cate
d. If
no,
the
repo
sito
ry s
tart
s it
•W
hen
the
clie
nt in
voke
s th
e re
fere
nced
obj
ect f
or th
e fir
st ti
me,
the
invo
catio
n re
ques
t is
sent
to th
e im
plem
enta
tion
repo
sito
ry w
hich
res
pond
s by
giv
ing
the
deta
ils w
here
the
obje
ct's
ser
ver
can
actu
ally
be
reac
hed
•S
o th
e in
voca
tion
requ
ests
are
forw
arde
d to
the
prop
er s
erve
r
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
69
Ch
ap
ter
8:
Mid
dle
ware
Inte
rcep
tors
•C
lient
impl
emen
tatio
ns a
re s
impl
e: d
efin
e ID
L, g
ener
ate
prox
y, d
one.
•B
ut…
if a
n ob
ject
exp
ects
a c
lient
to e
nhan
ce it
s fu
nctio
nalit
y (e
.g. c
achi
ng),
the
clie
nt is
not
ena
bled
to d
o so
.
•T
hus:
som
e ad
ditio
n is
nee
ded
enha
ncin
g th
e cu
rren
t sof
twar
e
Inte
rcep
tors
•M
echa
nism
by
whi
ch a
n in
voca
tion
can
be in
terc
epte
d on
its
way
from
clie
nt to
se
rver
and
ada
pted
as
nece
ssar
y be
fore
letti
ng it
con
tinue
•P
iece
of c
ode
mod
ifyin
g or
ana
lysi
ng a
req
uest
•G
ener
al m
etho
d to
ach
ieve
ext
ensi
bilit
y
•T
here
may
be
vario
us in
terc
epto
rs a
dded
to a
n O
RB
•A
lso
poss
ible
for
serv
er-s
ide
•A
re s
een
only
by
the
OR
B, t
he O
RB
has
to in
voke
them
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
70
Ch
ap
ter
8:
Mid
dle
ware
Typ
es o
f In
terc
epto
rs1.
Req
uest
leve
l int
erce
ptor
: is
logi
cally
pla
ced
betw
een
a cl
ient
's p
roxy
and
the
OR
B•
Com
es in
bef
ore
an in
voca
tion
requ
est i
s pa
ssed
to th
e O
RB
•T
he in
terc
epto
r m
ay m
odify
the
requ
est
•O
n se
rver
sid
e, it
is p
lace
d be
twee
n th
e O
RB
and
the
obje
ct a
dapt
er
2.M
essa
ge le
vel i
nter
cept
or:p
lace
d be
twee
n an
OR
B a
nd th
e un
derly
ing
netw
ork
•K
now
s no
thin
g ab
out t
he m
essa
ge c
onte
nt th
at is
to b
e se
nt
•O
nly
sees
GIO
P m
essa
ges
that
it c
ould
mod
ify
add
addi
tiona
l inf
orm
atio
n, e
.g. f
or in
stru
ctin
g a
serv
er p
roce
ss o
r en
hanc
e a
clie
nt b
y ca
chin
g
mod
ify r
eque
st, e
.g. f
or fr
agm
entin
g la
rge
GIO
P m
essa
ges
or to
tran
spar
ently
red
irect
a
requ
est b
y ex
chan
ging
the
IOR
Bot
h ty
pes:
add
mon
itors
to a
naly
se th
e pe
rfor
man
ce o
f com
mun
icat
ions
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
71
Ch
ap
ter
8:
Mid
dle
ware
CO
RB
Ase
rvic
esC
OR
BA
serv
ices
are
gene
ral p
urpo
se a
nd a
pplic
atio
n in
depe
nden
t ser
vice
s.
CO
RB
Ase
rvic
esst
rong
ly r
esem
ble
the
type
s of
ser
vice
s co
mm
only
pro
vide
d by
an
oper
atin
g sy
stem
.
Pro
vide
s th
e cu
rren
t tim
e w
ithin
spe
cifie
d er
ror
mar
gins
Tim
e
Mec
hani
sms
for
secu
re c
hann
els,
aut
horis
atio
n, a
nd a
uditi
ngS
ecur
ity
Fac
ilitie
s fo
r ex
pres
sing
rel
atio
nshi
ps b
etw
een
obje
cts
Rel
atio
nshi
p
Fac
ilitie
s fo
r pe
rsis
tent
ly s
torin
g ob
ject
sP
ersi
sten
ce
Fac
ilitie
s to
pub
lish
and
find
the
serv
ices
on
obje
ct h
as to
offe
rT
radi
ng
Fac
ilitie
s fo
r as
soci
atin
g (a
ttrib
ute,
val
ue)
pairs
with
obj
ects
Pro
pert
y
Fac
ilitie
s fo
r sy
stem
-wid
e na
me
of o
bjec
tsN
amin
g
Fac
ilitie
s fo
r at
tach
ing
a lic
ense
to a
n ob
ject
Lice
nsin
g
Fac
ilitie
s fo
r cr
eatio
n, d
elet
ion,
cop
ying
, and
mov
ing
of o
bjec
tsLi
feC
ycle
Fac
ilitie
s fo
r m
arsh
alin
g an
d un
mar
shal
ing
of o
bjec
tsE
xter
naliz
atio
n
Adv
ance
d fa
cilit
ies
for
even
t-ba
sed
asyn
chro
nous
com
mun
icat
ion
Not
ifica
tion
Fac
ilitie
s fo
r as
ynch
rono
us c
omm
unic
atio
n th
roug
h ev
ents
Eve
nt
Fla
t and
nes
ted
tran
sact
ions
on
met
hod
calls
ove
r m
ultip
le o
bjec
tsT
rans
actio
n
Fac
ilitie
s to
allo
w c
oncu
rren
t acc
ess
to s
hare
d ob
ject
s (lo
ckin
g)C
oncu
rren
cy
Fac
ilitie
s fo
r qu
eryi
ng c
olle
ctio
ns o
f obj
ects
in a
dec
lara
tive
man
ner
Que
ry
Fac
ilitie
s fo
r gr
oupi
ng o
bjec
ts in
to li
sts,
que
ue, s
ets,
etc
.C
olle
ctio
n
Des
crip
tio
nS
ervi
ce
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
72
Ch
ap
ter
8:
Mid
dle
ware
Eve
nt
Ser
vice
Asy
nchr
onou
s co
mm
unic
atio
n ca
n by
rea
lised
with
one
-way
cal
ls, b
ut…
•O
ne-w
ay c
alls
are
bes
t effo
rt•
Ove
rhea
d w
hen
sim
ply
a si
gnal
ling
info
rmat
ion
shou
ld b
e tr
ansm
itted
→C
omm
unic
atio
n by
eve
nts
CO
RB
A's
Eve
nt
Ser
vice
•P
rovi
de a
ser
vice
that
cou
ld s
impl
y si
gnal
the
occu
ranc
eof
an
even
t.•
In th
is m
odel
eac
h ev
ent i
s as
soci
ated
with
a s
ingl
e da
ta it
em, g
ener
ally
re
pres
ente
d by
mea
ns o
f an
obje
ct r
efer
ence
or
othe
rwis
e an
app
licat
ion-
spec
ific
valu
e.
•A
n ev
ent i
s pr
oduc
ed b
y a
supp
lier
and
rece
ived
by
a co
nsum
er•
The
eve
nt s
ervi
ce o
ffers
an
even
t cha
nnel
whi
ch is
logi
cally
pla
ced
betw
enn
supp
liers
and
con
sum
ers
and
suits
for
deliv
erin
g ev
ents
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
73
Ch
ap
ter
8:
Mid
dle
ware
Pu
sh a
nd
Pu
ll M
od
elP
ush
mod
el:
•W
hene
ver
en e
vent
occ
urs,
the
supp
lier
prod
uces
the
even
t and
pus
hes
it th
roug
h th
e ev
ent c
hann
el•
Eve
nt c
hann
el p
asse
s th
e ev
ent o
n to
its
cons
umer
s
•In
this
mod
el c
onsu
mer
s pa
ssiv
ely
wai
t for
eve
nt p
ropa
gatio
n an
dex
pect
to b
e in
terr
upte
d w
hen
an e
vent
hap
pens
Pul
l mod
el:
•C
onsu
mer
s po
ll th
e th
eev
ent c
hann
el to
che
ck w
heth
er a
n ev
ent h
as h
appe
ned
•T
he e
vent
cha
nnel
in tu
rn p
olls
the
vario
us s
uppl
iers
Not
e: th
e m
odel
s ca
n be
com
bine
d
How
doe
s it
wor
k?•
For
bot
h, c
onsu
mer
s an
d su
pplie
rs, p
roxi
es (
for
push
and
pul
l ope
ratio
ns)
are
impl
emen
ted
in th
e ev
ent c
hann
el.
•C
onsu
mer
and
pro
duce
r us
e sy
nchr
onou
s co
mm
unic
atio
n w
ith th
ese
prox
ies
for
the
time
deliv
erin
g or
get
ting
even
ts
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
74
Ch
ap
ter
8:
Mid
dle
ware
Eve
nt
Ch
ann
el
Push
Supp
lier 1
Push
Supp
lier n
PullS
uppl
ier 1
PullS
uppl
ier m
Push
Con
sum
er 1
Push
Con
sum
er r
PullC
onsu
mer
1
PullC
onsu
mer
s
Eve
nt C
hann
el
Prox
yPus
hCon
sum
er
Prox
yPul
lCon
sum
erPr
oxyP
ullS
uppl
ier
Prox
yPus
hSup
plie
r
. . .. . .. . . . . .
Not
ice:
kin
dof
mul
ticas
t: al
l eve
nts
are
pass
edfr
oma
Sup
plie
rP
roxy
to a
ll C
onsu
mer
Pro
xies
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
75
Ch
ap
ter
8:
Mid
dle
ware
No
tifi
cati
on
Ser
vice
Eve
nt s
ervi
ces
draw
back
s:•
CO
RB
A's
eve
nt s
ervi
ce d
oes
not s
uppo
rt p
ersi
sten
ce o
f eve
nts.
Ifa
cons
umer
co
nnec
ts to
the
even
t cha
nnel
too
late
, eve
nts
get l
ost
•C
onsu
mer
s ha
ve n
o ch
ance
to fi
lter
even
ts. E
ach
even
t is
pass
ed to
eve
ry
cons
umer
. If d
iffer
ent e
vent
type
s ne
ed to
be
dist
ingu
ishe
d it
is n
eces
sary
to
set o
n a
sepa
rate
eve
nt c
hann
el fo
r ea
ch e
vent
type
. •
Eve
nt p
ropa
gatio
n is
unr
elia
ble.
No
guar
ante
es n
eed
to b
e gi
ven
conc
erni
ng
the
deliv
ery
of e
vent
s
→N
otifi
catio
n se
rvic
e•
Eve
nt ty
ping
•F
ilter
ing
capa
bilit
ies
have
bee
n ad
ded
•O
ffers
faci
litie
s to
pre
vent
eve
nt p
ropa
gatio
n w
hen
no c
onsu
mer
sar
e in
tere
sted
in a
spe
cific
eve
nt
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
76
Ch
ap
ter
8:
Mid
dle
ware
Mes
sag
ing
•C
omm
unic
atio
n in
CO
RB
A is
tran
sien
t
•M
any
appl
icat
ions
req
uire
per
sist
entc
omm
unic
atio
n as
offe
red
by m
essa
ge
queu
ing
•C
OR
BA
sup
port
s th
is m
odel
as
an a
dditi
onal
mes
sagi
ng s
ervi
ce
•M
essa
ging
in C
OR
BA
is d
iffer
ent b
ecau
se it
is in
here
nt o
bjec
t bas
ed a
ppro
ach
in c
omm
unic
atio
n.•
Tw
o m
odel
s fo
r m
essa
ging
:
�C
allb
ack
mod
elA
clie
nt im
plem
ents
a c
allb
ack
met
hod.
The
com
mun
icat
ion
syst
em c
alls
th
is m
etho
d to
del
iver
a r
esul
t fro
m a
n as
ynch
rono
us r
eque
st. I
tis
the
clie
nt's
res
pons
ibili
ty to
tran
sfor
m th
e or
igin
al s
ynch
rono
us in
voca
tion
into
an
asy
nchr
onou
s on
e
The
ser
ver
is p
rese
nted
a n
orm
al (
sync
hron
ous)
invo
catio
n re
ques
t�
Pol
ling
mod
el
The
clie
nt is
offe
red
a co
llect
ion
of o
pera
tions
to p
oll i
ts O
RB
for
inco
min
g re
sults
. It i
s th
e cl
ient
's r
espo
nsib
ility
to tr
ansf
orm
the
orig
inal
syn
chro
nous
in
voca
tion
into
an
asyn
chro
nous
one
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
77
Ch
ap
ter
8:
Mid
dle
ware
Cal
lbac
k M
od
el
Con
stru
ctin
g an
asy
nchr
onou
s in
voca
tion
is d
one
in tw
o st
eps:
1.T
he o
rigin
al in
terf
ace
as im
plem
ente
d by
the
obje
ct is
rep
lace
d by
two
new
in
terf
aces
that
are
to b
e im
plem
ente
d by
the
clie
nt-s
ide
softw
are:
�S
peci
ficat
ion
of m
etho
ds th
at th
e cl
ient
can
cal
l; no
ne o
f the
sem
etho
ds
retu
rns
a va
lue
or h
as a
ny o
utpu
t par
amet
er
�C
allb
ack
inte
rfac
e2.
Thi
s st
ep c
onsi
sts
of s
impl
y co
mpi
ling
the
gene
rate
d in
terf
aces
Orig
inal
met
hod:
inta
dd(in
intI
, in
intj
, out
intk
);
New
met
hods
:
void
sen
dcb_
add(
inin
tI, i
n in
tj);
void
rep
lycb
_add
(inin
tret
_val
, in
intk
);
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
78
Ch
ap
ter
8:
Mid
dle
ware
Po
llin
g M
od
el
•A
gain
, the
orig
inal
met
hod
is r
epla
ced
by tw
o ne
w m
etho
ds
•T
he O
RB
has
to p
rovi
de th
e se
cond
met
hod
Orig
inal
met
hod:
inta
dd(in
intI
, in
intj
, out
intk
);
New
met
hods
:
void
sen
dpol
l_ad
d(in
intI
, in
intj
);
void
rep
lypo
ll_ad
d(ou
tint
ret_
val,
out i
ntk)
;
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
79
Ch
ap
ter
8:
Mid
dle
ware
Nam
ing
•C
OR
BA
sup
port
s di
ffere
nt ty
pes
of n
ames
•M
ost b
asic
type
s, o
bjec
t ref
eren
ces
and
char
acte
r-ba
sed
nam
es, a
re s
uppo
rted
by
the
CO
RB
A n
amin
g se
rvic
e•
The
re a
re a
num
ber
of a
dvan
ce n
amin
g fa
cilit
ies
whe
reby
obj
ects
can
foun
d ba
sed
on a
ssoc
iate
d pr
oper
ties
•In
depe
nden
tly fr
om lo
gica
l obj
ect n
ames
, CO
RB
A o
bjec
ts c
an b
e ad
dres
sed
by
UR
Ls:
–iio
ploc
://ap
pser
ver.
klic
k-an
d-ba
u.co
m:4
711/
obje
ct-2
4re
fere
nces
the
CO
RB
A o
bjec
t whi
ch c
an b
e co
nnec
ted
to o
n ho
st
'app
serv
er.k
lick-
and-
bau.
com
' usi
ng p
ort 4
711
and
obje
ct id
entif
ier
'obj
ect-
24'
–iio
pnam
e://a
ppse
rver
.klic
k-an
d-ba
u.co
m/B
uchh
altu
ng/S
tam
mda
ten/
Art
ikel
Hom
ere
fere
nces
the
CO
RB
A o
bjec
t whi
ch th
e na
min
g se
rvic
e on
hos
t 'a
ppse
rver
.klic
k-an
d-ba
u.co
m' k
now
s by
the
nam
e 'B
uchh
altu
ng/S
tam
mda
ten/
Art
ikel
Hom
e'
–In
bot
h ca
ses,
IIO
P is
use
d as
com
mun
icat
ion
prot
ocol
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
80
Ch
ap
ter
8:
Mid
dle
ware
CO
RB
A N
amin
g S
ervi
ce•
Use
d to
look
up
obje
ct r
efer
ence
s us
ing
a ch
arac
ter
base
d na
me
•N
ames
in C
OR
BA
are
seq
uenc
es o
f nam
e co
mpo
nent
s ea
ch ta
king
the
form
of a
(id
,kin
d)-p
air,
whe
re id
and
kind
are
both
str
ings
: id
is u
sed
to n
ame
an o
bjec
t, ki
ndis
a s
impl
e in
dica
tion
of th
e na
me
obje
ct (
e.g.
'dir'
for
a di
rect
ory
obje
ct)
•T
he r
epre
sent
atio
n of
a s
eque
nce
is a
lang
uage
dep
ende
nt•
The
re a
re n
o re
stric
tions
with
res
pect
to th
e st
ruct
ure
of a
nam
ing
grap
h.•
Eac
h no
de in
a n
amin
g gr
aph
is tr
eate
d as
an
obje
ct
•N
amin
g co
ntex
t: an
obj
ect t
hat s
tore
s a
tabl
e m
appi
ng n
ame
com
pone
nts
to
obje
ct r
efer
ence
s (li
ke d
irect
ory
node
)•
Nam
ing
grap
h do
es n
ot h
ave
a ro
ot c
onte
xt, h
owev
er e
ach
OR
B is
req
uire
d to
pr
ovid
e an
initi
al n
amin
g co
ntex
t whi
ch e
ffect
ivel
y op
erat
es a
s th
e ro
ot in
a
nam
ing
grap
h•
Nam
es a
re a
lway
s re
solv
ed w
ith r
espe
ct to
a g
iven
nam
ing
cont
ext
•A
clie
nt r
esol
ves
a na
me
by in
voki
ng th
e re
solv
e m
etho
d on
a s
peci
fic n
amin
g co
ntex
t•
If na
me
reso
lutio
n su
ccee
ds, i
t alw
ays
retu
rns
eith
er a
ref
eren
ce to
a n
amin
g co
ntex
t or
a re
fere
nce
to a
nam
ed o
bjec
t•
Nam
e re
solu
tion
proc
eeds
exa
ctly
as
pres
ente
d in
par
t 3 o
f the
lect
ure
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
81
Ch
ap
ter
8:
Mid
dle
ware
Par
t o
f th
e C
OR
BA
Nam
ing
Ser
vice
In
terf
ace
in ID
Lstruct
NameComponent{ string id; string kind; };
typedef
sequence <NameComponent> Name;
interface NamingContext
{void bind (in Name n, in Object obj);
bind
s th
e gi
ven
nam
e an
d re
mot
e ob
ject
ref
eren
ce in
my
cont
ext
void unbind (in Name n);
rem
oves
an
exis
ting
bind
ing
with
the
give
n na
me
void bind_new_context(in Name n);
crea
tes
a ne
w n
amin
g co
ntex
t and
bin
ds it
to a
giv
en n
ame
in m
y co
ntex
t
Object resolve (in Name n);
look
s up
the
nam
e in
my
cont
ext a
nd r
etur
ns it
s re
mot
e ob
ject
ref
eren
ce
void list (in unsigned long how_many, out BindingList
bl,
out BindingIterator
bi);
retu
rns
the
nam
es in
the
bind
ings
in m
y co
ntex
t};
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
82
Ch
ap
ter
8:
Mid
dle
ware
Ho
wto
Fin
d t
he
Fir
st N
amin
g
Co
nte
xt?
•T
he C
OR
BA
nam
e se
rvic
e al
low
s yo
u to
sea
rch
a na
me
cont
ext a
nd to
nav
igat
e th
roug
h se
vera
l nam
e co
ntex
ts. T
his
wor
ks a
s in
oth
er n
ame
serv
ices
. But
… h
ow
to fi
nd th
e ro
ot c
onte
xt, i
.e. t
he n
amin
g se
rvic
e its
elf?
•T
he n
amin
g se
rvic
e is
iden
tifie
d by
an
obje
ct r
efer
ence
…•
To
solv
e th
e pr
oble
m, t
he O
RB
itse
lf is
res
pons
ible
to p
rovi
de fa
cilit
ies
to g
et
initi
al o
bjec
t ref
eren
ces.
A r
efer
ence
to th
e ro
ot c
onte
xt c
an b
e go
t by
calli
ng th
e fu
nctio
n re
solv
e_in
itial
_ref
eren
ce("
Nam
eS
ervi
ce")
pro
vide
d by
the
OR
B:
interface ORB {
...
Object resolve_initial_references
(in String name);
...
}
•C
OR
BA
def
ines
som
e m
ore
nam
es th
e O
RB
has
to r
esol
ve, e
.g. "
Roo
tPO
A"
and
"Int
erfa
ceR
epos
itory
". F
urth
er n
ames
can
be
conf
igur
ed b
y th
e ad
min
istr
ator
.
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
83
Ch
ap
ter
8:
Mid
dle
ware
Tra
din
g S
ervi
ce
Nam
ing
Ser
vice
= W
hite
pag
es
But
… s
omet
imes
, no
conc
rete
nam
ebu
tonl
ya
desc
riptio
nof
the
need
edse
rvic
eis
know
n
→T
radi
ng S
ervi
ce(=
Yel
low
page
s)
An
obje
ctis
notd
enot
edby
a lo
gica
lnam
e, b
utby
a de
scrip
tion
of it
sca
pabi
litie
s:•
Ser
vice
Typ
e(d
escr
iptio
nof
obj
ectf
unct
iona
lity,
det
erm
ines
inte
rfac
e)
•S
ervi
ce P
rope
rtie
s(n
on-f
unct
iona
ldes
crip
tion
of a
ser
vice
)
Rol
es:
•T
rade
r: s
tore
san
d se
arch
esse
rvic
ede
scrip
tions
•Im
port
er: a
clie
ntse
arch
ing
for
an o
bjec
t‘sse
rvic
e
•E
xpor
ter:
an
obje
ctof
ferin
ga
serv
ice
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
84
Ch
ap
ter
8:
Mid
dle
ware
Th
eT
rad
ing
Pro
cess
Exp
orte
rE
xpor
ter
Tra
der
Impo
rter
Exp
orte
r
1. S
ervi
ce E
xpor
t
2. S
ervi
ce Im
port
3. S
elec
ted
serv
ice 4.
Ser
vice
usa
ge
Ser
vice
D
irect
ory
T2
T2
14
12
...n
... ... ...P
rope
rtie
s
Ref
eren
ce
Typ
eT
4T
5T
2
→st
atic
vs. d
ynam
icpr
oper
ties
→A
ser
ver
spec
ifies
itsfu
nctio
nalit
yan
d its
capa
bilit
ies
→T
hecl
ient
spec
ifies
itsde
man
dsto
a s
ervi
ce
→m
atch
esbo
thde
scrip
tions
→so
rts
all s
ervi
ces
with
mat
chin
gty
pean
d pr
oper
ties
bya
clie
nt‘s
cons
trai
nt
→gi
ves
back
the
refe
renc
eto
the
„bes
t“m
atch
ing
serv
ice
A s
ervi
ceis
desc
ribed
by
→S
ervi
ce T
ype
→S
ervi
ce P
rope
rtie
s
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
85
Ch
ap
ter
8:
Mid
dle
ware
Exa
mp
le:
sear
chin
ga
pri
nt
serv
ice
Exp
orte
r: s
peci
fies
itsof
fer,
i.e.
type
and
prop
ertie
s, e
.g.
•fo
rmat
={A
3, A
4, A
5}
•co
st_p
er_p
age=
10
•pa
ges_
per_
sec=
5
Impo
rter
: spe
cifie
sty
pean
d co
nstr
aint
s, e
.g.
•fo
rmat
=A
4 A
ND
cos
t_pe
r_pa
ge<
15
•m
inim
ize
cost
_per
_pag
e
Onl
yse
rvic
eof
fers
fulfi
lling
thos
ere
stric
tions
are
furt
her
cons
ider
ed
The
mat
chin
gse
rvic
esar
eso
rted
byth
iscr
iterio
n
Not
e: p
rope
rtie
sca
nbe
stat
icor
dyna
mic
(val
ueis
chan
ging
over
time)
. C
onsi
derin
gdy
nam
icpr
oper
ties
isse
ldom
real
ised
.
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
86
Ch
ap
ter
8:
Mid
dle
ware
Syn
chro
nis
atio
n a
nd
Tra
nsa
ctio
ns
Tw
o im
port
ant s
ervi
ces
that
faci
litat
e sy
nchr
onis
atio
n in
CO
RB
A a
re th
e C
oncu
rren
cy c
ontr
ol s
ervi
cean
d th
e T
rans
actio
n se
rvic
e•
The
two
serv
ices
col
labo
rate
to im
plem
ent d
istr
ibut
ed a
nd n
este
dtr
ansa
ctio
ns
usin
g tw
o ph
ase
lock
ing
�A
tran
sact
ion
is in
itiat
ed b
y a
clie
nt a
nd c
onsi
sts
of a
ser
ies
of in
voca
tions
on
obj
ects
. Whe
n an
obj
ect i
s in
voke
d fo
r th
e fir
st ti
me
it au
tom
atic
ally
be
com
es p
art o
f the
tran
sact
ion.
Thi
s in
form
atio
n is
pas
sed
to th
e se
rver
w
hen
invo
king
the
obje
ct�
Tw
o ty
pes
of o
bjec
ts c
an b
e pa
rt o
f a tr
ansa
ctio
n:�
Rec
over
able
obj
ect:
is e
xecu
ted
by a
n ob
ject
ser
ver
capa
ble
of p
artic
ipat
ing
in tw
o ph
ase
com
mit
prot
ocol
�
Tra
nsac
tiona
l obj
ects
: exe
cute
d by
ser
ver
that
do
not p
artic
ipat
e in
a
tran
sact
ion'
s tw
o ph
ase
com
mit
prot
ocol
(ty
pica
lly r
ead-
only
obj
ects
)•
CO
RB
A tr
ansa
ctio
ns a
re s
imila
r to
dis
trib
uted
tran
sact
ions
and
thei
r pr
otoc
ols
as
pres
ente
d in
the
6th
part
of t
he le
ctur
e•
The
ser
vice
is im
plem
ente
d us
ing
a ce
ntra
l loc
k m
anag
er; i
t doe
sno
t use
di
strib
uted
lock
ing
tech
niqu
es•
The
ser
vice
dis
tingu
ishe
s re
ad fr
om w
rite
lock
s an
d is
als
o ca
pabl
e of
sup
port
ing
lock
s at
diff
eren
t gra
nula
ritie
s (e
.g. w
hole
tabl
es v
s. s
ingl
e re
cord
s)
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
87
Ch
ap
ter
8:
Mid
dle
ware
Rep
licat
ion
an
d F
ault
To
lera
nce
•C
OR
BA
offe
rs n
o su
ppor
t for
gen
eric
cac
hing
and
rep
licat
ion
•A
pplic
atio
n de
velo
pers
hav
e to
res
ort t
o an
ad-
hoc
appr
oach
whe
n re
plic
atio
n is
ne
eded
(su
ch a
ppro
ache
s ar
e of
ten
base
d on
usi
ng in
terc
epto
rs)
•O
nly
the
repl
icat
ion
of o
bjec
ts fo
r fa
ult t
oler
ance
is in
clud
ed in
the
curr
ent C
OR
BA
ve
rsio
n 3
Fau
lt T
oler
ance
•D
ealin
g w
ith fa
ilure
s: r
eplic
ate
obje
cts
into
obj
ect g
roup
s, c
onsi
stin
g of
iden
tical
co
pies
of a
n ob
ject
ref
eren
ced
as if
it w
ould
be
a si
ngle
obj
ect.
•A
gro
upof
fers
the
sam
ein
terf
ace
as th
eob
ject
sit
cont
ains
•U
ses
a sp
ecia
lkin
dof
an
IOR
, the
Inte
rope
rabl
eO
bjec
tGro
up R
efer
ence
(IO
GR
)
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
88
Ch
ap
ter
8:
Mid
dle
ware
Fau
lt T
ole
ran
ce•
Sup
port
edst
rate
gies
: pas
sive
rep
licat
ion,
act
ive
repl
icat
ion,
quo
rum
-bas
edre
plic
atio
n
•W
hen
a cl
ient
pass
esan
IOG
R to
the
OR
B, t
heO
RB
atte
mpt
sto
bin
d to
one
of
the
repl
icas
. The
Com
pone
nts
filed
coul
dre
fer
to th
epr
imar
yor
a co
pyof
the
obje
ct's
repl
icas
•If
bind
ing
fails
, the
OR
B c
antr
yan
othe
rco
py
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
89
Ch
ap
ter
8:
Mid
dle
ware
Fau
lt T
ole
ran
ce
•R
eplic
atio
nm
anag
er: c
reat
ing
and
man
agin
gob
ject
grou
ps, r
epla
cing
repl
icas
in
case
of a
failu
re
•In
terc
epto
rsar
eus
edto
pas
s in
voca
tions
to a
sep
arat
e re
plic
atio
nco
mpo
nent
mai
ntai
ning
cons
iste
ncy
and
real
isin
gre
cove
rabi
lity
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
90
Ch
ap
ter
8:
Mid
dle
ware
Co
mp
aris
on
of
CO
RB
A, D
CO
M a
nd
G
lob
e
No
No
Yes
Tra
ding
ser
vice
No
Yes
Yes
Dire
ctor
y se
rvic
e
Obj
ect d
epen
dent
Har
d-co
ded
Fle
xibl
e (P
OA
)O
bjec
t ser
ver
No
Yes
Yes
Mes
sagi
ng
No
Yes
Yes
Eve
nts
No
Yes
Yes
Cal
lbac
ks
No
Yes
Yes
Asy
nchr
onou
s co
mm
unic
atio
n
Yes
Yes
Yes
Syn
chro
nous
co
mm
unic
atio
n
Bin
ary
Bin
ary
Lang
uage
-de
pend
ent
Inte
rfac
es
Few
Fro
m e
nviro
nmen
tM
any
of it
s ow
nS
ervi
ces
Dis
trib
uted
obj
ects
Rem
ote
obje
cts
Rem
ote
obje
cts
Obj
ect m
odel
Sca
labi
lity
Fun
ctio
nalit
yIn
tero
pera
bilit
yD
esig
n go
als
Glo
be
DC
OM
CO
RB
AIs
sue
Leh
rstu
hl fü
r I
nfo
rm
ati
k 4
Kom
mu
nik
ati
on
un
d v
erte
ilte
Syste
me
91
Ch
ap
ter
8:
Mid
dle
ware
Co
mp
aris
on
of
CO
RB
A, D
CO
M a
nd
G
lob
eG
lob
eD
CO
MC
OR
BA
Issu
e
Mor
e w
ork
need
edV
ario
us
mec
hani
sms
Var
ious
m
echa
nism
sS
ecur
ity
No
By
tran
sact
ions
Yes
Rec
over
y su
ppor
t
By
repl
icat
ion
By
tran
sact
ions
By
repl
icat
ion
Fau
lt to
lera
nce
No
Yes
Yes
Tra
nsac
tions
Sep
arat
e su
bobj
ect
Non
eS
epar
ate
serv
erR
eplic
atio
n su
ppor
t
Onl
y in
tra-
obje
ctT
rans
actio
nsT
rans
actio
nsS
ynch
roni
satio
n
Tru
e id
entif
ier
Inte
rfac
e po
inte
rO
bjec
t's lo
catio
nO
bjec
t ref
eren
ce
Yes
No
No
Loca
tion
serv
ice
Yes
Yes
Yes
Nam
ing
serv
ice