J2SE Platform

The Security APIs that we just discussed are part of J2SE Platform. Besides these, a number of other APIs, tools and deployment environments form the complete J2SE Platform, as shown in Figure 2-1.

Figure 2-1. J2SE Platform, v1.4 APIs.


As you can see, J2SE APIs fall into three main categories: (a) Core APIs for common functionality; (b) Integration APIs to access back-end services; and (c) APIs required to create a rich user interface. This set of APIs allows the development of human-facing programs with J2SE platform.

We refer to some of these components in our later discussion. Let us briefly talk about these components. The idea is to just recapitulate the terminology, with the assumption that you are already somewhat familiar with these. If not, you can find references for more information in the Further Reading section.

J2SE APIs

As depicted in Figure 2-1, J2SE APIs are grouped together as per their functionality. We briefly look at APIs relevant to the subsequent coverage in the book.

XML APIs packaged in J2SE v1.4 are also known as JAXP (Java API for XML Processing). These APIs perform basic operations on XML content: (a) parsing an XML document with SAX (Simple API for XML), (b) constructing a DOM (Document Object Model) tree, and (c) applying XSL (eXtensible Stylesheet Language) transforms.

Since finalization of J2SE v1.4, there has been an explosion of XML-related APIs through independent JSRs, collectively known as JAX-Pack. Given their popularity, it is quite likely that most of these will be packaged with J2SE v1.5. Among these, the following are of particular interest to us due to their central role in Web services: SAAJ (SOAP with Attachments API for Java) to access and manipulate SOAP with Attachments documents and JAX-RPC for clients to invoke SOAP Web services.

Networking APIs, residing in packages java.net and javax.net, are used for developing TCP- and UDP-based client and server programs. As we mentioned earlier, the use of SSL requires using the JSSE Security API along with the Networking APIs. New I/O API further enhances the networking capability by providing nonblocking calls and directly allocated buffers to reduce memory copy overhead.

Networking APIs also include classes for writing HTTP and HTTPS client programs. However, the API for writing the corresponding server programs are in J2EE platform, not in J2SE. This is true for other integration APIs as well. This packaging, whereby the client side API exists in J2SE, allows a J2SE program to invoke the integration services such as access to a relational database, naming and directory services, and so on. These services are provided by the server programs running independently or within a J2EE container.

JDBC (Java Database Connectivity) defines the API for Java programs to access data managed by a relational database management system. Similarly, JNDI (Java Naming and Directory Interface) is the API for accessing naming and directory services. As we just noted, these services are available with J2EE platform.

Java RMI (Remote Method Invocation) is for developing client server-based distributed programs where both ends speak Java. RMI is also used to make invocations on EJB(Enterprise JavaBeans). EJBs are components for encapsulating business logic in a J2EE based application. If an existing service with industry standard CORBA (Common Object Request Broker Architecture) interface exists or the service must be a nonJava program, then a client program can access it with RMI-IIOP.

J2SE Deployment Technologies

A J2SE program runs in one of three ways: as a standalone program, as a Java Web Start program or as an applet within a Java Plug-In. As you must be aware, launching a minimal standalone program in its own JVM is simple—you only need to setup your environment and run the command "java classname" where classname is the fully qualified name of the class with public main() method. However, there are few subtleties involved if you need to pass system properties to the JVM or specify heap size parameters or want to do some debugging. Refer to J2SE documentation for more details.

An applet is loaded by a Web browser using the Java plug-in when it encounters an APPLET tag within an HTML document. You can specify the applet class, location of the applet class as an URL, height and width of the applet window in the browser, and many other attributes within the APPLET tag.

A Java Web Start program is a full-fledged Java program that can be downloaded by clicking a link in the browser. Internally, the Java Web Start engine maintains a cache of recently downloaded applications so that the complete application need not be downloaded every time you run the application. The actual setup steps required for loading Java Web Start programs are more involved. Refer to J2SE documentation for details.

Applets are great for delivering functionality with simple user interface through a browser without the need to install an application. But if you need the power of a standalone Java program with rich user interface and the convenience of applet-like delivery, Java Web Start is the way to go.

Both applets and Java Web Start programs present interesting security issues. However, these topics are beyond the scope of this book and are not covered.

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

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