Updated to use new DatabaseException.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5347 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2008-09-03 16:20:30 +00:00
parent addb1971dd
commit 5a41c876b4
3 changed files with 3 additions and 15 deletions
@@ -25,8 +25,8 @@ import java.util.HashMap;
import com.google.inject.Singleton;
import com.samskivert.io.PersistenceException;
import com.samskivert.jdbc.WriteOnlyUnit;
import com.samskivert.jdbc.depot.DatabaseException;
import com.samskivert.jdbc.depot.PersistenceContext;
import com.samskivert.util.Invoker;
import com.samskivert.util.StringUtil;
@@ -55,7 +55,6 @@ public class DatabaseConfigRegistry extends ConfigRegistry
* initialization) so as to avoid blocking the distributed object thread.
*/
public DatabaseConfigRegistry (PersistenceContext ctx, Invoker invoker)
throws PersistenceException
{
this(ctx, invoker, false);
}
@@ -69,7 +68,6 @@ public class DatabaseConfigRegistry extends ConfigRegistry
* @param transitioning if the values in the database need to be transitioned to a new format
*/
public DatabaseConfigRegistry (PersistenceContext ctx, Invoker invoker, boolean transitioning)
throws PersistenceException
{
this(ctx, invoker, "", transitioning);
}
@@ -84,7 +82,6 @@ public class DatabaseConfigRegistry extends ConfigRegistry
* separate configs, then specify a node for each server
*/
public DatabaseConfigRegistry (PersistenceContext ctx, Invoker invoker, String node)
throws PersistenceException
{
this(ctx, invoker, node, false);
}
@@ -100,8 +97,7 @@ public class DatabaseConfigRegistry extends ConfigRegistry
* @param transitioning if the values in the database need to be transitioned to a new format
*/
public DatabaseConfigRegistry (PersistenceContext ctx, Invoker invoker, String node,
boolean transitioning)
throws PersistenceException
boolean transitioning)
{
super(transitioning);
_repo = new ConfigRepository(ctx);
@@ -133,7 +129,7 @@ public class DatabaseConfigRegistry extends ConfigRegistry
// can predictably make use of the configuration information that we load
try {
_data = _repo.loadConfig(_node, _path);
} catch (PersistenceException pe) {
} catch (DatabaseException pe) {
log.warning("Failed to load object configuration [path=" + _path + "].", pe);
_data = new HashMap<String, String>();
}
@@ -24,7 +24,6 @@ package com.threerings.admin.server.persist;
import java.util.HashMap;
import java.util.Set;
import com.samskivert.io.PersistenceException;
import com.samskivert.jdbc.depot.DepotRepository;
import com.samskivert.jdbc.depot.PersistenceContext;
import com.samskivert.jdbc.depot.PersistentRecord;
@@ -49,7 +48,6 @@ public class ConfigRepository extends DepotRepository
* @return a map containing field/value pairs for all stored configuration data.
*/
public HashMap<String, String> loadConfig (String node, String object)
throws PersistenceException
{
HashMap<String, String> data = new HashMap<String, String>();
Where where = new Where(ConfigRecord.OBJECT_C, object, ConfigRecord.NODE_C, node);
@@ -63,7 +61,6 @@ public class ConfigRepository extends DepotRepository
* Updates the specified configuration datum.
*/
public void updateConfig (String node, String object, String field, String value)
throws PersistenceException
{
store(new ConfigRecord(node, object, field, value));
}
@@ -28,7 +28,6 @@ import java.util.Set;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.samskivert.io.PersistenceException;
import com.samskivert.jdbc.depot.DepotRepository;
import com.samskivert.jdbc.depot.PersistenceContext;
import com.samskivert.jdbc.depot.PersistentRecord;
@@ -51,7 +50,6 @@ public class NodeRepository extends DepotRepository
* Returns a list of all nodes registered in the repository.
*/
public List<NodeRecord> loadNodes ()
throws PersistenceException
{
return findAll(NodeRecord.class);
}
@@ -60,7 +58,6 @@ public class NodeRepository extends DepotRepository
* Updates the supplied node record, inserting it into the database if necessary.
*/
public void updateNode (NodeRecord record)
throws PersistenceException
{
record.lastUpdated = new Timestamp(System.currentTimeMillis());
store(record);
@@ -71,7 +68,6 @@ public class NodeRepository extends DepotRepository
* alive and well.
*/
public void heartbeatNode (String nodeName)
throws PersistenceException
{
updatePartial(NodeRecord.class, nodeName, new Object[] {
NodeRecord.LAST_UPDATED, new Timestamp(System.currentTimeMillis())
@@ -82,7 +78,6 @@ public class NodeRepository extends DepotRepository
* Deletes the identified node record.
*/
public void deleteNode (String nodeName)
throws PersistenceException
{
// INDEX: Full primary key.
delete(NodeRecord.class, nodeName);