--- projects/cms/source/server/uk/org/iscream/cms/server/clientinterface/CorbaControlHandlerServant.java 2001/03/13 18:37:08 1.7 +++ projects/cms/source/server/uk/org/iscream/cms/server/clientinterface/CorbaControlHandlerServant.java 2001/03/13 19:14:07 1.8 @@ -15,7 +15,7 @@ import uk.ac.ukc.iscream.client.*; * !!! Need a way to "shutdown" this class !!! * * @author $Author: tdb $ - * @version $Id: CorbaControlHandlerServant.java,v 1.7 2001/03/13 18:37:08 tdb Exp $ + * @version $Id: CorbaControlHandlerServant.java,v 1.8 2001/03/13 19:14:07 tdb Exp $ */ class CorbaControlHandlerServant extends CorbaControlHandlerPOA { @@ -24,7 +24,7 @@ class CorbaControlHandlerServant extends CorbaControlH /** * The current CVS revision of this class */ - public final String REVISION = "$Revision: 1.7 $"; + public final String REVISION = "$Revision: 1.8 $"; //---STATIC METHODS--- @@ -118,6 +118,22 @@ class CorbaControlHandlerServant extends CorbaControlH } /** + * Disconnect, this will shutdown the data and unhook from + * the CORBA ORB. + */ + public void disconnect() { + // close the data handler + stopData(); + // disconnect from the ORB + try { + org.omg.CORBA.Object objRef = _refman.getRootPOA().servant_to_reference(this); + _refman.getORB().disconnect(objRef); + } catch(Exception e) { + _logger.write(this.toString(), Logger.ERROR, "disconnect failed: "+e); + } + } + + /** * Overrides the {@link java.lang.Object#toString() Object.toString()} * method to provide clean logging (every class should have this). * @@ -155,6 +171,11 @@ class CorbaControlHandlerServant extends CorbaControlH * system logger that is being used. */ private Logger _logger = ReferenceManager.getInstance().getLogger(); + + /** + * A reference to the reference manager in use + */ + private ReferenceManager _refman = ReferenceManager.getInstance(); /** * A reference to the PacketSorter.