WebLogic Server 6.0 Code Examples, BEA Systems, Inc.

Package examples.rmi.multihello

This package takes the simple "HelloWorld" RMI example and extends it to bind multiple unique names in the registry and then display multiple invocations of each to the simple client.

See:
          Description

Interface Summary
Hello This remote interface is implemented by HelloImpl.
 

Class Summary
HelloImpl This remote class implements the Hello remote interface, which returns a 'hello' message identifying this class instance by name.
sayHello This simple example uses WebLogic RMI to say "Hello World" multiple times.
 

Package examples.rmi.multihello Description

This package takes the simple "HelloWorld" RMI example and extends it to bind multiple unique names in the registry and then display multiple invocations of each to the simple client.

In this package is the Remote interface "Hello," which is implemented by the "HelloImpl" class. The "sayHello" class invokes the Remote class from the command line.

Also included in this directory are build scripts for NT, and UNIX. The script compiles the files in this directory and runs the WebLogic RMI compiler on the implementation class.

There are detailed instructions on converting Sun RMI classes to use WebLogic RMI in the Developers Guide. The instructions here are brief and assume that you have or will look at the Developers Guide.

The following section describes how to build and run the examples:

  1. Build the example
  2. Configure the server
  3. Run the example

Build the example

  1. Set up your development shell as described in Setting up your environment.

  2. The build scripts are: Run the appropriate build script (build.cmd, build.sh for UNIX) as shown in this example for Windows NT:
      $ build

Configure the server

To Register HelloImpl as a startup class:
  1. Start the server with the examples configuration in a new command shell.
  2. Bring up the Administration Console in your browser.
  3. Click to expand the Deployments node in the left-hand pane.
  4. Click to expand the Startup & Shutdown node in the left-hand pane.
  5. Select the multihello node.
  6. Select the Targets tab in the right-hand pane to display the Available and Chosen targets.
  7. Deploy the multihello startup class on the examplesServer.

Run the example

  1. Since startup classes are only activated when the server boots, you will need to re-start the server with the examples configuration.

  2. In your development shell, run the client with the following command:
      $ java examples.rmi.multihello.sayHello t3://hostname:port
    where:
    hostname
    Host name of the WebLogic Server
    port
    Port where the WebLogic Server is listening for connections

There's more...

Read more about this WebLogic service in the Developers Guide, Using WebLogic RMI to get more detailed information for your application.


Documentation is available at
http://e-docs.bea.com/wls/docs60

Copyright © 2000 BEA Systems, Inc. All Rights Reserved.