TelnetD at SF

net.wimpi.telnetd.net
Class ConnectionManager

java.lang.Object
  extended bynet.wimpi.telnetd.net.ConnectionManager
All Implemented Interfaces:
java.lang.Runnable

public class ConnectionManager
extends java.lang.Object
implements java.lang.Runnable

Class that takes care for active and queued connection. Housekeeping is done also for connections that were just broken off, or exceeded their timeout. Note that instances of this class can only be created by using the factory method createConnectionManager(Properties settings).

Version:
2.0 (13/03/2005)
Author:
Dieter Wimberger

Method Summary
static ConnectionManager createConnectionManager(java.lang.String name, java.util.Properties settings)
          Factory method for the ConnectionManager.
 ConnectionFilter getConnectionFilter()
          Gets the active ConnectionFilter instance or returns null if no filter is set.
 void makeConnection(java.net.Socket insock)
          Method that that tries to connect an incoming request.
 void registerClosedConnection(Connection con)
          Called by connections that got broken (i.e.
 void run()
          Periodically does following work: cleaning up died connections.
 void setConnectionFilter(ConnectionFilter filter)
          Set a connection filter for this ConnectionManager instance.
 void start()
          Starts this ConnectionManager.
 void stop()
          Stops this ConnectionManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setConnectionFilter

public void setConnectionFilter(ConnectionFilter filter)
Set a connection filter for this ConnectionManager instance. The filter is used to handle IP level allow/deny of incoming connections.

Parameters:
filter - ConnectionFilter instance.

getConnectionFilter

public ConnectionFilter getConnectionFilter()
Gets the active ConnectionFilter instance or returns null if no filter is set.

Returns:
the managers ConnectionFilter.

start

public void start()
Starts this ConnectionManager.


stop

public void stop()
Stops this ConnectionManager.


makeConnection

public void makeConnection(java.net.Socket insock)
Method that that tries to connect an incoming request. Properly queueing.

Parameters:
insock - Socket thats representing the incoming connection.

run

public void run()
Periodically does following work:

Specified by:
run in interface java.lang.Runnable

registerClosedConnection

public void registerClosedConnection(Connection con)
Called by connections that got broken (i.e. I/O errors). The housekeeper will properly close the connection, and take care for misc necessary cleanup.

Parameters:
con - the connection that is broken. public void registerBrokenConnection(Connection con) { if (!m_BrokenConnections.contains(con) && !m_ClosedConnections.contains(con)) { log.debug("registerBrokenConnection()::" + con.toString()); m_BrokenConnections.push(con); } }//registerBrokenConnection

createConnectionManager

public static ConnectionManager createConnectionManager(java.lang.String name,
                                                        java.util.Properties settings)
                                                 throws BootException
Factory method for the ConnectionManager.
A class operation that will return a new ConnectionManager instance.

Parameters:
settings - Properties containing the settings for this instance.
Throws:
BootException

TelnetD at SF

Copyright 2000-2005 Dieter Wimberger.