FileDocCategorySizeDatePackage
HelloImpl.javaAPI DocExample2817Wed Apr 19 11:20:14 BST 2000examples.rmisocfac

HelloImpl

public class HelloImpl extends UnicastRemoteObject implements Hello

Fields Summary
Constructors Summary
public HelloImpl(String protocol, byte[] pattern)

	super(0, new MultiClientSocketFactory(protocol, pattern),
	      new MultiServerSocketFactory(protocol, pattern));
    
Methods Summary
public static voidmain(java.lang.String[] args)


	//Create and install a security manager
	if (System.getSecurityManager() == null)
	    System.setSecurityManager(new RMISecurityManager());
        byte [] aPattern = { (byte)1011 }; 
	try {
	    HelloImpl obj = new HelloImpl("xor", aPattern);
	    //HelloImpl obj = new HelloImpl("compression", null);
	    Naming.rebind("/HelloServer", obj);
	    System.out.println("HelloServer bound in registry");
	} catch (Exception e) {
	    System.out.println("HelloImpl err: " + e.getMessage());
	    e.printStackTrace();
	}
    
public java.lang.StringsayHello()

        return  "Hello World!";