FileDocCategorySizeDatePackage
MyServer.javaAPI DocExample1164Sat Apr 23 22:35:38 BST 2005None

MyServer

public class MyServer extends UnicastRemoteObject implements RemoteServer

Fields Summary
Constructors Summary
public MyServer()

 
Methods Summary
public voidasyncExecute(WorkRequest request, WorkListener listener)

		new Thread() {
			public void run() {
				try {
					Thread.sleep(1000);
				} catch ( Exception e ) { }
				
				Object result = request.execute(); 
				try {
					listener.workCompleted( request, result ); 
				} catch ( RemoteException e ) {
					System.out.println( e ); // error calling client
				}
			}}.start();
	
public java.lang.Objectexecute(WorkRequest work)

        return work.execute(  );
    
public java.util.DategetDate()

        return new Date(  );
    
public static voidmain(java.lang.String[] args)

        try {
            RemoteServer server = new MyServer(  );
            Naming.rebind("NiftyServer", server);
        } catch (java.io.IOException e) {
            // problem registering server
        }