1k likes | 1.31k Views
Middleware Technologies. MC9251. Unit-I Introduction. Middleware Middleware is a general term for any program that serves to "glue together" or mediate between two separate programs.
E N D
Middleware Technologies MC9251
Unit-I Introduction Middleware • Middleware is a general term for any program that serves to "glue together" or mediate between two separate programs. • A common application of middleware is to allow programs written for access to a particular database to access other databases Middleware
Middleware • Enterprise Application Integration-EAI • To exploit the Internet, E-commerce, Extranet, and other new technologies • Middleware categories • TP monitors • RPC systems • Object Request Brokers (ORBs) • Database access systems • Message Passing Middleware
Client-Server Architecture “Relationship between two computer programs, the client makes a service request from another program, the server”. • Can be used in a single computer • More important in Computer Networks • Example: FTP, Internet, Internet banking Middleware
Client-server - CGI Scripts Middleware
Server side scripting technologies Middleware
Client-Server Architecture • Two tier architectures • Three tier architectures • Three tier architecture with transaction processing monitor technology • Three tier with an ORB architecture • Distributed/collaborative enterprise architecture Middleware
Transaction Processing monitor technology • The ability to update multiple different DBMSs in a single transaction • Connectivity to a variety of data sources including flat files, non-relational DBMS, and the mainframe • The ability to attach priorities to transactions • robust security Middleware
Client-Server Architecture Characteristics • Service • Shared Resources • A symmetrical protocols • Transparency of location • Mix and match • Message based exchanges • Encapsulation of services • Scalability • Integrity Middleware
Types of Servers • File server • Database server • Transaction server • Group server • Object server • Web server Middleware
File Server • It is a computer responsible for the central storage and management of data files • Allows users to share information • File server – a normal PC – Dedicated network attached storage • System security to limit access to files to specific users or groups • Novell’s eDirectory, MS’s Active directory Middleware
Database Server • SQL requests and Data • Server uses processing power to find the requested data • DBMS provides server functionality • Database Master servers and Slave servers • Client application written by the user Middleware
Transaction Server • Transaction- a group of SQL statements • Client invokes Remote procedures – Servers execute transactions • Both client and server component coded by the user • Online transaction Processing (OLTP) Middleware
Groupware Server • Addresses the management of semi-structured information • Applications are created using a scripting language and form based interfaces Middleware
Object Server • Client objects communicates with server objects using an ORB • ORB locates an instance of object server class, invokes requested method • Server objects provide support for concurrency and sharing • Various ORB’s • CORBA - Object management Group • Dcom - Microsoft • SOM - IBM • NEO - SUN Middleware
Web Servers • HTTP requests - HTTP responses along with optional data contents • Error response • Supposed to serve requests quickly from more than one TCP/IP connection at a time. Middleware
Client/Server building blocks Architecture Analogy • We buy houses and not plans • Thus, computer users buy business solutions and not client/server architectures • How is the application split between the client and the server? • What functions go into the client and server? • Can the client/server model accommodate businesses of all sizes? • Can a single client/server model accommodate all these type of users? Middleware
The Basic Building Blocks • Components: • Client • Server • Middleware and is catered for Middleware
The Four situations • Client/server for tiny shops • Client/server software and most of the business services runs on the same machine – one person shop • Client/server for smallshops and departments • Classic Ethernet client/single-server building block implementation • Client/server for intergalactic enterprise • Multi-server building block implementation of client/server • Client/server for the post-scarcity world • Every machine is transformed in the world for both client and a server. Personal agents on every machine and do the negotiations Middleware
Client Components • Operating system with: • a Graphical User Interface (GUI) • the ability to find and access distributed services • Web browser to: • provide the user interface • download the necessary components from the server on demand • Middleware components handle the non-local services. • Clients may also run a component of a Distributed System Management (DSM) system Middleware
Server Components • Server Operating System • A server software package of some kind: • SQL Database server • Transaction Processing (TP) monitor • Groupware server • Object server • Web server • Middleware components handle the reception of requests for services • A server may also run a DSM component Middleware
Middleware Components • These run on both the client and the server sides of a client/server application • Transport Stacks • Network Operating Systems (NOSs) • Service-specific middleware • May also have a DSM component Middleware
General middleware – provide substate for most client/server • Communication stacks • Distributed directories • Authentication services • Network time services • Remote Procedure Calls • Queuing services • NOS extensions: • Distributed file and print services Middleware
Service-Specific Middleware • Database: • ODBC, JDBC, SQLJ, DRDA, OLE DB, etc. • OLTP: • A variety of proprietary products • Groupware: • MAPI, VIM, JavaMail, SMTP, POP3, IMAP, etc. • Object: • CORBA, Microsoft's COM+ • Internet: • HTTP, CGI, XML, SET Middleware
Server-to-Server Middleware • Middleware software may also be used to coordinate inter-server interactions • Servers are often clients to other servers, and vice-versa • Some server-to-server interactions require special middleware: • Mail servers may do store-and-forward type messaging • Databases and groupware use daemons to automatically replicate data Middleware
Unit - II Enterprise Java Beans
Enterprise Java Beans • Write once, run-anywhere, middle tier components Evolution of Technology • Mainframe/Terminal model • Transaction processor • To handle concurrent client requests • Several statements as on logical unit • Guaranteeing successful execution or non would be executed Middleware
Transaction processor • Provides API with ‘begin’, ‘commit’, and ‘rollback’. • Logging mechanism ACID properties of Transactions • Atomicity • Consistency • Isolation • Durability Middleware
Updates in a Database Response time is critical Can handle large volume of transactions Reviews information Involves long-running queries Smaller number of requests, longer think time OLTP Vs DSS/EIS/OLAP Middleware
Evolution… • Two-Tier architecture • Transaction integrity by DBMS • Three-Tier architecture • Transaction integrity by Middle tier components • Sockets • Limited distributed computing • RPC • A thin layer on top of Sockets • Stub-Skeleton • Stub uses IDL Middleware
CORBA • An object oriented RPC Mechanism • Objects written in one language can be called by objects written in a different language • CORBA clients can access EJB objects RMI • Java version of CORBA • No need to write IDL. RMIC handle automatically • EJB allows client side RMI calls to EJB objects Middleware
EJB’s role • EJB specifies an execution environment • EJB is a java class implements Session bean or entity bean • Container provides services to EJB • Container provides proxy object for each bean • EJB exists in the middle tier • To encapsulate business logic • Supports transaction processing • Can Maintain state Middleware
Enterprise JavaBeans (EJB) is an architecture for setting up program components, written in the Java programming language, that run in the server parts of a computer network that uses the client/server model. • Enterprise JavaBeans is built on the JavaBeans technology for distributing program components (which are called Beans,) to clients in a network. Middleware
Enterprise JavaBeans offers enterprises the advantage of being able to control change at the server rather than having to update each individual computer with a client whenever a new program component is changed or added. • EJB components have the advantage of being reusable in multiple applications. • Can be deployed across all major operating systems, not just Windows. Middleware
EJB’s Architecture • Logically three-tier system • EJB server & DB reside on the same machine – EJB server includes built in functionality for persistent storage • EJB server & Client – EJB bean makes a call to another EJB bean • All three tier might reside on a single machine Client - EJB Server - Database Middleware
EJB’s role in the three layers • Client calls remote EJB’s • EJB components live in the middle tier, EJB objects reside in an EJB container which is in side of an EJB server • DB resides in the third layer EJB beans accesses the DB through JDBC Middleware
Overview of EJB’s Software Architecture • EJB bean exists within the container • Client communicates with bean through home interface, remote interface Middleware
Overview of EJB’s Software Architecture EJB server • Provides container with lower level services such as network connectivity • Layered approach EJB Container • Interface between EJB and outside world • Can create pool of beans • Provides services to Beans • Support for transactions, management of multiple instances, persistence, and security Middleware
Enterprise Bean • EJB object is implemented, in addition Home interface and Remote interface implemented Types of EJB beans Middleware
Session Bean – is created by a Client and usually exist only for the duration of a single client/server session. • Entity Bean – represents a business objects in a persistent storage mechanism • Ex : Customers, orders & products Middleware
A stateless session bean is a distributed object that does not have an associated conversational state, thus allowing concurrent access to the bean. • The contents of instance variables are not guaranteed to be preserved across method calls. • Stateful session beans are distributed objects having a conversational state. The state could be persisted, but access to the bean is limited to only one client. Middleware
Session bean Vs Entity bean • EB’s are persistent, allow shared access, have primary key, and may participate in relationships with other entity beans When to use Entity bean • If the bean represents a business entity, not a procedure • If the bean’s state must be persistent • Ex: CreditcardEJB - Entity bean CreditcardverifierEJB – Session bean Middleware
EJB Session & Entity Bean Unit-III
Session EJB • A session bean instance is: • A non-persistent object • Implements some business logic • Runs on the server • Live as long as the client need them Middleware
Constraints on Session Bean • EJB cannot use threads – but container can run multiple instances • Cannot directly access transaction manager – container is responsible for managing transactions • Cannot use JDBC commit and rollback – container issues commit and rollback • Not allowed to change security identity at runtime • Cannot have static variables – it must be static final Middleware
Session bean constraints • It is irrevocably disappear from the server • If timeout value expires • If the server crashes, shutdown, or restarted • Session beans are non-reentrant – another call to the same object from same transaction context throws remote exception Middleware
Components of a Session EJB • The remote interface • Extends EJBObject (All extended types are from javax.ejb) • The home interface -Extends EJBHome • The bean class itself, called XBean • Extends SessionBean • Should implement java.io.Serializable (for stateful beans) • Implements business methods from the component interface • Implements lifecycle methods (ejbXXX) Middleware
Stateless Session bean life cycle • Nonexistence • Method-ready state • Session EJBs have no state, so activation and passivation are meaningless • The container simply destroys instances when low on memory, and creates new ones as needed • Still, ejbActivate and ejbPassivate must be implemented in XBean (as empty methods) Middleware