|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.omg.PortableServer.Servant
ParkNPark.interfaces.ClientManagerFactoryPOA
ParkNPark.middletier.ClientManagerFactoryImpl
public class ClientManagerFactoryImpl
Creates and manages ClientManager instances for clients
Field Summary | |
---|---|
protected DatabaseManager |
databaseManager
Our database manager instance |
protected Logger |
logger
Logger instance |
protected static int |
MAX_ATTEMPTS
Maximum number of attempts when trying to execute commends on database |
protected PreparedStatement |
pokeStatement
Our database poke prepared statement that is used during database pokes |
protected int |
replySize
Size of reply |
Constructor Summary | |
---|---|
ClientManagerFactoryImpl(Logger logger,
int replySize,
String jdbcURL,
String jdbcUsername,
String jdbcPassword)
Creates a new ClientManagerFactoryImpl instance |
Method Summary | |
---|---|
void |
exitServer()
Kills the server (we don't have graceful shutdowns in this implementation) |
void |
flushLogs()
Flushes the server's log files |
ClientManager |
getClientManager(String clientHostname)
Creates a new client manager instance for a new client |
ClientManager |
getExistingClientManager(int clientID,
String clientHostname)
Returns the existing client manager instance for an existing client. |
void |
hoseDatabaseConnection()
Causes the server's database connection to become "hosed," meaning that it will fail to work after this method is called. |
void |
killServer()
Kills the server |
void |
poke()
Pokes the server to see if it is still alive and that it can still communicate with the database |
Methods inherited from class ParkNPark.interfaces.ClientManagerFactoryPOA |
---|
_all_interfaces, _invoke, _this, _this |
Methods inherited from class org.omg.PortableServer.Servant |
---|
_default_POA, _get_delegate, _get_interface_def, _is_a, _non_existent, _object_id, _orb, _poa, _set_delegate, _this_object, _this_object |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int MAX_ATTEMPTS
protected DatabaseManager databaseManager
protected int replySize
protected Logger logger
protected PreparedStatement pokeStatement
Constructor Detail |
---|
public ClientManagerFactoryImpl(Logger logger, int replySize, String jdbcURL, String jdbcUsername, String jdbcPassword) throws SQLException
logger
- The Logger to write performance data toreplySize
- The size of the message replies to usejdbcURL
- The JDBC URL to use in the database connectionjdbcUsername
- The username to use in the database connectionjdbcPassword
- The password to use in the database connection
SQLException
- Thrown when a problem prevents a connection
to the databaseMethod Detail |
---|
public ClientManager getClientManager(String clientHostname) throws ServiceUnavailableException
clientHostname
- The host name of the client
ServiceUnavailableException
- Thrown if the database cannot be
contacted or if some other reason prevents the client manager from
being created successfullypublic ClientManager getExistingClientManager(int clientID, String clientHostname) throws ServiceUnavailableException, InvalidClientException
clientID
- The ID of the client to get the ClientManager ofclientHostname
- The host name of the client
InvalidClientException
- Thrown when the given client ID is not known to the system
ServiceUnavailableException
- Thrown if the database cannot be contacted or if
some other reason prevents the client manager from being retrieved successfullypublic void poke() throws ServiceUnavailableException
ServiceUnavailableException
- Thrown when the server's database
connection is not workingpublic void hoseDatabaseConnection()
public void flushLogs()
public void killServer()
public void exitServer()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |