questions on a segment of java server program
<p>I am trying to understand the following segment of java code, which was implemented as a simple server</p>

<pre><code>public class testserver extends AbstractHandler
{
   public void handle(String target,
                   Request baseRequest,
                   HttpServletRequest request,
                   HttpServletResponse response) 
    throws IOException, ServletException
 {
    response.setContentType("movie/html");
    response.setStatus(HttpServletResponse.SC_OK);
    baseRequest.setHandled(true);
    response.getWriter().println("&lt;h1&gt;this is a test&lt;/h1&gt;");
 }

public static void main(String[] args) throws Exception
{
    Server server = new Server(1234);
    server.setHandler(new testserver());

    server.start();
    server.join();
}
</code></pre>

<p>}</p>

<p>I am kind of confusing about the logic of this code. In specific, in the "main" fuction, it has </p>

<pre><code>server.setHandler(new testserver());
</code></pre>

<p>I know it is to create a new server. But this main function is included in the class of testserver itself. So it functions as calling itself recursively, and it will create a lot of testserver. Is my understanding correct?</p>
