Main Menu
Lecture 1
Lecture 2
Lecture 4
Lecture 5
Lecture 6
Lecture 7
 

 

 

Application Control Points

1. Server startup

When the application launches it constructs a single application object

public Application() {
super();
/* ** Put your application initialization code here ** */
System.out.println("First step: Server starting up");
}

2. Application Runs

Waits for requests

Serves requests from users via Top Page URL requests

3. Server shutdown

When the application terminates, the last thing that happens is a call to terminate

You can override terminate to include your cleanup code

public void terminate() {
/* ** Put your application shutdown code here ** */
System.out.println("Last step: Server shut down");
super.terminate();
}

NOTE: you should not call any code from other classes here