ServerTest3.java



/** Messageの通信のテスト */
import java.net.*;
import java.rmi.*;
public class ServerTest3 {

  /** 起動時に呼び出されるメソッド */
    public static void main( String argv[] ) {

        System.setSecurityManager( new RMISecurityManager() );
        try {
            InetAddress host = InetAddress.getLocalHost();
            String hostName = host.getHostName();
            String serverName
                 = "rmi://" + hostName + "/TalkServer_Elephant";
            TalkServerImpl2 server = new TalkServerImpl2( serverName );
            System.out.println( "TalkServer2 started." );
         }
         catch( Exception e ) {
            System.err.println( "Error:" + e.toString() );
            System.exit(-1);
         }
    }
}