[ Team LiB ] Previous Section Next Section

RMI Compiler

The WebLogic RMI compiler, weblogic.rmic, is used to generate the client-side proxy class and the server-side bytecode. The RMI complier takes as argument the class that implements your remote interface. For example, assume that you have an RMI solution that determines the current status of your application, with a remote interface named BidStatus.class, located in the package com.utility. The associated implementation class is named BidStatusImpl.class. You must run the RMI compiler against BidStatusImpl.class as such:

$ java weblogic.rmic com.utility.StatusImpl -[OPTION]


You must use the absolute class name (the class name with the path) when submitting classes to the rmic compiler.

The WebLogic RMI compiler will produce a dynamic proxy class. WebLogic's hot code generation feature will create the server-side bytecode at runtime. The dynamic proxy is the client-side proxy (stub), and the server-side bytecode functions as the server-side implementation class (skeleton) as depicted in Figure 11.4.

Figure 11.4. WebLogic RMI-generated classes.


RMI compilation is not required for Java-to-Java solutions. In this case, the proxy object communicates with WebLogic Server, which produces the skeleton dynamically. The default classes created are RMI-IIOP compliant. However, use of the -iiop option will generate the client proxy stub class and server-side tie class, as depicted in Figure 11.5.

Figure 11.5. WebLogic RMI compiler-generated classes.


RMI compilation is required for the non-Java IIOP clients discussed earlier and clusterable stubs. Clusterable subs allow the RMI application to be used by all servers within a WebLogic cluster (a network of two or more WebLogic Servers). Clusterable stubs generated are pinned; that is, they aren't replicated within the cluster. Even though these clusterable stubs are available clusterwide through WebLogic JNDI, they reside only on the host in which they were registered. The WebLogic Server provides no failover or load balancing for clusterable RMI stubs. If the server on which the RMI is registered goes down, the cluster loses the services of that RMI. While the RMI is available, WebLogic Server does not balance the requests for the RMI evenly across the servers within the cluster. To create clusterable stubs, use the rmic clusterable option as shown here:

$ java weblogic.rmic com.utility.BidStatusImpl -clusterable

To gain a list of available options, use the rmic help option as shown here:

$ java weblogic.rmic com.utility.BidStatusImpl -help

To create IDLs for a remote interface, use the rmic idl option as shown here:

$ java weblogic.rmic com.utility.BidStatusImpl -idl

To create IIOP-compliant stubs, use the rmic iiop option as shown here:

$ java weblogic.rmic com.utility.BidStatusImpl -iiop
    [ Team LiB ] Previous Section Next Section