Application Servers G22.3033-011
Session 5 - Main Theme Object Management Architectures
Dr. Jean-Claude Franchitti
New York University Computer Science Department Courant Institute of Mathematical Sciences
1
Agenda
COM and COM+
Introduction to .Net
Component Technologies
Object Management Architectures
Java-Based Application Servers
Windows Services
Summary
Readings
Assignment #5
2
1 Summary of Previous Session
CORBA
Inprise VisiBroker Environment
Orbacus
RMI and RMI-IIOP
DCOM
DOC Platform Interoperability
Web-Enabled DOC Applications
Summary
Readings
Assignment #4
3
Application Servers Architectures
Application Servers for Enhanced HTML (traditional)
a.k.a., Page-Based Application Servers
Mostly Used to Support Standalone Web Applications
New Generation Page-Based Script-Oriented App. Servers
First Generation Extensions (e.g., Microsoft IIS with COM+/ASP)
Servlet/JSP Environments
XSP Environment
Can now be used as front-end to enterprise applications
Hybrid development environments
Distributed Object Computing Platforms
Provide an infrastructure for distributed communications enabling
Still need to merge traditional web-oriented computing with object computing
Object Management Architectures 4 DOC Platform + APIs to reusable services and facilities
2 Part I
COM and COM+
5
COM Overview
• COM history • COM fundamentals: client and server communication • Interfaces in COM • How objects are created in COM
6
3 COM history
• 1988: Seed work for COM began inside MS – Influenced by prior work done in Smalltalk, C++, and OSF Distributed Computing Environment (DCE) • OLE(Object Liking and Embedding) – solved the problem of compound documents • DDE(Dynamic Data Exchange) – allowed applications to communicate, but had bad performance
7
COM History (continued)
• 1993: First public release of COM as part of OLE 2.0 SDK – provided automation – but local communications & 16-bit/single-threaded only • 1994: Windows NT 3.5 ships – 32-bit support + Interface Definition Language – upgraded for better performance – provided multiple thread support
8
4 COM History (continued)
• 1992: Work begins on “Viper” project – First artifact is Distributed Transaction Coordinator (DTC) that ships with SQL Server • 1996: Windows NT 4.0 – DCE-based Distributed COM (DCOM) protocol – Better threading/security support • 1996: Microsoft Transaction Server (MTS) 1.0 – Component-based Distributed Application Framework • 1998: Windows NT 4.0 Option Pack – MTS 2.0,MSMQ 1.0, Internet Information Server 4.0 • 2000: Windows 2000 – MTS/COM Integration, new MTS-esque services, Improvements to the remoting infrastructure 9
3 fundamental ideas of COM/COM+
• Clients program in terms of interfaces, not classes • Implementation code is not statically linked, but rather loaded on-demand at runtime • Developers declare their runtime requirements and the system ensures that these requirements are met • The former two are the core of classic COM • The latter is the core of MTS and COM+
10
5 Using COM
• COM is used primarily for two tasks • Task 1: Gluing together multiple components inside a process – Class loading, type information, etc • Task 2: Inter-process/Inter-host communications – Object-based Remote Procedure Calls (ORPC) • Pros: Same programming model and APIs used for both tasks • Cons: Same programming model and APIs used for both tasks • Design around the task at hand
11
COM basics
IUnknown
IClassFactory Class Factory Client
Object Registration Packaging
Component
12
6 COM vocabulary
• Interface - abstract data type used by clients to talk to objects • Class - concrete data type written by developers to support one or more interfaces • Object - entity in memory that supports one or more interfaces (typically an instance of a class) • Component - loadable code module that exposes one or more COM classes • GUID - 128-bit identifier used to name an interface(IID) or a class(CLSID)
13
Expanded Definitions
• Two key terms have been defined so far • A COM Interface is a collection of abstract operations one can perform on an object – Must extend IUnknown directly or indirectly – Identified by a UUID (IID) – Platform-specific vptr/vtable layout • A COM Object is a collection of vptrs in memory that follow the COM identity laws – Must implement at least one COM interface – QueryInterface ties vptrs together into cohesive object
• Objects assumed to materialize automatically 14
7 Expanded Definitions (continued)
• A COM Class (or coclass) is a named body of code that can be used to produce COM objects • All coclasses are named by a UUID (CLSID) • All coclasses have a distinguished object that is used to create new instances – Called a class object or class factory – Typically implements IClassFactory • All coclasses loaded on demand by class loader – Called the Service Control Manager or (SCM) • For efficiency, a single component DLL can support multiple COM classes
15
Classes, Class Objects, And Components
Component DLL Class Instances
Class A Class B Class C
Class Objects
16
8 Class Versus Type
• An Interface represents a data type suitable for declaring variables – Non-trivial operations – Hierarchical with respect to one another – Polymorphic with respect to different objects • A Class represents loadable concrete code used to create objects – Resultant objects implement one or more interfaces • Class unsuitable for declaring variables – Entire motivation for interface-based programming based on relative uselessness of class
17
Class Versus Type
IAnimal
IMammal
IDog ICat IBird
Interfaces
Classes DogCat Robin
Pug Siamese Parrot 18
9 3 types of servers in COM
Local COM Server In-Process Server (DLL) DCOM Remote Client Application Server
Computer A Computer B
19
COM Proxies and stubs
Client Server Proxy Stub RPC DCOM/COM DCOM/COM
1. Use midl compiler to generate necessary files 2. Files generated by midl compiler are packaged in a DLL with make command 3. Register your proxy-stub DLL in the system registry with regsrv32 command 4. The proxy-stub DLL must be installed on every machine
20
10 Interfaces in COM
• An interface is not a class – cannot be instantiated, different classes can implement it differently • Interfaces are strongly typed – every interface has it’s globally unique identifier(GUID) • Interfaces are immutable – cannot delete, any change considered to be a new interface • Clients only interact with pointers to interfaces – pointers hide all aspects if implementation • Objects can implement multiple interfaces
21
Interface Architecture
Interface component pointer Vtable function1
Pointer to Function1 Vtable pointer Pointer to Function2 function2 Pointer to Function3
function3
COM interface is a binary description of the layout of a block of memory containing an array of function pointers(vtable). The pointers of the array point to the functions of a COM object that can be called by a consumer of the interface
22
11 Standard and Custom Interfaces
• Standard interface IUnknown • Has 3 functions: – ULONG AddRef(); object – ULONG Release();
– HRESULT QueryInterface(REFIID riid, void **ppvObject); • All objects will have at least two interfaces: IUnknown and a custom interface • Custom interfaces are derived from IUnknown
23
Defining interfaces with IDL
// File Ch3CompCppServer.idl : This file will be processed by the MIDL tool to produce the type library // Ch3CompCppServer.tlb and marshalling code.
[ uuid (B5F3E2FE-B376-11D1-BB1E-00207812E629) ] interface IAccount : Iunknown attributes { [propget, helpstring("property Balance")] HRESULT Balance ([out, retval] double *pVal);
[propget, helpstring("property Name")] HRESULT Name([out, retval] BSTR *pVal); };
•Every interface method must return HRESULT •32bit integer divided into 3 fields •0-15bits indicate severity •16-30 facility (RPC, Win32 etc) •1 bit to indicate success or failure
24
12 Defining interfaces with IDL (continued)
//File Ch3ComCppServer.idl continued [ uuid (B5F3E2F0-B376-11D1-BB1E-00207812E629) ] library CH3COMCPPSERVERLib //will produce a type library - file that describes an object in a //standardized format to show what properties are supported { importlib("stdole32.tlb"); importlib("stdole2.tlb"); [ uuid (B5F3E300-B376-11D1-BB1E-00207812E629) ] coclass Ch3CheckingAccount // Ch3CheckingAccount Class { interface IAccount; interface IAccountInit; [default] interface ICheckingAccount; }; }; //after type library is created it’s location is registered in the system registry
25
COM client using an object
1. Identify the class of object to use. 2. Obtain the “class factory” for the object class and ask it to create an uninitialized instance of the object class, returning an interface pointer to it. 3 Initialize the newly created object by calling an initialization member function of the “initialization interface,” that is, one of a generally small set of interfaces that have such functions. 4 Make use of the object which generally includes calling QueryInterface to obtain additional working interface pointers on the object. The client must be prepared for the potential absence of a desired interface. 5 Release the object when it is no longer needed.
26
13 COM client using an object
(continued) Step1: Identify the class of object to use • A Client has a CLSID (Class Identifier) of a class it needs • All CLSIDs are stored in the registry HKEY_CLASSES_ROOT CLSID {E312522E-A7B7-11D1-A52E-0000F8751BA7}="Foo Class" InprocServer32="D:\\ATL Examples\Foo\\Debug\\Foo.dll" • Client need not know nor care how this information is maintained
27
COM client using an object
(continued) Step 2: Creating the Object 1 Obtain the “class factory” for the CLSID. 2 Ask the class factory to instantiate an object of the class, returning an interface pointer to the client. Server
(1) “Create an Object” Client Class Factory
(3) Return new (2) Manufacture interface pointer Object to client
Object
28
14 COM client using an object
(continued) Class Factory explained • An object that exists to manufacture objects of a specific class • A class factory object is implemented by a server module, either a DLL or EXE • Supports the IClassFactory interface with 2 functions: – CreateInstance - uninitialized instance,object, of the class associated with the class factory, returning an interface pointer of type iid on the object – LockServer - called by a client to keep a server in memory even when it is servicing no objects
29
COM client using an object
(continued) Step 2: Obtaining the Class Factory Object • Client generates a call to the COM Library function CoGetClassObject • The function obtain a class factory object for the given CLSID and return one of that class factory’s interface pointers to the client • After that the client may calls IClassFactory::CreateInstance to instantiate objects of the class • The caller must call IClassFactory::Release after it has finished using the class factory object • IClassFactory::coCreateInstance combines all three above functions within it 30
15 COM client using an object
(continued) Steps 3&4:Initializing and managing the Object • IClassFactory::CreateInstance initializes an object • How to get interface pointer to other interfaces of the obtained object? –Cannot use CreateInstance again (why?) – Use QueryInterface function( remember it’s part of IUnknown, so all interfaces have it) • Client must be prepared for the failure of a call to QueryInterface • Don’t forget to release all interface pointers when you are done
31
COM client using an object
(continued) Step5: Releasing an object • Achieved by calling the Release member function of all interfaces obtained during the course of using the object • Use reference counter to determine lifetime of an object. Increment on CreateInstance and QueryInterface • Client is responsible for matching any operation that generates a call to AddRef through a given interface pointer with a call to Release through that same interface pointer
32
16 The COM Runtime Environment
• The infrastructure used to support COM on a given platform is called the COM library • Each thread that uses COM library must setup/teardown thread- specific data structures – CoInitialize[Ex] and CoUninitialize do this for you • The COM library implemented in several DLLs – OLE32.DLL – core class/interface functionality – OLEAUT32.DLL – Visual Basic®-centric type infrastructure • Inproc class loading done in OLE32.DLL • Cross-process/host class loading performed by Windows NT® Service (RPCSS.EXE)
33
The COM Runtime Environment
Foo.dll
Bar.exe
Bar.exe OLE32.DLL
OLE32.DLL OLE32.DLL
RPCSS.EXE RPCSS.EXE34
17 COM Class Loading • Clients issue activation calls against the SCM • SCM responsible for locating component and loading it into memory • SCM queries component for class object and (optionally) uses it to instantiate new instance • Once SCM returns a reference to class instance/class object, SCM out of the picture • Based on configuration, COM may need to load component in separate process (potentially on different machine) 35
COM Class Loading And Locality
• All activation calls allow client to indicate locality – SCM chooses most efficient allowed by client
CLSCTX_INPROC_SERVER // load in client process CLSCTX_INPROC_HANDLER // use OLE Document rendering handler CLSCTX_LOCAL_SERVER // load in separate process CLSCTX_REMOTE_SERVER // load on distinct host machine CLSCTX_SERVER // CLSCTX_*_SERVER CLSCTX_ALL // CLSCTX_*
typedef struct _COSERVERINFO { DWORD dwReserved1; // m.b.z. const OLECHAR *pwszName; // host name COAUTHINFO *pAuthInfo; // security goo DWORD dwReserved2; // m.b.z. } COSERVERINFO; 36
18 Using The SCM
• The SCM exposes two core activation APIs • Both APIs load components automatically • Both APIs accept a CLSID and information about component location as input parameters • CoGetClassObject returns class object/factory – No new instances created • CoCreateInstanceEx uses IClassFactory interface on class object to create new instance – Class object never returned to client
37
CoGetClassObject/IClassFactory interface IClassFactory : IUnknown { // create a new com object HRESULT CreateInstance([in] IUnknown *pUnkOuter, [in] REFIID riid, [out,retval,iid_is(riid)] void **ppv); // hold component code in memory HRESULT LockServer([in] BOOL bLock); }
HRESULT CoGetClassObject( [in] const CLSID& rclsid, // which class? [in] DWORD dwClsCtx, // locality? [in] COSERVERINFO *pcsi, // host/sec info? [in] REFIID riid, // which interface? [out, iid_is(riid)] void **ppv // put it here! 38 );
19 Example
void CreatePager(IPager *&rpp, IMessageSource *&rpms) { IClassFactory *pcf = 0; rpp = 0; rpms = 0; // ask SCM to load class code for Pager HRESULT hr = CoGetClassObject(CLSID_Pager, CLSCTX_ALL, 0, IID_IClassFactory, (void**)&pcf); if (SUCCEEDED(hr)) { // ask class code to create new class instance hr = pcf->CreateInstance(0, IID_IPager, (void**)&rpp); if (SUCCEEDED(hr)) hr = rpp->QueryInterface(IID_IMessageSource, (void**)&rpms); pcf->Release(); } }
39
Example
Client.exe mobile.dll
2 rpp rpms 3
4 pcf 1
1 Client calls CoGetClassObject
2 Client calls CreateInstance on Class Object 3 Client calls QueryInterface on Class Instance 40 4 Client calls Release on Class Object
20 CoGetClassObject Pitfalls
• Previous example made at least four round- trips in distributed case – One for CoGetClassObject – One for CreateInstance – One for QueryInterface – One for IClassFactory::Release • Superior solution would perform class loading and object creation in one round trip • Solution: CoCreateInstance[Ex]
41
CoCreateInstanceEx
typedef struct { const IID *pIID; IUnknown *pItf; HRESULT hr; } MULTI_QI; HRESULT CoCreateInstanceEx( [in] const CLSID& rclsid, // which class? [in] IUnknown *pUnkOuter, // used in aggregation [in] DWORD dwClsCtx, // locality [in] COSERVERINFO *pcsi, // (opt) host/sec. info [in] ULONG cItfs, // # of interfaces [in, out] MULTI_QI *prgmqi // put them here! ); HRESULT CoCreateInstance( [in] const CLSID& rclsid, // which class? [in] IUnknown *pUnkOuter, // used in aggregation [in] DWORD dwClsCtx, // locality? [in] REFIID riid, // which interface? [out, iid_is(riid)] void **ppv // put it here! 42 );
21 Example void CreatePager(IPager *&rpp, IMessageSource *&rpms) { rpp = 0; rpms = 0; // build vector of interface requests MULTI_QI rgmqi[] = { { &IID_IPager, 0, 0 }, { &IID_IMessageSource, 0, 0 } }; // ask COM to load class code and create instance HRESULT hr = CoCreateInstanceEx(CLSID_Pager, 0, CLSCTX_ALL, 0, 2, rgmqi); // extract interface pointers from rgmqi vector if (SUCCEEDED(hr)) { if (hr == S_OK || SUCCEEDED(rgmqi[0].hr)) rpp = reinterpret_cast
Exposing COM Classes
• Component DLLs export a well-known function used by COM to extract class object from DLL STDAPI DllGetClassObject( [in] REFCLSID rclsid, // which class? [in] REFIID riid, // which interface? [out, iid_is(riid)] void **ppv // put it here! ); • DllGetClassObject called by CoGetClassObject and CoCreateInstance[Ex] to access class object – Never called directly by client code • If DLL doesn’t export DllGetClassObject, all activation calls will fail
44
22 DllGetClassObject
CoCreateInstanceEx
COM
DllGetClassObject ICF::CreateInstance
IPager Pager IMessageSource Class Instance
IClassFactory Pager IPager Pager Class Object IMessageSource Class Instance
IClassFactory CellPhone ICellPhone CellPhone Class Object IMessageSource Class Instance 45
Exposing Class Objects/Inproc
PagerClassObject g_coPager; CellPhoneClassObject g_coCellPhone;
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void**ppv) { if (rclsid == CLSID_Pager) return g_coPager.QueryInterface(riid, ppv); else if (rclsid == CLSID_CellPhone) return g_coCellPhone.QueryInterface(riid, ppv); *ppv = 0; return CLASS_E_CLASSNOTAVAILABLE; }
23 Finding Components
• All COM classes registered under distinguished key in registry (HKEY_CLASSES_ROOT) – Holds machine-wide configuration under Windows NT 4.0 – Magic key under W2K that merges machine-wide registration with current user’s private configuration • Can also register text-based aliases for CLSIDs called ProgIDs for GUID-hostile environments • REGSVR32.EXE used to install component DLLs that export two well-known entry points – STDAPI DllRegisterServer(void); – STDAPI DllUnregisterServer(void);
47
CLSID And The Registry
HKEY_CLASSES_ROOT
CLSID
{CLSID_Pager} {CLSID_CellPhone}
@=Pager @=CellPhone
InprocServer32 InprocServer32
@=C:\bin\mobile.dll @=C:\bin\mobile.dll
LocalServer32
@=C:\bin\phones.exe 48
24 ProgIds And The Registry
HKEY_CLASSES_ROOT
CLSID Commlib.Pager.1
@=Pager {CLSID_Pager}
@=Pager CLSID
ProgID @={CLSID_Pager}
@=Commlib.Pager.1 HRESULT ProgIDFromCLSID( [in] REFCLSID rclsid, InprocServer32 [out] OLECHAR **ppwszProgID); HRESULT CLSIDFromProgID( [in] OLECHAR *pwszProgID, @=C:\bin\mobile.dll [out] CLSID *pclsid); 49
COM Classes And IDL
• COM classes can be declared in IDL using coclass statement • Coclass statement generates class entry in TLB • Coclass statement generates CLSID_XXX variables in generated C(++) headers – Generates __declspec(uuid) statements as well • Coclass statement allows mimimum supported interfaces to be listed as well
Async Calls [ uuid(03C20B33-C942-11d1-926D-006008026FEA) ] coclass Pager { [default] interface IPager; interface IMessageSource; } 50
25 Interception
• In general, it is better to leverage platform code than to write it yourself – Thread scheduler, file system, window manager • Classically, the platform has been exposed through explicit APIs and interfaces – Requires some code on your part to utilize • COM started to expose the platform through interception – COM puts a middleman between the client and object – Middleman makes calls to the platform on object’s behalf both before and after object’s method executes 51
Interception Basics
• To provide a service, the system must intercept all calls to your object • Interceptors pre- and post-process every call – Interceptors make system calls on your behalf – Interceptors set up the runtime environment for your method calls – Interceptors may fail the method call without your participation • Interceptors must know what your interfaces look like – All interfaces exposed by configured components require specially prepared P/S DLL or a type library
52
26 Interception And Interfaces
• Interception needs type info for all interfaces • Interfaces marked [dual] and [oleautomation] can simply rely on type library – Parameter types limited to VARIANT-compatible • Interfaces not marked [dual] or [oleautomation] require a specially prepared proxy/stub DLLs – Run MIDL compiler using /Oicf flag – Compile foo_i.c, foo_p.c and dllhost.c using /MD switch – Link P/S dll against MTXIH.LIB, OLE32.LIB and ADVAPI32.LIB before any other libraries • Registering P/S DLL or (dual/oleautomation) TLB inserts entries under HKCR\Interfaces
53
Proxy/Stub Dlls And The Registry
HKEY_CLASSES_ROOT
CLSID Interface
{CLSID_PSComm} {IID_IPager} {IID_IMessageSource}
@=PSFactoryBuffer @=IPager @=IMessageSource
InprocServer32 ProxyStubClsid32 ProxyStubClsid32
@=C:\bin\cmps.dll @={CLSID_PSComm} @={CLSID_PSComm}
ThreadingModel=both
54
27 COM + Overview
• Define COM+ – Terms to help explain what COM+ is • COM+ Architecture – Windows DNA: • Distributed interNet Application Architecture • 3-tier application architecture • Family of supporting technologies / services –COM+ • Key concepts of the COM+ architecture • COM+ Services
55
Defining COM+
•MTS ≡ Application Server* – defined a programming model for developing distributed, component- based applications – Provided a run-time environment and user interface for deploying and managing applications •DCOM: – That part of COM concerned with enabling components over a network – Provides network communication infrastructure and support for security – Does not provide many things that enterprise-class applications need: • EX: Distributed transactions, scalability, fine-grained security, etc..
*Application server: handles transactions between users and business backend business application
56
28 Defining COM+ (continued)
•COM+ – Builds on the distributed infrastructure provided by DCOM and tightly integrates the features of MTS – Set of system services for COM-based applications designed to make it easy to develop enterprise-class distributed applications. – COM+ is a runtime environment* for COM objects
*Run-time environment: one that provides data and functions to the program while it is running
57
Windows DNA
Databases
Legacy Systems
External Thin Applications Client
Rich Client Application Services Client Executable Business Objects ODBC Web Browser IIS/ASP OLEDB PDA COM+ HERE ADO 58
29 Windows DNA
• 3 Logical Layers: – Presentation Layer • Basically handles graphical display and processing of user inputs • VB, HTML, DHTML, Applets, Plug-ins, client/server scripting, etc. –Business Layer • Provides business rules and services to help to write scalable applications • Services of COM+ – Data Layer • Responsible for storage, retrieval, and general maintenance of data as well integrity of data. • The Windows DNA approach of data access is called "Universal Data Access.
59
COM+ Web Application
ASP DHTML HTTP IIS
B.O.
SQL D.O. ADO Server
COM+
Presentation Business Data
60
30 COM+ Architecture: Key Concepts
• Attribute-based Programming: – To use COM+ services, simply set the attributes provided to define these services – Administer COM+ attributes through Component Services Explorer, a snap-in for MMC* • ≡ Catalog Manager: holds the values of the attributes
Catalog Attributes
*MMC: Microsoft Management Console: common tool to administer all of Microsoft’s Server 61 Applications
COM+ Architecture: Key Concepts (continued)
• Context: – The runtime environment in which one/more compatible COM+ objects in a particular process execute – Think of this as a boundary around objects sharing the same properties • All objects in a single context have compatible attributes • Objects with at least one incompatible attribute must have different contexts • Each object belongs to exactly one context
Context A Context B Context C 62 Process X Process Y
31 COM+ Architecture: Key Concepts (continued)
• Interception – The process of performing COM+ services both before and after a method call on a COM+ object when the client of a COM+ object resides in a different Context from the object – Lightweight proxy called an interceptor is set up between the client and the object – Lightweight proxy: • Never does a thread or process switch. Only provides whatever actions are necessary to make sure that a COM+ object always runs within its configured environment
63
Example: Interception
1 3
5 1 Client issues call 2 Interceptor requests lock
3 Once lock acquired, call dispatched 4 Once call complete, Interceptor Your Object interceptor releases lock 5 Control returned to client m_pActivity Object Context
2
4
Activity X 64
32 Configured Components
• Problem: If goal is to write little or no code, how do we configure interceptor to do its magic? • Solution: Declarative attributes • Classes that require extended services must indicate this declaratively • COM+/MTS introduce the notion of configured components • Configured components are classes that have extended attributes that control interception • Configured components always DLLs – MTS/COM+ use surrogate for remote/local activation
65
Configured Components
• MTS and COM+ have radically different details wrt how configuration information is stored and used • Both use HKEY_CLASSES_ROOT\CLSID • Both store information in auxiliary storage • Details abstracted away behind catalog manager
Auxiliary Configuration Database
Catalog Manager
HKEY_CLASSES_ROOT\CLSID 66
33 Configured Components - MTS Style
• MTS layers on top of classic COM • Runtime services provided by MTS executive – Lives in MTXEX.DLL • MTS CatMan stores MTXEX.DLL under HKCR to ensure MTS gets between client and object – Stores component filename in aux database
Auxiliary Configuration Database CLSID_Pager=PAGER.DLL Catalog Manager HKEY_CLASSES_ROOT\CLSID InprocServer32=MTXEX.DLL 67
Configured Components - COM+ Style (continued)
• Under COM+, runtime services provided by COM itself • CoCreateInstance is smart enough to consult auxiliary information at activation-time • COM+ CatMan stores still manages extended attributes in auxiliary database
Auxiliary Configuration Database CLSID_Pager=LoadBalance+Pooling Catalog Manager HKEY_CLASSES_ROOT\CLSID InprocServer32=PAGER.DLL 68
34 Packages/Applications
• The catalog manager segregates classes into COM+ applications (or MTS packages) • Each configured class belongs to exactly one application • All classes in an application share activation settings • Configuration orthogonal to physical packaging – x classes from y DLLs mapped into z applications • Applications can be configured to load in activator’s process (library) or in distinct surrogate process (server)
69
x Classes, y Dlls, z Applications/Packages
OneAndTwo.dll ThreeAndFour.dll
Three One Two Four
DLLs
Packages/Apps
One Two Three Four
OneAndFour Application TwoAndThree Application
70
35 Attributes
• The catalog stores attributes that the runtime interrogates to build an interceptor • The set of attributes is fixed • Applications/packages, classes, interfaces and methods can all have attributes • Can set attributes using COM+/MTS explorer • Future goal was to be able to set all attributes from development environment
71
Attributes: Applications/Packages
Activation Library (inproc)/Server (surrogate) Type Authentication None, Connect, Call, Packet, Integrity, Privacy Level Impersonation Identify, Impersonate, Delegate Level Authorization Application Only/Application + Component Checks Security Interactive User/Hardcoded User ID + PW Identity Process Never/N minutes after idle Shutdown
Debugger Command Line to Launch Debugger/Process
Enable Compensating On/Off Resource Managers Enable 3GB On/Off Support
Queueing Queued/Queued+Listener
72 Underlines indicate settings available under MTS
36 Attributes: Classes, Interfaces, And Methods
Transaction Non Supported, Supported, Required, Requires New Class
Synchronization Non Supported, Supported, Required, Requires New Class
Object Pooling On/Off, Max Instances, Min Instances, Timeout Class
Declarative Arbitrary Class-specific String Class Construction
JIT Activation On/Off Class
Activation-time On/Off Class Load Balancing Instrumentation On/Off Class Events Declarative Class Zero or more role names Interface Authorization Method
Auto-Deactivate On/Off Method
Must Activate in On/Off Class Activator’s Context 73 Underlines indicate settings available under MTS
Exporting Packages/ Applications
• MTS/COM+ allow package/app configuration to be exported to the file system for distribution • MTS: Exporting produces a .PAK file that contains snapshot of catalog for the package – Also contains flattened references to all DLLs/TLBs • COM+: Exporting produces a single .MSI file that contains both catalog info and DLL/TLBs • .PAK/.MSI file can be imported on other host machines – Can be done remotely using remote catalog access
74
37 Package/Application Export Residue
MTS COM+
MYAPP.PAK MYAPP.MSI
Catalog info Catalog info
MYCOMP1.DLL MYCOMP1.DLL
code for some classes code for some classes
MYCOMP2.DLL MYCOMP2.DLL
code for other classes code for other classes
MYPS.DLL MYPS.DLL
proxy/stub code proxy/stub code 75
Server Packages/ Applications
• An application can be configured to activate as a library application or a server application – Server applications are the norm in MTS/COM+ • Only server applications support… – Remote activation – Complete Security Support – Insulating user of component from component faults • MTS Server packages are loaded by the MTS Surrogate (mtx.exe) • COM+ Server packages are loaded by default COM surrogate (dllhost.exe) – dllhst3g.exe if 3GB support is enabled in catalog
76
38 MTS Server Packages
CLIENT.EXE MTX.EXE
OLE32.DLL OLE32.DLL
MTXEX.DLL Proxy Interceptor
YOURSERVER.DLL You
You
77
COM+ Server Applications
CLIENT.EXE DLLHOST.EXE
OLE32.DLL OLE32.DLL
Proxy Stub(+)
YOURSERVER.DLL You
You
78
39 Library Applications/Packages
• Library applications/packages load in the creator’s process – Solves the “1 class used by 3 applications” problem • MTS catalog manager controls registry entries for components in library packages – Each class’s InprocServer32 key points to the MTS Executive (mtxex.dll) – MTS Executive creates interceptor between client and object based on catalog info – MTS Executive manages a thread pool to service activation calls and general housekeeping • Instances will always always be protected from concurrent access under MTS!
79
MTS Library Packages In Nature CLIENT.EXE
OLE32.DLL
MTXEX.DLL
Interceptor
YOURSERVER.DLL
You
80
40 How COM(+) Library Applications Work
• COM+ catalog manager leaves InprocServer32 entry alone – Additional attributes stored in aux config database • CoCreateInstance checks for extended attributes and creates an interceptor as needed • Instances may or may not be protected from concurrent access depending on configuration! – Default setting at install-time is protected, but can easily defeat using COM+ Explorer 81
COM+ Library Applications In Nature CLIENT.EXE
OLE32.DLL
Interceptor
YOURSERVER.DLL
You
82
41 COM+ Services
• Enterprise applications: – Most likely have requirements that restrict levels of access for different individuals • = security – Need to retrieve data from and update to one/more database servers • = transactions • = distributed transactions if updates have to be simultaneous – Need to be scalable: • = Load balancing • = JIT (Just In Time) Activation • = Object Pooling – Need parts the application to continue to function even if they are unable to communicate with the home office at that exact moment • = disconnected communications • Without COM+, writing enterprise applications for Windows platform would amount to thousands of lines of code.
83
COM+ Services
•Server • Load Balancing • Transaction • Queued Components • Security • Events • Administration
COM+ allows us to participate in the above services.
84
42 COM+ Security
• Fine-grained Security – Can control access to a server on a per-class, per- interface or per-method basis – Performed through attribute-based programming Æ no code to write • New security model: Role – Role: group of users of a COM+ application that have the same security profile – Specify through Component Services Explorer which roles are allowed to use a particular interface, component or method
85
COM+ Transactions
• Support for database services to ensure transactions are – Atomic: complete successfully or return to original state – Consistent – Durable: once updated, transaction is never lost • Transaction primitives: – Transaction.Begin – Transaction.Commit (applies all updates in atomic step) – Transaction.Rollback
86
43 COM+ Distributed Transactions
• Support to apply the same standard as transactions to distributed databases – All servers commit their part of the transaction or all must rollback • CRM: Compensating* Resource Manager – COM+ service to create custom resource managers
*Compensating Transaction: transaction that reverses the effects of a previous transaction 87
COM+ Scalability
• What happens when each client application creates a COM+ object and holds on to it for the life of the user’s session? – Problem: each object uses some memory and may have its own thread; possibly it also has a database connection. – Solution that is NOT scalable: • Instantiate all the objects client application needs when the application is started and hold on to those objects for the life of the application
88
44 COM+ Services: Scalability (continued)
• JIT Activation – Controlled using attributes just like all other COM+ services – Activate/Deactivate instances of objects during method calls • Client still holds proxy, server still holds stub for the object so as far as client is concerned, the object still exists – Object Pooling • COM+ Pool Manager maintains a pool of objects • When client attempts to activate object, COM+ runtime environment returns an instance from the pool if one is available, instead of creating a new object
89
COM+ Services: JIT
Client Process Server Process (DLLHost.exe)
Client Context Object’s Context
RPC COM+ JIT Proxy Channel Stub Interceptor Activated Object
The JIT Activated Object is destroyed or returned to the object pool after the method call completes.
90
45 Other COM+ Services
• Synchronization • Queued Components • Load Balancing
91
Summary
• The SCM dynamically loads COM class code • COM+ and MTS exposes services through interception • Components configure their interceptors through declarative attributes stored in a configuration database • MTS/COM+ consult configuration database at activation time • Classes are grouped into applications/packages • The catalog is a scriptable MTS/COM+ component
92
46 References
• Programming Dist Apps With Visual Basic and COM – Ted Pattison, Microsoft Press • Inside COM – Dale Rogerson, Microsoft Press • Essential COM(+), 2nd Edition (the book) – Don Box, Addison Wesley Longman • Essential COM(+) Short Course, DevelopMentor – http://www.develop.com • DCOM Mailing List – http://discuss.microsoft.com
93
Part II
Introduction to .Net Also See: Session 5 Sub-Topic 4 Presentation on “Introduction to .Net/C#” Session 5 Handouts from the Book “Computing with C# and the .Net Framework”
94
47 Section Outline
• What is .NET? • Introduction to concepts • Tour of the Framework • XML Web services and Industry standards • Transaction Management Using .NET Serviced Components and COM+ Services
95
Current Web App. Environment .NET vs. Java
.NET Windows ASP.Net VS.NET Client ADO.NET IIS COM+ Relational HTML WebService Database JavaScript SOAP System Browser
JSP/Servlets EJB JDBC WebSphere Wireless Device
Desktop Web Server App Server DB Server 96
48 So What really Is .NET?
• Software for connecting people, information, systems and devices? – Runtime for executing code – Tools to help develop applications – Server products to manage applications – Value-added services • Managed environment for developing and executing components
97
.NET Framework Design Goals
• Incorporate Web standards and best practices – Designed with security in mind • Unified programming models • Simplified development • Simple to deploy, run, & maintain
98
49 A Problem of Communication
Application
Code and data structures
Before RPC-style models, applications were completely separate entities with little or
no integration… 99
A Problem of Communication (continued)
…but with RPC or COM, you still have to write ‘plumbing’ code and can’t directly interact…
100
50 A Problem of Communication (continued)
… a common language runtime provides components a common substrate. No “plumbing” is needed and objects can directly interact. 101
Framework, languages and tools Visual Studio.NET VB C++ C# JScript J# Common Language Specification
ASP.NET Web Forms, Web Services Windows Forms Mobile Internet Toolkit Data (ADO.NET) and XML
Base Class Library / System Classes Web Matrix
Common Language Runtime
Windows COM+ Services 102
51 Common Language Runtime (CLR)
Base Class Library Support
Thread Support COM Marshaler
Type Checker Exception Manager
Security Engine Debug Engine
IL to Native Code Garbage Compilers Manager Collector
Class Loader 103
Multilingual Development
Fortran Perl Scheme Smalltalk Python Ada Component Pascal Oberon Mercury Visual Basic Delphi C# Oz C++
Mondrian C J# Pascal JScript Haskell Java Eiffel APL
104 Cobol RPG Objective Caml ML
52 What Is A Web Service?
Web Open Service Internet Protocols A programmable application component accessible via standard Web protocols
Provide a Directory of Services on the UDDI Internet Universal Description, Design, and Integration
Web Services are defined in terms of the WSDL Web Services formats and ordering of messages Description Language
Web Services consumers can send and SOAP receive messages using XML
105 Built using open Internet protocols XML & HTTP
ASP .NET Web Matrix Project
• Lightweight, simple, community-oriented tool for building ASP.NET apps • Full WYSIWYG support • Small (~ 1.4 Mb) • Community features – IM integration, code sharing, chat features • Available free-of-charge at www.asp.net
106
53 WYSIWYG Controls
Snippets and code sharing
Community Support
107
The Role of Open Standards
• .NET has been ratified through ECMA standards – ECMA-335 Common Language Infrastructure (CLI) – ECMA-334 C# Language – Participants include Intel, HP, IBM, Netscape • .NET is Microsoft’s commercial implementation of these standards • Some platform specifics have not been included – Windows Forms – ADO.NET
108
54 Shared Source CLI (Rotor)
• Non-commercial implementation • Available for research, academic and other non- profit use – Standards are available to everyone for profitable use too, of course • Written entirely in C# • Available for FreeBSD and WinXP – Ximian and Intel are developing Linux implementations at the moment • Implemented for teaching, learning and research
109
Transaction Management in .Net
• Local Transactions • Distributed Transactions • .NET Enterprise Services Transactions
110
55 Local Transactions • A transaction is a set of separate but interdependent changes that are made to some persistent data and that must be performed together as an atomic operation
• ACID Properties: • Atomicity • Consistency • Isolation • Durability
• Multiple select, insert, update, and delete operations are composed into a single atomic operation
• Local Transactions can be created by using: • Transact-SQL • ADO.NET
111
Distributed Transactions
• Microsoft Distributed Transaction Coordinator (DTC) • Manages connections to multiple databases • Manages connections from multiple database clients • Coordinates work into a single transaction
Server A TransactionDTC Connection Database #1
Server B
Connection Database #2
112
56 .NET Enterprise Services Transactions
• COM+ checks three bit flags to control transaction outcome and component life time • Per object context – Consistent flag and done flag • Per transaction – Abort flag
Transaction Stream Done Consistent Sub1 Done Root Consistent Root Client Done Consistent Sub2 Abort
113
Overview of COM+ Services and the .NET Serviced Components
• COM+ Services • COM+ Catalog • COM+ Context • COM+ Interception • How the .NET Framework Integrates with COM+ Services • How the .NET Serviced Components Works with COM+
114
57 COM+ Services
• COM+ is the application infrastructure in a multi-user environment that compose of the services that enable many users to access the application and underlying data at the same time. •COM+ Services: • Transactions • Compensating Resource Managers • Resource Management •Just-in-Time(JIT) Activation •Object Pooling • Synchronization • Security • Loosely Coupled Events • Queued Components
115
COM+ Catalog
• All configuration data is kept in a database • You use the catalog to determine run-time requirements when an object is activated Catalog • The catalog can be accessed by the Component Services tool or administrative API Application Type = Server Name = MyApp Application MyApp Component Name = MyClass Class MyClass
116
58 COM+ Context
• Context is a set of run-time requirements for a class • The COM+ catalog stores run-time requirements as attributes, which are checked during activation • Context properties flow with the method call, depending on configuration attributes
Process Context A Application Context B Attributes: Attributes: Transaction=Required Transaction=Required Synchronization=Supported Synchronization=RequiresNew Object A Object B
Properties: Properties: TransactionID=1234 TransactionID=1234 ActivityID=5678 ActivityID=9012
117
COM+ Interception
• Used to enforce context semantics • Transparent to the caller and the called • Activation interception and method-call interception
Client Process Application Context A Context B
Synchronization= Interception Synchronization= Not Supported Required
Object A Object B
Object C
118
59 How the .NET Framework Integrates with COM+ Services
• The System.EnterpriseServices namespace provides necessary programming types • Activation and interception are handled automatically through ServicedComponent class
.NET Enterprise Services
Common Language Runtime
COM+ Services
COM and Win32
119
How the .NET Serviced Component Works with COM+
Computer COM+ Application Process
Context A Context B Object A Interception Proxy Object X objX=
objX = new X ()
.NET Enterprise Services
CoCreateInstance CreateInstance COM+ COM+ Services Catalog
120
60 Creating .NET Serviced Components
• Hosting Components in Component Services • Transaction Attribute • Transaction Voting • Using the AutoComplete Attribute • Setting Assembly Attributes • Registering Assembly
121
Hosting Components in Component Services
• Add a reference to System.EnterpriseServices in your assembly • The System.EnterpriseServices namespace provides: • ContextUtil class • ServicedComponent class • Assembly, class, and method attributes • All component classes that need to be hosted within a Component Services application must inherit ServicedComponent class
122
61 Transaction Attribute
• Transaction attributes specifies how a class participates in transactions Imports System.EnterpriseServices
• Options: • Disabled, NotSupported, Required, RequiresNew, Supported
123
Transaction Voting - 1
• ContextUtil class provides transaction voting
Public Sub TransferClass(…) Try … ContextUtil.SetComplete() Catch ex As Exception ContextUtil.SetAbort() Throw ex End Try End Sub
124
62 Transaction Voting - 2
• Transaction Voting Options:
Option Consistent Bit Done Bit SetAbort False True SetComplete True True EnableCommit True False DisableCommit False False
• Transaction is terminated when Done bit of all Context objects in transaction have True value
125
Transaction Voting - 3
Transaction Stream EnableCommitSetComplete Commit Sub2
C=True SetComplete Sub1 D=FalseD=True
Root Root Client C=True SetComplete D=True C=True Sub3 D=True
C: Consistent Bit D: Done Bit
126
63 Using the AutoComplete Attribute
• AutoComplete attribute avoids using the SetAbort, SetComplete, and ContextUtil methods
127
Setting Assembly Attributes
• The information is stored in the AssemblyInfo.vb file • ApplicationName • Description • ApplicationActivation • AssemblyKeyFile • Create key file using Strong Name Utility sn.exe sn.exe –k StateU.snk
128
64 Registering Assembly
• Manual Registration: Using .NET Framework Services Installation Utility – Regsvcs.exe to register and create Component Services application
Regsvcs.exe StateU.dll
• Automatic Registration: Application registered on first use by client – Lazy Registration
129 Transaction Management Using .NET Serviced Components and COM+ Services Page: 24
.Net Knowledge Areas
• .NET framework. •VB.NET. • ASP.NET programming environment. • ADO.NET. • SQL and SQL Server • XML related technologies. • Web Service architecture. • Essence of software design
130
65 For More Information…
• MSDN Web site at – http://msdn.microsoft.com • MSDN Magazine – http://msdn.microsoft.com/msdnmag/ • Microsoft Visual Studio .NET Documentation – http://msdn.microsoft.com/library/default.asp?url=/ nhp/Default.asp?contentid=28000451
131
Book and References
• .NET is too big for a single book • Good book: • “Professional ASP.NET 1.0” ISBN 1- 61007-16-7 • Best reference is from Internet • http://msdn.microsoft.com • www.google.com
132
66 MSDN Academic Alliance
• Provides access to Microsoft software for research and education purposes • Licensed to CS departments for student loans • Includes:
• Operating Systems, SDKs, DDKs • Latest updates and Betas • Visual Studio .NET AE • MSDN Library • Server Platforms • Dev tools for WindowsCE/PocketPC – Windows, SQL Server, Exchange 2002 Server, Commerce Server, BizTalk • 4 Technical Support incidents Server, Host Integration Server, Application Center. . . • Visio • Regular Updates
133
MSDN® Essential Resources for Developers
Subscription Library, OS, Professional, Enterprise, Services Universal Delivered via CD-ROM, DVD, Web
Online MSDN® Online, MSDN® Flash, How- Information To Resources, Download Center
Training & MSDN® Webcasts, MSDN® Online Events Seminars, Tech-Ed, PDC, Developer Days
Print MSDN® Magazine Publications MSDN® News
Membership MSDN® User Groups Programs 134
67 How-To Resources Simple, Step-By-Step Procedures • Embedded Development How-To Resources • General How-To Resources • Integration How-To Resources • Jscript® .NET How-To Resources • .NET Development How-To Resources • Office Development Resources • Security How-To Resources • Visual Basic® .NET How-To Resources • Visual C#™ .NET How-To Resources • Visual Studio® .NET How-To Resources • Web Development How-To Resources (ASP, IIS, XML) • Web Services How-To Resources • Windows® Development How-To Resources http://msdn.microsoft.com/howto 135
MSDN® Webcasts Interactive, Live Online Event
• Interactive, Synchronous, Live Online Event • Discuss the Hottest Topics from Microsoft® • Open and Free For The General Public • Takes Place Every Tuesdays
http://www.microsoft.com/usa/webcasts
136
68 MSDN® Subscriptions THE way to get Visual Studio® .NET Visual Studio® .NET MSDN® Subscriptions
Enterprise Architect • Software and data modeling MSDN® Universal • Enterprise templates $2799 new • Architectural guidance $2299 renewal/upgrade
Enterprise Developer • Enterprise lifecycle tools MSDN® Enterprise • Team development support $2199 new
• Core .NET Enterprise $1599 renewal/upgrade NEW Servers
Professional • Tools to build applications MSDN® Professional and XML Web services for $1199 new Windows® and the Web $899 renewal/upgrade 137
Where Can I Get MSDN®? • Visit MSDN® Online at http://msdn.microsoft.com • Register for the MSDN® Flash Email Newsletter at http://msdn.microsoft.com/flash • Become an MSDN® CD Subscriber at http://msdn.microsoft.com/subscriptions •MSDN® online seminars http://msdn.microsoft.com/training/seminars ® • Attend MSDN Events 138
69 MS Press Essential Resources for Developers
www.microsoft.com/mspress
139
MS Press Essential Resources for Developers
The Microsoft® Enterprise Learning Library (MELL) Developer Edition provides effective training and reference resources in electronic format in order to build applications and systems using Microsoft® languages and technologies. Current contents include 15 online training courses and 31 electronic books. Available via Microsoft’s® volume licensing programs. www.microsoft.com/mspress/business/developers
140
70 Become A Microsoft® Certified Solution Developer
• What Is MCSD? – Premium certification for professionals who design and develop custom business solutions • How Do I attain MCSD Certification? – It requires passing four exams to prove competency with Microsoft® solution architecture, desktop applications, distributed application development, and development tools • Where Do I Get More Information? – For more information about certification requirements, exams, and training options,
visit www.microsoft.com/mcp 141
Training Training Resources for Developers • Course Title: Building Distributed Applications with COM+ Services and Microsoft Visual C++ – Course Number:2099 – Detailed Syllabus: www.microsoft.com/TRAINCERT/SYLLABI/2099AFINAL.ASP • Course Title: Developing Component-Based Applications Using Microsoft .NET Enterprise Services – Course Number:2557 – Detailed Syllabus: www.microsoft.com/TRAINCERT/SYLLABI/2557APRELIM.ASP
To locate a training provider for this course, please access www.microsoft.com/traincert 142
71 Summary
• .NET is a platform that solves many computing problems • Be sure to get access to free Microsoft software – MSDN AA & Web Matrix
143
Other Resources
• http://www.asp.net • http://www.gotdotnet.com • http://msdn.microsoft.com • http://www.microsoft.com/uk/education/tec htour/
144
72 Part III
Component Technologies
145
Components
• A component is a physical and replaceable part of a system that conforms to and provides the realization of a set of interfaces.
146
73 Components
(continued)
• Graphically, a component is rendered as a rectangle with tabs.
Course Kernel32.dll
147
Components Versus Classes
• Similarities – Both have names – Both may realize a set of interfaces – Both may participate in dependency, generalization, and association relationships – Both may be nested – Both may have instances – Both may be participants in interactions
148
74 Components vs. Classes (continued)
• Differences. – Classes represent logical abstractions; Components represent physical things that live directly on a node.* ** A node is a physical element that exists at run time and represents a computational resource, generally having at least some memory and processing capability.
149
Components vs. Classes (continued)
• Components represent the physical packaging of otherwise logical components and are at a different level of abstraction. • The relationship between a component and the classes it implements can be shown explicitly by using a dependency relationship.
150
75 Components vs. Classes (continued)
• Classes may have attributes and operations directly. In general, components only have operations that are reachable only through their interfaces.
151
Components and Interfaces
• An interface is a collection of operations that are used to specify a service of a class or a component. • All the most common component-based operating system facilities (e.g., COM+, CORBA, and Enterprise Java Beans) use interface as the glue that binds components together.
152
76 Component and Interfaces (continued)
• An interface that a component realizes is called an export interface. – An interface that the component provides as a service to other components. • An interface that a component uses is called an import interface. – An interface that the component conforms to and so builds on.
153
Components and Interfaces (continued)
• The fact that an interface lies between the two components breaks the direct dependency between the components. • A component that uses a given interface will function properly no matter what component realizes that interface.
154
77 Binary Replaceability
• The basic intent of every component-based operating system facility is to permit the assembly of systems from binary replaceable parts – Can create a system out of components and then evolve that system by adding new components and replacing old ones
155
Characteristics of A Component
• It is physical. • It is replaceable. • It is part of a system. • It conforms to and provides the realization of a set of interfaces.
156
78 Three Kinds of Components
• Deployment components – Components that are necessary and sufficient to form an executable system. – e.g., dynamic libraries (DLLs) and executables (EXEs).
157
Three Kinds of Components (continued)
• Work product components – Essentially the residue of the development process, consisting of things such as source code files and data files from which deployment components are created • Execution components – Created as a consequence of an executing system
158
79 Standard Elements
• UML defines five standard stereotypes that apply to components: – Executable • May be executed on a node –Library • A static or dynamic object library –Table • Represents a database table –File • Represents a document containing source code or data – Document • Represents a document
159
Component Diagrams
• A component diagram shows a set of components and their relationships • Shows the organization and dependencies among a set of components
160
80 Component Diagram
Billing.exe Register.exe Billing System
People.dll User Course.dll Course
Student Professor
Course Course Offering
161
Component Diagram (continued)
162
81 Example of Component Diagram
163
Example of Component Diagram
164
82 Current Trend – Three kinds of Developers
System Developer
Component Developer
Business Application Developer
165
Part IV
Session 4 Addendum Distributed Object Computing Platforms and Web-Enabled DOC Platforms
166
83 CORBA ORB Architecture
167
CORBA DOC Platform at Work
168
84 CORBA Development Process (pre-CORBA3)
169
CORBA Development Process (continued)
170
85 CORBA Development Process (using java2iiop)
171
Microsoft Component Object Model (Logical Architecture)
172
86 VisiBroker’s Gatekeeper
173
VisiBroker Gatekeeper’s Features
Extends location transparency past the Web server
Gatekeeper acts as a proxy object for all incoming requests from client applets
Allows callbacks to functions of the server objects
Gatekeeper’s proxy objects allows communication back to specific clients
IIOP proxy server
Gatekeeper proxys requests and callbacks through a single port on the firewall
HTTP tunneling
No additional code required when firewalls do not allow IIOP traffic
to pass 174
87 VisiBroker Gatekeeper’s Features (continued)
SSL support
Gatekeeper + SSL Pack ensures privacy and integrity of information
Broad flexibility in security configuration (client communication, server callbacks, all communications)
Authentication + encryption support
Easy graphical configuration
175
VisiBroker’s Gatekeeper
176
88 Part V
CORBA-Based Object Management Architectures Also See Session 5 Handout on:
“ CORBAServices and CORBAFacilities” “Exploring CORBAServices and CORBFacilities” “CORBA Activation Service - Portable Object Adapter (POA)” “POA and CORVAL” “Naming Service - CosNaming” “The CosNaming Module”
and Sub-Topic 2 Presentation on:
“OMA Trading Services”
177
OMG Reference Model Architecture
Current and Next Generation OMA
See http://www.omg.org/gettingstarted/specintro.htm#OMA
See http://www.objs.com/staging/OMG-OMA-NG.html 178
89 Object Services (CORBAservices)
Domain-independent interfaces used by many distributed object programs
Provide basic functionality for distributed object applications
Naming Service: allows clients to find objects based on names
Trading Service: allows clients to find objects based on their properties
Other services: persistence, lifecycle management,
security, transactions, event notification, etc. 179
Common Facilities (Horizontal CORBAfacilities)
Horizontally-oriented interfaces (useful across business domains)
Oriented towards end-user applications (e.g., user interface, information mgmt, system mgmt, task mgmt)
E.g.: Distributed Document Component Facility (DDCF)
Compound document facility based on OpenDoc
Allows for presentation and interchange of objects based on a document model (e.g., linking of spreadsheet object into a report document)
Printing, Secure Time, Internationalization, and Mobile Agent Facilities 180
90 Information Management Horizontal Facility
181
Domain Interfaces (Vertical CORBAfacilities)
Role similar to Object Services and Common Facilities
Oriented towards specific application domains
E.g., Product Data Management (PDM) Enablers for the manufacturing domain
Other possibilities in the telecommunications, medical, and financial domains
182
91 Application Interfaces
Custom interfaces developed for a given application
Not standardized
Might become candidates for future OMG standardization
183
CORBA Activation Service (server registration)
184
92 CORBA Activation Service (client request)
185
Persistence Service
186
93 Transaction Service
187
New in Corba 3
Component Model (CCM)
Quality-of-service control
Messaging invocation model
Tightened integration with the Internet
POA (Portable Object Adapter)
EJB and Java support
OMG specifications for analysis and design, and application interoperability
UML, MOF, XMI, Common Warehouse Model 188
94 Part VI
Java-Based Application Servers Also See Session 5 Handout on:
“ The RMI Activation Framework” “The RMI Naming Service” “JNDI” “Jini - The Universal Network?” “Jini Connection Technology” “JTS - Demarcated Transaction Support” “Understanding Java Messaging and JMS”
and Sub-Topic 1 Presentation on: “Java Naming and Directory Interface (JNDI)”
189
Sample Java Application Server Services
190
95 Jini’s Service-Based Architecture
191
Jini’s Relationship to Other Java Services
192
96 JMS Session, Connection, and Message Facilities
193
Part VII Windows and COM+ Services
194
97 Win32 Services
Win32 executable that satisfy several properties
Lifetime is controlled by the Service Control Mgr (SCM)
Service is registered with SCM, and understands and obeys SCM commands
Service has its own login session or shares one with another service
Service runs as a user or local system and abides to applicable security
Service implements a set of service-specific functions:
Starting up, message handler, communication back to SCM
195
Part VIII
Conclusion
196
98 Summary
OMG, Sun, and Microsoft DOC platforms all share the OMA architecture
OMG’s OMA provides the most comprehensive and detailed set of specifications for CORBAfacilities, and CORBAservices
JavaSoft has focused mostly on OMA services as part of the J2SE, J2EE, and J2ME architectures
Microsoft provides platform specific support for services and an integrated set of horizontal and vertical facilities bundled with the OS
197
Readings
Readings
Handouts posted on the course web site
Explore the add-on services and facilities provided on top of the VisiBroker, Orbacus, RMI, RMI-IIOP, and DCOM Environments
Read white papers/documentation at:
Read VisiBroker, Orbacus, RMI, RMI-IIOP, and DCOM related whitepapers on the vendor sites
198
99 Project Frameworks
Project Frameworks Setup (ongoing)
Apache Web Server (version 1.3.28/2.0.47, www.apache.org)
Perl (version 5.8.0, www.perl.com)
Microsoft IIS with COM+/.Net and ASP
Sun One Active Server Pages 4.0
http://wwws.sun.com/software/chilisoft/index.html
Apache Tomcat
Macromedia JRun4
Apache Cocoon 2/XSP
Visibroker, Orbacus
RMI-IIOP 199
Assignment
Assignment:
Explore the textbooks’ references to Application Server technology (continued)
#5a: Investigate distributed object computing platforms’ development environments for the add-on technologies covered in this session. Write a short report that documents your findings and recommendations with respect to selection criteria in support of development environments for application server technologies covered in this session
#5b: See homework #5 specification
200
100 Next Session: J2EE Component-Based Computing Environments (Part I)
VMs and Component Technologies
JVM and .Net CLR
Abstract Component Infrastructures
Introduction to Enterprise Component Development
Introduction to Component-Based Architectures Design
EJB Component Model
J2EE Services
JNDI, JMS, JTS, CMP/BMP/JDBC, MDBs
Security in J2EE Application Servers 201
101