1   /*
2    * Copyright (C) The Spice Group. All rights reserved.
3    *
4    * This software is published under the terms of the Spice
5    * Software License version 1.1, a copy of which has been included
6    * with this distribution in the LICENSE.txt file.
7    */
8   package org.codehaus.spice.netserve.connection.impl;
9   
10  import java.io.IOException;
11  import java.net.ServerSocket;
12  
13  /***
14   *
15   * @author Peter Donald
16   * @version $Revision: 1.2 $ $Date: 2004/03/21 23:42:59 $
17   */
18  class RecordingAcceptorMonitor
19     extends NullAcceptorMonitor
20  {
21     private IOException m_errorClosingServerSocket;
22     private IOException m_errorAcceptingConnection;
23     private int m_listenCount;
24  
25     public void serverSocketListening( String name, ServerSocket serverSocket )
26     {
27        m_listenCount++;
28        super.serverSocketListening( name, serverSocket );
29     }
30  
31     public void errorAcceptingConnection( String name, IOException ioe )
32     {
33        m_errorAcceptingConnection = ioe;
34        super.errorAcceptingConnection( name, ioe );
35     }
36  
37     public void errorClosingServerSocket( String name, IOException ioe )
38     {
39        m_errorClosingServerSocket = ioe;
40        super.errorClosingServerSocket( name, ioe );
41     }
42  
43     IOException getErrorClosingServerSocket()
44     {
45        return m_errorClosingServerSocket;
46     }
47  
48     IOException getErrorAcceptingConnection()
49     {
50        return m_errorAcceptingConnection;
51     }
52  
53     int getListenCount()
54     {
55        return m_listenCount;
56     }
57  }