ColdFusion 9.0 Resources |
stopSee alsorestart, start, Starting, stopping, and restarting the event gateway in the Developing ColdFusion Applications UsageStops a gateway by performing any required clean-up operations. This method stops any listener thread or threads that monitor the gateway’s event source and releases any other resources. The ColdFusion Administrator calls this function when it stops a gateway instance. This method should update the status information that is returned by the getStatus method to indicate when the gateway is stopping and when the gateway is stopped. ExampleThe following example is the ColdFusion SocketGateway class stop method: public void stop() { status = STOPPING; listening=false; Enumeration e = socketRegistry.elements(); while (e.hasMoreElements()) { try { ((SocketServerThread)e.nextElement()).socket.close(); } catch (IOException e1) { e1.printStackTrace(); } } if (serverSocket != null) { try { serverSocket.close(); } catch (IOException e1) { } serverSocket = null; } status = STOPPED; } |