new corba
TRANSCRIPT
-
8/8/2019 NEW CORBA
1/96
-
8/8/2019 NEW CORBA
2/96
-
8/8/2019 NEW CORBA
3/96
-
8/8/2019 NEW CORBA
4/96
-
8/8/2019 NEW CORBA
5/96
-
8/8/2019 NEW CORBA
6/96
-
8/8/2019 NEW CORBA
7/96
-
8/8/2019 NEW CORBA
8/96
-
8/8/2019 NEW CORBA
9/96
-
8/8/2019 NEW CORBA
10/96
-
8/8/2019 NEW CORBA
11/96
-
8/8/2019 NEW CORBA
12/96
-
8/8/2019 NEW CORBA
13/96
Defines h ow o bjects areactivated/deactivated Initializing server o bjects:
BOA.obj_is_ready( /* the object ref */ ); R egisters the o bject with the ORBBOA.impl_is_ready();
Tells the BOA /ORB to begin listening f or requests
Unders pecified Initially unclear which features w ould be
required on vari ous platf or ms
Basic O bject Ada pter ( BOA )
-
8/8/2019 NEW CORBA
14/96
Portable O bject Ada pter (P OA )
R e places BOA Mo st comm ercial i mp lementati ons still use
BOAEx panded sc ope of OA to include Activati on policies
Threading models O bject life cycle (transient/ persistent) Pre/ post inv ocati on ca pabilities
-
8/8/2019 NEW CORBA
15/96
(Portable) Object Adapter
(POA)Register class implementationsCreates and destroys objectsHandles method invocationHandles client authentication and accesscontrol
ORB
C++ O bject
Client Server
Java O bject
IIOPORB
Stub O bject Ada pter
Skelet on
-
8/8/2019 NEW CORBA
16/96
W hat is an ORB?
A distributed o bject bus
Hides trans port mechanis ms
Locati on Method inv ocati on Marshalling
OMG Interface Definiti on Language(IDL) pr ovides the languageinde pendent se mantics
ORB
-
8/8/2019 NEW CORBA
17/96
O bject R equest Br oker ( ORB )
Enables o bject t o trans parently make andreceive requests and res ponses
...like a telephone exchange, providing the b a s icmechani sm for making and receiving call s
ORB
-
8/8/2019 NEW CORBA
18/96
O bject R equest Br oker ( ORB )
A bstracts re mo te request and res ponsemechanis ms
Trans port f or di s
tribu
ting method inv ocati ons
ORB
O bject I mp lementati onClient
R equestR equest
-
8/8/2019 NEW CORBA
19/96
ORB Usage
ORB is a singlet onORB initializati on Single static call t o init() an ORB
After initializati on, y ou register o bjectswith the ORB using an O bject Ada pter
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init();
-
8/8/2019 NEW CORBA
20/96
Pr oxy-based Inv ocati on
ORB
Skelet onStub
R equestR equest
Client O bject I mp lementati on
R equest R equest
-
8/8/2019 NEW CORBA
21/96
-
8/8/2019 NEW CORBA
22/96
Object Request Broker ...Communication infrastructure sendingmessages bet ween objectsCommunication type:
GIOP (General Inter-ORB Protocol) IIOP (Internet Inter-ORB Protocol) (GIOP on
TCP/IP)
ORB
C++ O bject
Client Server
Java O bject
IIOPORB
Stub O bject Ada pter
Skelet on
-
8/8/2019 NEW CORBA
23/96
-
8/8/2019 NEW CORBA
24/96
Internet Inter ORB Pr otocol (II OP)
Trans port pr otocol Defines inter ORB comm unicati on R uns on top of TCP/IP Defines CORBA messages
IIOP is a s pecificati on Vend ors must i mp lement t o be CORBA -
comp liant Allows f or multi-vend or inter operability
-
8/8/2019 NEW CORBA
25/96
CORBA Object
Server
Interface
IDL
C++ /Java
Implementati on
Inter operable O bject R eferenceCORBA
O bject
Servant
-
8/8/2019 NEW CORBA
26/96
Interoperable Object Reference(IOR)
Uniquely identifies an object (see objectreferences)
Server
InterfaceIDL
C++ /JavaImplementati on
Inter operable O bject R eferenceCORBA
O bject
Servant
-
8/8/2019 NEW CORBA
27/96
Interface Definition Language
(IDL)Describes interfaceLanguage independent
Client and server platform independentServer
InterfaceIDL
C++ /JavaImplementati on
Inter operable O bject R eferenceCORBA
O bject
Servant
-
8/8/2019 NEW CORBA
28/96
IDL (cont)
In RMI we had an RMI compiler run on the.class file we wanted to be remote. Itsmore complex under CORBA
The interface is written in InterfaceDefinition Language, IDL. IDL is language-neutral (by being a different language thananything else) though highly reminiscent of C++ (multiple inheritance, similar syntax,
etc.)
-
8/8/2019 NEW CORBA
29/96
Overall CORBA Architecture
ORB
Client Server
IIOPORB
Stub O bject Ada pter
Skelet on
C++ O bject IDL Java O bject
Implementationrepository
Interfacerepository
Implementation repositoryactivates registered servers on demand and locates running serversuses the object adapter name to register and activate servers
Interface repositoryinterface repository provides information about registered IDL interfaces to clientsand servers that require it.
-
8/8/2019 NEW CORBA
30/96
-
8/8/2019 NEW CORBA
31/96
Devel opm ent Ste ps
1 write the IDL file2 compile with idltojava (stubs/skeleton generated automatically)3 write object implementation (servant)4 write client application
steps:
1
Stub Skeleton
Client Application O bject Implementation
ORB ORBrequest
response
IDL
idltojava
2
3
2
4
-
8/8/2019 NEW CORBA
32/96
Example of CORBA Services
Naming: Keeps track of associationbet ween object names and their reference. Allo ws ORB to locatereferenced objectsLife Cycle: Handles the creation,copying, moving, and deletion of objectsTrader: A yello w pages for objects.Lets you find them by the services theyprovideEvent: Facilitates asynchronouscommunications through events
Concurrency: Manages locks so objectscan share resources
-
8/8/2019 NEW CORBA
33/96
CORBAservices are the baseline servicesavailable to all objects sitting on the ORB
communication bus.1 . Naming Service2.Event
ManagementService
3. Life Cycle Service4. Persistent State
Service5. Transaction
Service6. Concurrency
Service
9. Query Service10 . Licensing Service11 . Property Service1 2. Time Service1 3. Security Service1 4. Notification
Service1 5. Trader Service1 6. Collections
Service
-
8/8/2019 NEW CORBA
34/96
Corba ServicesService Description
Collection Facilities for grouping objects into lists, queue, sets, etc.
QueryFacilities for querying collections of objects in a declarativemanner
Concurrency Facilities to allo w concurrent access to shared objects
Transaction Flat and nested transactions on method calls over multipleobjects
Event Facilities for asynchronous communication through events
Notification Advanced facilities for event-based asynchronouscommunication
Externalization Facilities for marshaling and unmarshaling of objects
Life cycleFacilities for creation, deletion, copying, and moving of objects
Licensing Facilities for attaching a license to an object
Naming Facilities for system wide name of objects
-
8/8/2019 NEW CORBA
35/96
-
8/8/2019 NEW CORBA
36/96
RM I De ployment
O bject I mp lementati on
Stubs Skelet ons
InterfaceDefiniti on
Imp lementati onInstallati on
Client
-
8/8/2019 NEW CORBA
37/96
CORBA De ployment
O bject I mp lementati on
InterfaceR e pository
Imp lementati onR e pository
Stubs Skelet ons
IDL Definiti on Imp lementati onInstallati on
Client
-
8/8/2019 NEW CORBA
38/96
CORBA Features
Language inde pendenceLocati on trans parency
R euse of facilities & servicesOMG IDL defined interfacesStub & Skelet on generati on
Server activati on
-
8/8/2019 NEW CORBA
39/96
CORBA R esources
O bject Manage ment Gr ou p (OMG ) www. omg.org
www.c orba. orgDiscussion gr ou ps comp .o bject.c orba comp .lang.java.c orba
Imp lementers In prise: www.in prise.c om Iona: www.i ona.c om
Sun: java.sun.c om/ pr oducts/jdk/1.2/
-
8/8/2019 NEW CORBA
40/96
Creating a CORBA O bject
Initialize ORB and BOAInstantiate the o bjectEx port the o bject BOA .o bj_is_ready()
Op tionally register the o bject Na ming Context.rebind()
Tell the ORB to begin receiving requests BOA .imp l_is_ready()
bli i id i (S i [] ) {
-
8/8/2019 NEW CORBA
41/96
Activating the Qu oteServer public static void main(String[] args) {
try {// Initialize object request brokerORB orb = ORB.init(args, null);
// Initialize basic object adapterBOA boa = orb.BOA_init();
// Create a new QuoteServer ...QuoteServer quoteServer = new QuoteServer();
// ... and export the object boa.obj_is_ready(quoteServer);
// Object Request Broker Initialized System.out.println (QuoteServer ORB
initialized");
// Wait for incoming requests boa.impl_is_ready();
} catch (SystemExcpetion e) {
-
8/8/2019 NEW CORBA
42/96
Accessing a CORBA O bject
ORB uses Inter operable O bjectR eferences (I OR s)
O bject might be l ocal, client uses proxyClient must acquire first o bject reference Na ming/Trading service
Pr op rietary bind Pr op rietary U R L service Som e other pr op rietary means
-
8/8/2019 NEW CORBA
43/96
R egistering the Qu oteServer // Create a new QuoteServer ...
QuoteServer quoteServer = new QuoteServer();...
// Obtain reference for our nameserviceorg.omg.CORBA.Object object =
orb.resolve_initial_references("NameService");// Since we have only an object reference, we must// cast it to a NamingContext. We use a helper// class for this purpose
NamingContext namingContext = NamingContextHelper.narrow(object);
// Add a new naming component for our interface NameComponent name[] = { new NameComponent(QuoteServer", "") };
// Now notify naming service of our new interfacenamingContext.rebind(name, quoteServer);
-
8/8/2019 NEW CORBA
44/96
Using a CORBA O bject
Initialize the ORB on the clientGet a reference t o the re mo te o bject
IOR Actual reference (e.g. fr om bind())
Invoke methods
-
8/8/2019 NEW CORBA
45/96
Accessing the Qu oteServer // Create an object request brokerORB orb = ORB.init(args, null);// Obtain object reference for name service ...org.omg.CORBA.Object object =
orb.resolve_initial_references("NameService");// ... and narrow it to a NameContext
NamingContext namingContext = NamingContextHelper.narrow(object);// Create a name component array
NameComponent name[] = { new NameComponent(QuoteServer","") };// Get a QuoteServer object reference ...org.omg.CORBA.Object objectReference = namingContext.resolve(name);// ... and narrow it to get a QuoteServerQuoteServer quoteServer = QuoteServerHelper.narrow(objectReference);// invoke methods on referenceQuote noveraQuote = quoteServer.getQuote(MCTR);
-
8/8/2019 NEW CORBA
46/96
Technical/Architectural
Overvie wCORBA facilities come in t wo groups:1 . horizontal facilities
target client-side functionality
2. vertical facilities target domain-specific functionality
-
8/8/2019 NEW CORBA
47/96
Technical/Architectural
Overvie w (cont.)Horizontal facilities specifications:1 . Mobile Agents Facility2. Printing Facility3. Internationalization Facility
Vertical facilities domain-specific servicesare being developed for various businessareas:
1 . Common Enterprise Models2. Finance/Insurance
3. Electronic Commerce
-
8/8/2019 NEW CORBA
48/96
Technical/ArchitecturalOvervie w (cont.)
7. Transportation8. Life Science Research9. Utilities10 .C4I (Command, Control, Communications,
Computers, and Intelligence)11 .Space
-
8/8/2019 NEW CORBA
49/96
-
8/8/2019 NEW CORBA
50/96
CORBA BasicsID L J a v a
m o d u l e p a c k a g e
in t e r f ace i n t e r f aces t ruc t c l a s sc o n s t p ub l i c s t a t i c f i na l
b o o l e a n b o o l eanc h a r c h a r w c h a r w c h a r o c t e t o c t e t
s t r i n g j ava . l ang .S t r i ngws t r i ng j ava . l ang .S t r i ng
sh o r t sh o r tu n s i g n e d s h o r t sh o r tl o n g i n tu n s i g n e d l o n g i n tl o n g l o n g l o n gu n s i g n e d l o n g l o n g l o n gf l o a t f l o a t
d o u b l e d o u b l ef i xed ( n o t s u p p o r t e d i n i d l j ) j a v a . m a t h . B i g D e c i m a l s e q u e n c e [ ] ( a r r a y ) [ ] ( a r r a y ) [ ] ( a r r a y )
F ig . 2 6 . 9 ID L k e y w o r d s, t y p e s a n d t h e i r m a p p in g s t o J a v a k e y w o rd s.
-
8/8/2019 NEW CORBA
51/96
CORBA Basics (cont.)
Method call types: synchronous
client makes call on remote blocking method standard method call on remote service
client makes call on remote non-blocking method remote method qualified with oneway modifier in IDL file remote method receives only in arguments
asynchronousclient makes synchronous call on remote method,remote service responds at a later time by callingmethod on client
must be qualified with oneway to prevent deadlock
-
8/8/2019 NEW CORBA
52/96
CORBA Basics (cont.)
Client Server
1 . registerClient( this )
2. clent.endMessage()Client and server are n o w dead loc ked.
Deadl ock caused by client calling a server that calls the client.
-
8/8/2019 NEW CORBA
53/96
Distributed Exceptions
CORBA specifies t wo exception types:1 . System Exceptions
defined for use by CORBA infrastructure
2. User Exceptions defined using IDL by developers
Standard CORBA exceptions map to
Java exceptions as final classes.
-
8/8/2019 NEW CORBA
54/96
Case Study: Chat
Chat is a basic net work application usinga central broadcasting point where acollection of clients pushes in messagesand the middle ware pushes outmessages.Following use cases:
1 . Connect: A client finds and connects to a chatserver.
2. Disconnect: A client completes a chat session bydisconnecting from the chat server.
3. Send message: A connected client creates a chat
a c nvoca on n er ace
-
8/8/2019 NEW CORBA
55/96
a c nvoca on n er ace ,Dynamic Invocation Interface (DII) and
Dynamic Skeleton Interface (DSI)
Tw o ways to invoke a request:1 . statically using S tatic Invocation Interface
( S II) relies on creating a request through invoking a
static method in a stub stub generated from compile-time definition of an object
type (IDL interface) and object operations (methodswithin IDL interface)
2. dynamically using Dynamic InvocationInterface (DII) programmatically creates and send invocation
request directly to ORB without assistance of stub
-
8/8/2019 NEW CORBA
56/96
Static Invocation Interface (SII), DynamicInvocation Interface (DII) and Dynamic
Skeleton Interface (DSI) (cont.)Interface Repository (IR) contains descriptive information about distributed
objects:
modules availableinterfaces definednames of operations defined within interfacesargument typesreturn types
exceptions raised
Steps needed to make DII call:1 . Obtain object reference to server object2. Look up desired method in Interface Repository
3. Build argument list using IRs OperationDef
-
8/8/2019 NEW CORBA
57/96
-
8/8/2019 NEW CORBA
58/96
BOAs, POAs and TIEs (cont.)
POA connects an object reference todeveloper- written code using code foundin IDL generated skeleton. allo w fine-grained control
Distributed objects inherit from a POAbase definition generated by IDL compiler enables distributed object to be usable by a
POA, enables POA to control all access to servant
through policies
-
8/8/2019 NEW CORBA
59/96
-
8/8/2019 NEW CORBA
60/96
BOAs, POAs and TIEs (cont.)
Another way for developer to us a POA isto wrap their servants in a TIE. enables interaction with a POA without having
servants object implementation inheritstructure from POAImpl .
servant can inherit from other base classes
freely
-
8/8/2019 NEW CORBA
61/96
CORBA services
CORBAservices define base servicesand a support structure useful to a widerange of applications.Five most commonly used services:
1 . Naming Service2. Security Service
3. Object Transaction Service4. Persistent State Service5. Event and Notification Services
-
8/8/2019 NEW CORBA
62/96
Naming Service
Associates name objects with arbitraryvalue (kno wn as name bindings ).A path to a name binding consists of zeroor more naming contexts (a collection of unique name bindings).Resolving a name binding returns objectassociated with name.Binding a name creates associationbet ween a name and an object.
Multi le name bindin s can oint to a
-
8/8/2019 NEW CORBA
63/96
Security Service
Consists of t wo levels Level 1
provides basic security for 1 . user authentication,2. invocation security, and3. availability of authentication principals to security-a ware
applications
allows applications to ignore system-securityrequirementsrequires support for no delegation and singledelegation models
-
8/8/2019 NEW CORBA
64/96
Security Service (cont.)
Level 2is everything level 1 provides in addition to:1 . more fine-grained user authentication
2. greater invocation security3. auditing4. finer control over secure invocations5. delegation6. administrators can set security policies
7. discovery of security policies by security-a wareapplications
8. discovery of security policies by ORBs and other services
-
8/8/2019 NEW CORBA
65/96
Object Transaction Service
Enables CORBA objects to execute asparts of distributed transactions .
a transaction describes a collection of interactions where multiple users may accessand/or modify data.
acronym ACID describes four standardrequirements for reliable transactions:
1 . Atomic completion of numerous steps must beconducted as one, other wise each step must beundone.
2. Consistent effects of transaction are repeatableand predictable.
3. Isolated transaction not interrupted from outside
-
8/8/2019 NEW CORBA
66/96
Object Transaction Service(cont.)
transactions complete in one of t wo ways:1 . committed
changes are made to persist
2. rolled backchanges made to data are discarded
POAs dictate transaction types supported byservants
shared transactionsunshared transactionsshared and unshared transactions
-
8/8/2019 NEW CORBA
67/96
-
8/8/2019 NEW CORBA
68/96
-
8/8/2019 NEW CORBA
69/96
Persistent State Service (cont.)
contains t wo definition types:abstract definition define portable definition of the persistable state of a
CORBA object
concrete definition
-
8/8/2019 NEW CORBA
70/96
Event and Notification Services
E vent S ervice defines mechanism thatdecouples delivery of events (messages)from source of events. no predefined event types in specification keeps track of action events and event
listeners
S upplier creates events that areprocessed by a consumer .In push model , supplier sends event
messages asynchronously to all
-
8/8/2019 NEW CORBA
71/96
Event and Notification Services(cont.)
Notification Service is a direct extension of the Event Service. objects can create and destroy event
channels arbitrarily, and can filter output usingF ilter Objects and Object Constraint Language
-
8/8/2019 NEW CORBA
72/96
Event and Notification Services(cont.)
Standard flo w of a StructuredEvent :1 . finding object reference to Notificaion Service
(instance of EventChannelFactory )
2.EventChannelFactory creates anEventChannel3. supplier asks EventChannel to return
SupplierAdmin object
4.SupplierAdmin returns a Consumer proxy(such as StructuredProxyPushConsumer ) toan event channel
5. access to distributed events (through push or pullmodels) is accessible through proxy
d f
-
8/8/2019 NEW CORBA
73/96
Event and Notification Services(cont.)
ProxySupplier
!
o ns " # er
EventChanne l
ProxyConsumer
S" $ $ lier
!
o ns " # er S" $ $ lier
!
o ns " # er
S" $ $ lier
EventChanne l
Even t
Eve nt
Even t
Even t
Event
Event
Even t
!
once$
t"
a ll%
, a S"
$ $
lie r send s a n Eve nt to a!
on s"
#
e r.
&
n EventChannel deco " $ les t'
e S " $ $ lier fro # t'
e!
on s " # er.
&
ddin ( a ProxyConsumer a nd ProxySupplier en a)
les f " rt'
er d eco " $ lin ( a nd # ake s it $ ossi
)
le to s " $ $ o rt)
o t'
t'
e $ " s'
an d $ " ll # od els.
Su pplier-t o-consu mer fl ow using the Event/N otificati on Service.
-
8/8/2019 NEW CORBA
74/96
EJBs and CORBA components
CORBA Component Model (CCM)Request for P roposal (R FP ) recommendsthe JavaBeans component model as basisof a server-side frame work.CORBAcomponents based on Component Implementation F ramework (CI F )
architecture.CIF defines superset of Persistent StateDefinition Language called Component
IDL (CIDL)
EJB d CORBA
-
8/8/2019 NEW CORBA
75/96
EJBs and CORBAcomponents(cont.)
IDL ke y w o r d s t o su p p o r t t h e C O RBAC o m p o n e n t M o d e l ( C C M )
compo nent h om e pr ovides
consu m es i mpo rt set R aisesem its l ocal su ppo rt s
finder m ulti p le ty peIdget R aises pri m aryKey ty pePrefix
F ig. 27.4 IDL ke y w o rd s t o su p p o r t t h e C O RBA C o m p o n e n t M o d e l .
EJB d CORBA
-
8/8/2019 NEW CORBA
76/96
EJBs and CORBAcomponents(cont.)
Component Interface Definition Language(CIDL) is a superset of Persistent StateDefinition Language. defines
components in a way that enables automaticgeneration of components persistence code.component implementationstate management
compiled with a CIDL compiler
Developers organize components as anassembl with a descri tor .
EJB d CORBA
-
8/8/2019 NEW CORBA
77/96
EJBs and CORBAcomponents(cont.)
A Container class creates a containmenthierarchy grouping components and other containers together.Container programming model is a runtimeenvironment in which componentimplementations use their enclosing
containers to access various services thecontainer provides.
EJB d CORBA
-
8/8/2019 NEW CORBA
78/96
EJBs and CORBAcomponents(cont.)
Four areas make up CCM container programming model:
1 . External typesinterfaces seen by client wanting to communicate withcomponent
2. Container typesAPI component uses to communicate with runtimecontainer
3. Container Implementation typesdifferent containers have different relationships withsurrounding system. Three types: stateless ,conversational , and durable . Each type defines itssystem support
EJB d CORBA
-
8/8/2019 NEW CORBA
79/96
EJBs and CORBAcomponents(cont.)
Using a containers internal interfaces, acomponent has full access to services acontainer supports Container defines APIs for:
component securitypersistencetransactionseventslifecycle
Component implements call-back interfaces
to allo w container-to-component
EJB d CORBA
-
8/8/2019 NEW CORBA
80/96
EJBs and CORBAcomponents(cont.)
Components can be either transient, or
can only be created by factories
do not have primary keys
persistentcan be created by factories and located by findershave primary keyssupport t wo forms of persistence container managed component managed
EJB d CORBA t
-
8/8/2019 NEW CORBA
81/96
EJBs and CORBAcomponents(cont.)C o m p o n e n t Ty p e 0 e sc r ip t io n
S e r v i c e 1 o e s n o t m a i n t a i n s t a t e i n2
o r m a t i o n ( c o m p l e t e l y s t a t e l e s s )1 o e s n o t h a v e a u n i q u e i d ( p r i m a r y k e y )
Im p le m e n t s n e e d e d b e h a v i o r ( e . g . , c a l c u l a t e I n t e r e s t ,a d d I t e m T o S h o p p i n g C a r t , e t c . )
C a n u s e t r a n s a c ti o n s , i s n o t i n c lu d e d i n t h e c u r r e n tt r a n s a c t i o n
S e s s i o n M a i n t a in s i n t e r n a l -s t a t e i n 3 o r m a t i o n4 a s a u n i q u e i d t h a t i s u s a b l e o n l y b y i t s c o n t a i n e r
Im p le m e n t s n e e d e d b e h a v i o r C a n u s e t r a n sa c t i o n s , b u t i s n o t i n c lu d e d i n t h e c u r r e n t t r a n s a c t i o n M a p s t o S e s s i o n 5 J B s
6
n t i t y C o n t a i n e r - o r c o m p o n e n t - m a n a g e d p e r s i s t e n t s t a t e4 a s a u n i q u e i d ( p r i m a r y k e y )
Im p le m e n t s n e e d e d b e h a v i o r t h a t i s o p t i o n a l l y t r a n s a c t i o n a l M a p s t o 5 n t i t y 5 J B s
7
r o c e s s C o n t a i n e r - m a n a g e d o r c o m p o n e n t - m a n a g e d p e r s i s t e n t s t a te t h a t i s i n a c c e s s i b l e t o c l i e n t s
C o n t a i n e r - m a n a g e d o r c o m p o n e n t - m a n a g e d p e r s i s t e n c e o f t h e c o m p o n e n t s p r i m a r y k e y ( i d e n t i t y ) 8 i t h v i s i b i l i t y o f t h e p r i m a r y k e y t h r o u g h u s e r - d e f i n e dm e t h o d s
Im p le m e n t s n e e d e d b e h a v i o r a n d t h e b e h a v i o r is o p t i o n a l l y t r a n s a c t i o n a l
F i . . 5 C O R B A c 9 @ A 9 B C B t t y p e s D B E E e sc r i p t i 9 B s.
EJB d CORBA t
-
8/8/2019 NEW CORBA
82/96
EJBs and CORBAcomponents(cont.)
Activation and passivation are actionsaround invocation boundaries of anobject operation.
activation lifecycle1 . request arrives to ORB to invoke operation on object2. ORB sends request to POA3. POA sends request to container managing component
4. container activates object
passivation policies defined by componentsdeployment information
EJB d CORBA t
-
8/8/2019 NEW CORBA
83/96
EJBs and CORBAcomponents(cont.)
In distributed systems, clients dont createremote objects. Clients discover remoteobjects. discovery through file containing objects IOR discovery through Naming Service
Factories ( ComponentHome instances) of remote systems create objects for their corresponding systems. component definition must define component
factory
EJB d CORBA t
-
8/8/2019 NEW CORBA
84/96
EJBs and CORBAcomponents(cont.)
CORBAcomponents use subset of CORBAservices for Component ImplementationFrame work.
Security Serviceevery component may have o wn security requirement
defined in components deployment descriptor
container must keep track of active policies and apply them
Object Transaction Service (lite version)container can control transaction boundariescomponent can control transaction boundaries
Persistent State Servicecontainer-managed persistence, PSS transparent to
component
EJB d CORBA t
-
8/8/2019 NEW CORBA
85/96
EJBs and CORBAcomponents(cont.)
Notification Serviceaccessed indirectlycontainer mediates use of event service by
componentcontainer does not preclude direct use of Notification Service
component developers are encouraged to define eventsin IDL as way of keeping components functional
description in one locationkeywords:
publishes any number of consumers can subscribe to an event methods declared with publishes expected to be part
EJBs and CORBAcomponents
-
8/8/2019 NEW CORBA
86/96
EJBs and CORBAcomponents(cont.)
CCM and EJB models are similar.CCM specification defines t wo componentlevels basic
mirrors EJB model almost exactlysingle threaded
uses security, transaction and persistence servicesonlyexposes only single interface
extended
can expose multiple interfaces
-
8/8/2019 NEW CORBA
87/96
CORBA vs. RMI
CORBA is comprehensive vie w of distributed systems architecture.RMI describes only communicationproxies and protocols bet ween clientobject and server object.
-
8/8/2019 NEW CORBA
88/96
When to Use RMI
RMI suitable for smaller distributedapplications in which scalability,architecture, heterogeneity, andextensibility are not major concerns.Mapping of RMI and RMI capabilities toOMA encompasses only Applications
Objects and the ORB.RMI does not define Quality of Service or asynchronous invocations.
RMI does not offer POA or range of
-
8/8/2019 NEW CORBA
89/96
-
8/8/2019 NEW CORBA
90/96
When to Use CORBA
CORBA defines and providesimplementations to many commonrequirements for most complex distributedsystems: architecture Quality of Service (QoS)
Scalability Heterogeneity Extensibility
-
8/8/2019 NEW CORBA
91/96
RMI-IIOP
SUN and IBM implemented RMI-over-IIO P (RMI-IIOP ) to replace RMIs underlyingcommunication protocol ( J ava Remote Method P
rotocol or J
RM P ).
Inprise, Netscape, Oracle, Sun and IBMspecified reverse mapping of Java-to IDL. Mapping limitations:
Constants can be of primitive types or of classjava.lang.String onlyIDL normally does not support overloading of method names.A class cannot inherit a method with same signature fromtwo different interfaces.
Interfaces and value types must be public .
-
8/8/2019 NEW CORBA
92/96
RMI-IIOP (cont.)
runtime limitations:sending a tree graph from ORB to ORB may beproblematic if multiple nodes point to one object
CORBA does not define distributed garbagecollectionCasting stubs may not work properly, so using thestatic method narrow of classjava.rmi.PortableRemoteObject isencouraged.RMI downloads the stubs needed by client,CORBA does not.
-
8/8/2019 NEW CORBA
93/96
RMI-IIOP (cont.)
steps involved in writing distributedapplication using RMI-IIOP:
use javax.rmi.PortableRemoteObject
instead of usingjava.rmi.UnicastRemoteObjectuse JNDI ( J ava Naming and Directory Interface)instead of RMI Registrydo not do wncast remote objects to subclass types;use method narrow of classPortableRemoteObject to cast distributedobjects as subclass types
RMIMessenger Case Study
-
8/8/2019 NEW CORBA
94/96
RMIMessenger Case StudyPorted to RMI-IIOP
Porting RMI messenger example(Chapter 1 3) to RMI-IIOP is easier thanporting application to CORBA. remote interfaces remain same support classes remain same ne w implementations for
ChatServer remote interface(ChatServerImpl ),ChatServerAdministrator
MessageManager interface
(RMIIIOPMessageManager )
ChatServer RMI-IIOP
-
8/8/2019 NEW CORBA
95/96
ChatServer RMI-IIOPImplementation
ChatServerImpl implements ChatServer remote interface
subclass of class
javax.rmi.PortableRemoteObject does not implement method register handles registration with name services
-
8/8/2019 NEW CORBA
96/96
Future Directions
OMA guiding document for CORBAsystems falls short in average-size systems
CORBA Component Model abstracts system issues through programming
constructs:
containerssubsystems
CORBA working on architectural process