|
|||||||||
| Home >> All >> org >> enhydra >> servlet >> [ connectionMethods overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.enhydra.servlet.connectionMethods
Class ConnectionMethodManager

java.lang.Objectorg.enhydra.servlet.connectionMethods.ConnectionMethodManager
- public class ConnectionMethodManager
- extends java.lang.Object
This class maintains a set of ConnectionMethods. Each ConnectionMethod is associated with an identification string (symbolic name). This ID string is used to retrieve a ConnectionMethod.
This class does not monitor the creation of ConnectionMethods. If you create one, you are responsible for adding it. These public methods are the only things that modify the set of ConnectionMethods managed by this class. (Note that this is different than the ServletManager, which is responsible for creating the Servlets it manages.)
| Nested Class Summary | |
private class |
ConnectionMethodManager.TableEntry
|
| Constructor Summary | |
ConnectionMethodManager()
Create a new, empty, ConnectionMethodManager. |
|
| Method Summary | |
void |
add(java.lang.String connectionID,
ConnectionMethod cm)
Add a ConnectionMethod to the set. |
private void |
addAdditionalConnectionMethods(com.lutris.util.Config config)
Add any additional connection methods defined in the config file as ConnectionMethod. |
protected void |
addConnectionMethod(com.lutris.util.Config connectionConfig,
java.lang.String id)
This function will try to retrieve a Class object for the given connection method. |
void |
createConnectionSection(com.lutris.util.Config config)
Asks each connection method to write itself out to the config file |
void |
delete(java.lang.String connectionID)
Remove a ConnectionMethod from the set. |
ConnectionMethod |
get(java.lang.String connectionID)
Look up a ConnectionMethod from the set, by its identifier string. |
java.util.Hashtable |
getDefaultConnectionMethods()
Return the hashtable of 'default' connection methods plus any additional connection methods found in the conf file maked as ConnectionMethod. |
java.lang.String[] |
getIDs()
Get all the names of the ConnectionMethods currently in the set. |
java.lang.String |
getUniqueName()
Generate a unique name that is not currently in the table. |
void |
initConnectionMethods(com.lutris.util.Config config)
Parse the Connection section of the config file and attempt to create all specified connection types. |
java.lang.String |
toString()
Returns a multi-line list of the contents of this manager, connection methods and channels. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
PORT
public static final java.lang.String PORT
- See Also:
- Constant Field Values
BIND_ADDR
public static final java.lang.String BIND_ADDR
- See Also:
- Constant Field Values
NUM_THREADS
public static final java.lang.String NUM_THREADS
- See Also:
- Constant Field Values
QUEUE_SIZE
public static final java.lang.String QUEUE_SIZE
- See Also:
- Constant Field Values
THREAD_TIMEOUT
public static final java.lang.String THREAD_TIMEOUT
- See Also:
- Constant Field Values
CLIENT_TIMEOUT
public static final java.lang.String CLIENT_TIMEOUT
- See Also:
- Constant Field Values
SERVER_HOST
public static final java.lang.String SERVER_HOST
- See Also:
- Constant Field Values
SERVER_PORT
public static final java.lang.String SERVER_PORT
- See Also:
- Constant Field Values
CONNECTION_METHOD
public static final java.lang.String CONNECTION_METHOD
- See Also:
- Constant Field Values
CONNECTION
public static final java.lang.String CONNECTION
- See Also:
- Constant Field Values
TYPE
public static final java.lang.String TYPE
- See Also:
- Constant Field Values
APACHE
public static final java.lang.String APACHE
- See Also:
- Constant Field Values
CGI
public static final java.lang.String CGI
- See Also:
- Constant Field Values
HTTP
public static final java.lang.String HTTP
- See Also:
- Constant Field Values
HTTPS
public static final java.lang.String HTTPS
- See Also:
- Constant Field Values
IIS
public static final java.lang.String IIS
- See Also:
- Constant Field Values
RMI
public static final java.lang.String RMI
- See Also:
- Constant Field Values
WAI
public static final java.lang.String WAI
- See Also:
- Constant Field Values
ENHYDRADIRECTOR
public static final java.lang.String ENHYDRADIRECTOR
- See Also:
- Constant Field Values
HTTP_CONNECTION
public static final java.lang.String HTTP_CONNECTION
- See Also:
- Constant Field Values
HTTPS_CONNECTION
public static final java.lang.String HTTPS_CONNECTION
- See Also:
- Constant Field Values
ENHYDRADIRECTOR_CONNECTION
public static final java.lang.String ENHYDRADIRECTOR_CONNECTION
- See Also:
- Constant Field Values
CONNECTION_TYPE_COUNT
private static final int CONNECTION_TYPE_COUNT
- See Also:
- Constant Field Values
connectionTable
private java.util.Hashtable connectionTable
logChannel
protected com.lutris.logging.LogChannel logChannel
- The logging channel.
nameCounter
private int nameCounter
theConnections
private java.util.Hashtable theConnections
| Constructor Detail |
ConnectionMethodManager
public ConnectionMethodManager()
- Create a new, empty, ConnectionMethodManager.
| Method Detail |
initConnectionMethods
public void initConnectionMethods(com.lutris.util.Config config) throws ConnectionMethodException
- Parse the Connection section of the config file and attempt to
create all specified connection types.
addConnectionMethod
protected void addConnectionMethod(com.lutris.util.Config connectionConfig, java.lang.String id) throws ConnectionMethodException
- This function will try to retrieve a Class object for the given
connection method. The first attempt will assume the Type
specified in the config file is an abbreviated name (eg. Http)
and use a translation table to find the appropriate class name. If
this fails, the Type specified in the config file will be assumed to
be a fully qualified class name and an attempt to retrieve the Class
object will be made again. If it fails, an exception is thrown.
Otherwise the Class object is instantiated and the connection method
is initiailized and added to the connection pool.
add
public void add(java.lang.String connectionID, ConnectionMethod cm) throws ConnectionMethodException
- Add a ConnectionMethod to the set. It will be referred to by the
given identifer string.
get
public ConnectionMethod get(java.lang.String connectionID)
- Look up a ConnectionMethod from the set, by its identifier string.
getIDs
public java.lang.String[] getIDs()
- Get all the names of the ConnectionMethods currently in the set.
addAdditionalConnectionMethods
private void addAdditionalConnectionMethods(com.lutris.util.Config config) throws ConnectionMethodException
- Add any additional connection methods defined in the config file as
ConnectionMethod.
=
getDefaultConnectionMethods
public java.util.Hashtable getDefaultConnectionMethods()
- Return the hashtable of 'default' connection methods plus any
additional connection methods found in the conf file maked as
ConnectionMethod.
=
delete
public void delete(java.lang.String connectionID) throws ConnectionMethodException
- Remove a ConnectionMethod from the set.
getUniqueName
public java.lang.String getUniqueName()
- Generate a unique name that is not currently in the table.
This may be used when adding a new connection method and you
don't have a specific ID string you want to use. The names
generated by this function are unique across all calls to this
function, not just unique given the current set of connection
methods. Therefore it is safe to get a name and use it later.
The name will not be given out again, so the name should be
unused when you want to use it to add a connection method.
createConnectionSection
public void createConnectionSection(com.lutris.util.Config config) throws com.lutris.util.ConfigException, com.lutris.util.KeywordValueException
- Asks each connection method to write itself out to the config file
toString
public java.lang.String toString()
- Returns a multi-line list of the contents of this manager,
connection methods and channels.
|
|||||||||
| Home >> All >> org >> enhydra >> servlet >> [ connectionMethods overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.enhydra.servlet.connectionMethods.ConnectionMethodManager