![]() |
![]() |
|
Introduction to WebLogic RMI
The following sections introduce WebLogic RMI and describe the advantages and features.
Remote Method Invocation (RMI) is the standard for distributed object computing in Java. RMI allows an application to obtain a reference to an object that exists elsewhere in the network, and then to invoke methods on that object as though it existed locally in the client's virtual machine. RMI specifies how distributed Java applications should operate over multiple Java virtual machines.
WebLogic implements the JavaSoft RMI specification. WebLogic RMI provides standards-based distributed object computing. WebLogic Server enables fast, reliable, large-scale network computing, and WebLogic RMI allows products, services, and resources to exist anywhere on the network but appear to the programmer and the end user as part of the local environment.
WebLogic RMI scales linearly under load, and execution requests can be partitioned into a configurable number of server threads. Multiple server threads allow WebLogic Server to take advantage of latency time and available processors.
There are differences in the JavaSoft reference implementation of RMI and WebLogic's RMI product; however, these differences are completely transparent to the developer. WebLogic RMI is WebLogic's implementaion of JavaSoft RMI.
In addition, WebLogic RMI is fully integrated with WebLogic JNDI. Applications can be partitioned into meaningful name spaces by using either the JNDI API or the Registry interfaces in WebLogic RMI.
The WebLogic RMI compiler generates stubs and skeltons that completely replace the stubs and skeltons produced by RMIC, the RMI compiler. Like RMIC, the WebLogic RMI compiler produces enough compile-time information to support runtime resolution of classes, methods, and instances to override Object methods, and to deliver exceptions raised in the server to the invoking clients.
If you are just beginning to learn about RMI, visit the JavaSoft website and take the RMI tutorial. This document contains information about using WebLogic RMI, but it is not a beginner's tutorial on remote objects or writing distributed applications.
Advantages of WebLogic RMI
As a service that operates within WebLogic Server, WebLogic RMI has some characteristics that differ from JavaSoft's reference implementation of RMI. These characteristics do not change how you uses WebLogic RMI, but they do affect performance and scalability.
WebLogic RMI is completely standards-compliant. If you are an RMI user, you can convert your programs by changing nothing more than the import statement and running your remote classes through the WebLogic RMI compiler..
Here is a brief comparison of WebLogic RMI and the JavaSoft RMI reference implementation. In general, like JavaSoft's reference implementation of RMI, WebLogic RMI provides transparent remote invocation in different JVMs. Remote interfaces and implementations that are written to the RMI specification can be compiled with the WebLogic RMI compiler and used without changes. But there are significant differences in the fundamental implementation of WebLogic RMI that enhance the many aspects of distributed computing.
Differences in WebLogic RMI's Implementation
The following sections identify some of the differences in WebLogic's implementaion of RMI compaired to the JavaSoft RMI implementation.
WebLogic RMI Features
Like the JavaSoft reference implementation of RMI, WebLogic RMI has a code generator, and a registry and server hosted by a WebLogic Server. But WebLogic RMI provides features that are different or missing from the reference implementation.
WebLogic RMI Compiler
The WebLogic RMI code generator (compiler) produces a stub and a skeleton that support the interfaces implemented by the remote object. The object's implementation is bound to a name in the RMI registry, and any client can acquire a remote stub of the object upon which it can invoke by looking up the object in the registry.
With WebLogic RMI it is possible to specify that platform-specific compilers should be used. In addition, the WebLogic RMI compiler accepts and passes on any additional Java compiler options to the Java compiler.
The WebLogic RMI compiler allows a flexible inheritance structure; remote classes can also implement non-remote interfaces, and code generation can be done on the descendants of a class, or on an abstract class. Your distributed application can exist in a meaningful object hierarchy, rather than the artificial hierarchy that results under the reference RMI where every remote class must inherit from a single interface.
Proxy Classes
The WebLogic RMI compiler increases efficiency in its use of proxies. Proxy classes are the resulting skeleton and stub classes that any RMI compiler produces when run against a remote class (that is, one that implements a remote interface). The WebLogic RMI compiler by default produces proxies for the remote interface, and the remote classes share the proxies. This is a much more efficient system than the reference implementation's model of producing proxies for each remote class. When a remote object implements more than one interface, the proxy names and packages are determined by encoding the set of interfaces, unless you choose to produce class-specific proxies. When a class-specific proxy is found, it takes precedence over the interface-specific proxy.
WebLogic RMI Registry and Server
With WebLogic RMI, the RMI registry is hosted by WebLogic Server, which provides the necessary networking infrastructure and execution model for using RMI in a production environment.
WebLogic Server, and likewise the registry, can be accessed by a variety of client protocols, includinga secure (SSL) mode of WebLogic's protocol, HTTP tunneling, HTTPS, and IIOP. A call to look up an object in the WebLogic registry may use various URL schemes, including the default rmi:// scheme, http://, https://, and iiop://.
WebLogic RMI Performance and Scalability
WebLogic RMI performance is enhanced by its integration into the WebLogic Server framework, which provides the underlying support for communications, management of threads and sockets, efficient garbage collection, and server-related support.
WebLogic RMI scales dramatically better than the reference implementation, and provides outstanding performance and scalability. Even relatively small, single-processor, PC-class servers can support well over a thousand simultaneous RMI clients, depending on the total workload of the server and the complexity of the method calls.
WebLogic RMI, while offering the flexibility and universality of the JavaSoft standard, provides the power and performance necessary for a production environment. Because WebLogic RMI depends upon and takes advantage of the sophisticated infrastructure of WebLogic Server, it is fast and scalable, with many additional features that support real-world use of RMI for building complex, distributed systems.
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|