Exploring J2EE Protocols

Client applications connect with a J2EE Application Server using standard networking protocols over TCP/IP. Application Server listens for connection requests at a network address that can be specified as part of a Uniform Resource Identifier (URI), which is a standardized string that specifies a resource on a network, including the Internet.

Web-based clients communicate with Application Server using the Hypertext Transfer Protocol (HTTP). Java clients connect using the Java RMI, which allows a Java client to execute objects in Application Server. CORBA-enabled clients access Application Server RMI objects using RMI/IIOP, which allows them to execute Application Server objects using standard CORBA protocols.

The following sections summarize the protocols used by the J2EE platform to transfer data between its multiple tiers.

Transport Control Protocol over Internet Protocol

TCP/IP, or Transport Control Protocol (TCP) over Internet Protocol (IP), provides reliable delivery of streams of data from one host to another. IP is the basic protocol of the Internet, which enables the unreliable delivery of packets from one host to another. IP makes no guarantees to deliver packets, or that packets will arrive in the order in which they were sent. The TCP adds the notions of connection and reliability, which are responsible for the guaranteed delivery of packets.

Hypertext Transfer Protocol

HTTP is the Internet protocol used to transfer hypertext objects from remote hosts to requesting clients. It is a generic, stateless, object-oriented protocol that may be used for many similar tasks, such as DNS and distributed object-oriented systems. HTTP messages consist of requests from the client to the HTTP server, and responses from the server to the client. Application Server always responds to an HTTP request by executing a servlet, a JSP, or static HTML, which returns results to the client. An HTTP servlet is a Java class that can access the contents of an HTTP request received over the network and return an HTTP-compliant result to the client. You learned about HTTP, JSP, and servlets on Day 7.

Secure Sockets Layer

Secure Sockets Layer (SSL) is a security protocol that provides privacy over the Internet. The protocol allows client/server applications to communicate in a way that cannot be eavesdropped on or tampered with. Servers are always authenticated, and clients are optionally authenticated. Data exchanged with the HTTP protocol can be encrypted with the SSL protocol.

Note

Using SSL assures the client that it has connected with an authenticated server and that data transmitted over the network is private. You'll learn more about SSL on Day 19, “Understanding Security,” when we study security for J2EE applications.


Remote Method Invocation

RMI is the standard Java facility for distributed applications. RMI allows one Java program, called a server, to publish Java objects that another Java program, called a client, can execute. In most applications, Application Server is the RMI server and a Java client application is the client. But the roles can be reversed; RMI allows any Java program to play the role of server. You learned about RMI on Day 2, “Understanding EJB Types and Interfaces.”

JavaIDL

JavaIDL (Java Interface Definition Language) provides a mechanism to Java clients in defining interfaces to access methods on CORBA objects. JavaIDL consists of a collection of CORBA classes and interfaces. An enterprise application developer uses the IDL compiler to generate code for a Java client stub to access a CORBA object, which is defined by the IDL. The Java client is then linked with the stub and uses the CORBA interfaces to access the CORBA object.

RMI/IIOP

RMI/IIOP is basically a bridge between RMI (the Java native protocol) and IIOP (the CORBA native protocol). IIOP is short for CORBA's Internet Inter-ORB Protocol. RMI/IIOP provides applications developer to write remote interfaces in the Java programming language. The remote interface can then be converted to IDL and implemented in any of the languages that are supported by CORBA mapping and an Object Request Broker (ORB) for that language. This mapping translates objects and primitive data types of one language to CORBA-compliant data types.

Clients and servers can be written in any language using IDL derived from the RMI interfaces. When remote interfaces are defined as Java RMI interfaces, RMI over IIOP provides interoperability with CORBA objects implemented in any language.

RMI is discussed in more details on Day 2, “Understanding the Fundamentals of Enterprise JavaBeans.”

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.30.19