www.pudn.com > jnp-src.rar > DateServerImpl.java
/*
* Java Network Programming, Second Edition
* Merlin Hughes, Michael Shoffner, Derek Hamner
* Manning Publications Company; ISBN 188477749X
*
* http://nitric.com/jnp/
*
* Copyright (c) 1997-1999 Merlin Hughes, Michael Shoffner, Derek Hamner;
* all rights reserved; see license.txt for details.
*/
import java.rmi.*;
import java.rmi.server.*;
import java.util.Date;
public class DateServerImpl extends UnicastRemoteObject implements DateServer {
public DateServerImpl () throws RemoteException {
}
public Date getDate () {
return new Date ();
}
public static void main (String[] args) throws Exception {
DateServerImpl dateServer = new DateServerImpl ();
Naming.bind ("Date Server", dateServer);
}
}