/** * CORBA Training * The Repertory Application * 1999-2003 * *@author Fabienne.Boyer@imag.fr , Didier.Donsez@imag.fr */ package corbatraining; import MAdmin.*; import org.omg.CORBA.*; import org.omg.PortableServer.*; import org.omg.PortableServer.POA; /** * Implementation of the Shutdown IDL interface * *@author Fabienne Boyer, Didier Donsez */ public class ShutdownImpl extends ShutdownPOA { private ORB orb; private POA poa; /** * Sets the pOA attribute of the ShutdownImpl object * *@param poa The new pOA value */ public void setPOA(POA poa) { this.poa = poa; } /** * Sets the oRB attribute of the ShutdownImpl object * *@param orb The new oRB value */ public void setORB(ORB orb) { this.orb = orb; } /** * the implementation of the shutdown operation * *@param delayInSec Description of the Parameter */ public void shutdown(int delayInSec) { System.out.println("Shutdown the server in " + delayInSec + " sec."); while((delayInSec--)>0){ try { Thread.sleep(1000); } catch (java.lang.InterruptedException e) { // do nothing } System.out.print("."); System.out.flush(); } orb.shutdown(false); } }