Adobe COLDFUSION 9 Manual page 1333

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using External Resources
The
method should return within a time-out period that you can configure for each event gateway type in the
start
ColdFusion Administrator. If it does not, the ColdFusion Administrator has a Kill on Startup Timeout option for each
gateway type. If you select the option, and a time-out occurs, the ColdFusion starter thread calls an interrupt on the
gateway thread to try to kill it, and then exits.
Note: If the
method is the listener (for example, in a single-threaded gateway), the method does not return until
start
the gateway stops. Do not set the Kill on Startup Timeout option in the ColdFusion Administrator for such gateways.
If the gateway uses a configuration file, load the configuration from the file. Doing so lets users change the
configuration file and restart the gateway without restarting ColdFusion. Also load the configuration file in the
constructor; for more information, see
In the SocketGateway class, the
be the only one.) When the thread starts, it calls a
implement a multi-threaded socket listener and message dispatcher. For more information on the listener, see
"Responding to incoming
messages" on page 1329.
public void start()
{
status = STARTING;
listening=true;
// Start up event generator thread
Runnable r = new Runnable()
{
public void run()
{
socketServer();
}
};
Thread t = new Thread(r);
t.start();
status = RUNNING;
}
The stop method
The
method performs the event gateway shutdown tasks, including shutting down the listener thread or threads
stop
and releasing any resources. The following example shows the SocketGateway
"Class
constructor" on page 1325.
method starts an initial thread. (In a single-threaded Gateway, this thread would
start
socketServer
Last updated 8/5/2010
method, which uses the Java ServerSocket class to
method:
stop
1328

Advertisement

Table of Contents
loading

Table of Contents