|
| Java CGI | |
| This explains how to set up your server to allow CGI programs written in Java and how to use Java to write CGI programs. Although documents are targetted towards use with the Linux operating system, this particular one is not dependant on the particular version of unix used. | |
|
| |
| Java Decompiler | |
| This document will help you to de-compile the Java class programs. This documents gives a list of decompilers which can reverse engineer the Java class files and generate the Java source code files. Thie is very helpful if you do not have the Java source code file and have only the Java class files. The information in this document applies to all the operating sytems where Java language/Java VM runs. | |
|
| |
| Priorities | |
| The priority of a thread tells the scheduler how important this thread is. If there are a number of threads blocked and waiting to be run, the scheduler will run the one with the highest priority first. However, this doesn’t mean that threads with lower priority don’t get run (that is, you can’t get deadlocked because of priorities). Lower priority threads just tend to run less often | |
|
| |
| Jini: distributed services | |
| This section gives an overview of Sun Microsystems’s Jini technology. It describes some Jini nuts and bolts and shows how Jini’s architecture helps to raise the level of abstraction in distributed systems programming, effectively turning network programming into object-oriented programming. | |
|
| |
| Sharing limited resources | |
| You can think of a single-threaded program as one lonely entity moving around through your problem space and doing one thing at a time. Because there’s only one entity, you never have to think about the problem of two entities trying to use the same resource at the same time, like two people trying to park in the same space, walk through a door at the same time, or even talk at the same time | |
|
| |
| CORBA | |
| In large, distributed applications, your needs might not be satisfied by the preceding approaches. For example, you might want to interface with legacy data stores, or you might need services from a server object regardless of its physical location. These situations require some form of Remote Procedure Call (RPC), and possibly language independence. This is where CORBA can help. | |
|
| |
| Visual programming | |
| So far in this book you’ve seen how valuable Java is for creating reusable pieces of code. The “most reusable” unit of code has been the class, since it comprises a cohesive unit of characteristics (fields) and behaviors (methods) that can be reused either directly via composition or through inheritance | |
|
| |
| Java Database Connectivity (JDBC) | |
| It has been estimated that half of all software development involves client/server operations. A great promise of Java has been the ability to build platform-independent client/server database applications. This has come to fruition with Java DataBase Connectivity (JDBC). | |
|
| |
| Tables | |
| Like trees, tables in Swing are vast and powerful. They are primarily intended to be the popular “grid” interface to databases via Java Database Connectivity (JDBC, discussed in Chapter 15) and thus they have a tremendous amount of flexibility, which you pay for in complexity. There’s easily enough here to be the basis of a full-blown spreadsheet and could probably justify an entire book. However, it is also possible to create a relatively simple JTable if you understand the basics | |
|
| |
| Thread groups | |
| threads belong to a thread group. This can be either the default thread group or a group you explicitly specify when you create the thread. At creation, the thread is bound to a group and cannot change to a different group. Each application has at least one thread that belongs to the system thread group. If you create more threads without specifying a group, they will also belong to the system thread group. | |
|
| |
| Distributed Computing. Network programming | |
| Historically, programming across multiple machines has been error-prone, difficult, and complex.
The programmer had to know many details about the network and sometimes even the hardware. You usually needed to understand the various “layers” of the networking protocol, and there were a lot of different functions in each different networking library concerned with connecting, packing, and unpacking blocks of information; shipping those blocks back and forth; and handshaking. It was a daunting task
| |
|
| |
| Java Server Pages | |
| Traditional approaches to executing code on other machines across a network have been confusing as well as tedious and error-prone to implement. The nicest way to think about this problem is that some object happens to live on another machine, and that you can send a message to the remote object and get a result as if the object lived on your local machine. This simplification is exactly what Java Remote Method Invocation (RMI) allows you to do. | |
|
| |
| Servlets | |
| Client access from the Internet or corporate intranets is a sure way to allow many users to access data and resources easily. This type of access is based on clients using the World Wide Web standards of Hypertext Markup Language (HTML) and Hypertext Transfer Protocol (HTTP). The Servlet API set abstracts a common solution framework for responding to HTTP requests. | |
|
| |
| Packaging an applet into a JAR file | |
| An important use of the JAR utility is to optimize applet loading. In Java 1.0, people tended to try to cram all their code into a single applet class so the client would need only a single server hit to download the applet code. Not only did this result in messy, hard to read (and maintain) programs, but the .class file was still uncompressed so downloading wasn’t as fast as it could have been. | |
|
| |
| Enterprise JavaBeans | |
| Suppose you need to develop a multi-tiered application to view and update records in a database through a Web interface. You can write a database application using JDBC, a Web interface using JSP/servlets, and a distributed system using CORBA/RMI. But what extra considerations must you make when developing a distributed object system rather than just knowing API’s? Here are the issues: | |
|
| |
| Blocking | |
| Blocking
| |
|
| |
| Selecting Look & Feel | |
| One of the very interesting aspects of Swing is the “Pluggable Look & Feel.” This allows your program to emulate the look and feel of various operating environments. You can even do all sorts of fancy things like dynamically changing the look and feel while the program is executing. | |
|
| |
| Multiple Threads. Responsive user interfaces | |
| Objects provide a way to divide a program into independent sections. Often, you also need to turn a program into separate, independently running subtasks.
Each of these independent subtasks is called a thread, and you program as if each thread runs by itself and has the CPU to itself. Some underlying mechanism is actually dividing up the CPU time for you, but in general, you don’t have to think about it, which makes programming with multiple threads a much easier task.
| |
|
| |
| Runnable revisited | |
| Earlier in this chapter, I suggested that you think carefully before making an applet or main Frame as an implementation of Runnable. Of course, if you must inherit from a class and you want to add threading behavior to the class, Runnable is the correct solution. | |
|
| |