WebLogic Server 6.0 Code Examples, BEA Systems, Inc.

examples.rmi.multihello
Class HelloImpl

java.lang.Object
  |
  +--examples.rmi.multihello.HelloImpl
All Implemented Interfaces:
Hello, weblogic.rmi.Remote, java.rmi.Remote

public class HelloImpl
extends java.lang.Object
implements Hello

This remote class implements the Hello remote interface, which returns a 'hello' message identifying this class instance by name.

The main() method registers 10 instances of this class in the RMI registry of the WebLogic Server. For this example, you should register this class as a startupClass in the Administration Console. This will cause main() to be invoked when you start the WebLogic Server, and thus will instantiate 10 instances and register them in the RMI registry. In this example, the ClientApp Java application invokes the sayHello() remote methods on each of the remote instances of this class multiple times via different protocols with WebLogic RMI.

Author:
Copyright (c) 1997-98 by WebLogic, Inc. All Rights Reserved., Copyright (c) 1999-2000 by BEA Systems, Inc. All Rights Reserved.

Constructor Summary
HelloImpl(java.lang.String s)
          Creates a HelloImpl with the specified string.
 
Method Summary
static void main(java.lang.String[] args)
          Creates and binds 10 HelloImpl objects in the WebLogic Server and binds each to a unique name.
 java.lang.String sayHello()
          Returns the string message for a HelloImpl.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HelloImpl

public HelloImpl(java.lang.String s)
          throws weblogic.rmi.RemoteException
Creates a HelloImpl with the specified string.
Parameters:
s - String message
Throws:
weblogic.rmi.RemoteException - if the impl cannot be created
Method Detail

main

public static void main(java.lang.String[] args)
Creates and binds 10 HelloImpl objects in the WebLogic Server and binds each to a unique name.

sayHello

public java.lang.String sayHello()
                          throws weblogic.rmi.RemoteException
Returns the string message for a HelloImpl.
Specified by:
sayHello in interface Hello
Returns:
String message
Throws:
weblogic.rmi.RemoteException - if there is an error

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

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