|
WebLogic Server 6.0 Code Examples, BEA Systems, Inc. |
See:
Description
Interface Summary | |
HelloCluster | This interface is the remote interface for the weblogic.rmi. |
Class Summary | |
HelloClusterClient | Client for simple clustered RMI service example. |
HelloClusterImpl | This class implements the interface HelloCluster. |
This simple RMI example is generated with the -clusterable flag and is registered as a startup class in the per-cluster properties file, which binds the impl into the cluster-wide, replicated naming tree. The stub that a HelloClient receives can failover and load balance in a cluster.
Note: You'll need a cluster license in order to run this example in a cluster environment. Contact your sales rep for more information.
There isn't anything particularly different about this example from any other RMI example -- which is important to point out -- except in its generation. Note that you add the -clusterable flag to generate a cluster-aware stub.
You can also set up this example so that it operates as a "pinned" RMI object. In this case, leave off the -clusterable flag when you run RMIC, and register the startup class in the per-server properties file for the server where you want the service to be bound. In this case, the service itself will be available from any server in the cluster since all the cluster servers know how to return the unreplicated stub, but if the particular server that hosts the pinned service fails, the service itself will not failover.
These three sections cover what to do:
$ cd %WL_HOME%\samples\examples\cluster\rmi
$ build
The build script compiles the sample .java files and uses weblogic.rmic to generate the clustered stub. The final classes are placed in %WL_HOME%/config/examples/serverclasses.
$ java examples.cluster.rmi.HelloClusterClient -url t3://any cluster node:7001
where parameters are:
|
Documentation is available at http://e-docs.bea.com/wls/docs60 |