Widened, tweaker error messages.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4643 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -32,10 +32,9 @@ import com.threerings.presents.dobj.DObject;
|
|||||||
import com.threerings.presents.dobj.ObjectAccessException;
|
import com.threerings.presents.dobj.ObjectAccessException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to resolve client data when a user starts a session (or when some
|
* Used to resolve client data when a user starts a session (or when some other entity needs access
|
||||||
* other entity needs access to a client object). Implementations will
|
* to a client object). Implementations will want to extend this class and override {@link
|
||||||
* want to extend this class and override {@link #resolveClientData},
|
* #resolveClientData}, making the necessary database calls and populating the client object
|
||||||
* making the necessary database calls and populating the client object
|
|
||||||
* appropriately.
|
* appropriately.
|
||||||
*/
|
*/
|
||||||
public class ClientResolver extends Invoker.Unit
|
public class ClientResolver extends Invoker.Unit
|
||||||
@@ -59,8 +58,8 @@ public class ClientResolver extends Invoker.Unit
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates the {@link ClientObject} derived class that should be created to
|
* Creates the {@link ClientObject} derived class that should be created to kick off the
|
||||||
* kick off the resolution process.
|
* resolution process.
|
||||||
*/
|
*/
|
||||||
public ClientObject createClientObject ()
|
public ClientObject createClientObject ()
|
||||||
{
|
{
|
||||||
@@ -68,13 +67,12 @@ public class ClientResolver extends Invoker.Unit
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called once our client object is registered with the distributed object
|
* Called once our client object is registered with the distributed object system.
|
||||||
* system.
|
|
||||||
*/
|
*/
|
||||||
public void objectAvailable (ClientObject object)
|
public void objectAvailable (ClientObject object)
|
||||||
{
|
{
|
||||||
// we've got our object, so shunt ourselves over to the invoker thread
|
// we've got our object, so shunt ourselves over to the invoker thread to perform database
|
||||||
// to perform database loading
|
// loading
|
||||||
_clobj = object;
|
_clobj = object;
|
||||||
PresentsServer.invoker.postUnit(this);
|
PresentsServer.invoker.postUnit(this);
|
||||||
}
|
}
|
||||||
@@ -114,9 +112,7 @@ public class ClientResolver extends Invoker.Unit
|
|||||||
_clobj.reference();
|
_clobj.reference();
|
||||||
crl.clientResolved(_username, _clobj);
|
crl.clientResolved(_username, _clobj);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.warning("Client resolution listener choked during " +
|
Log.warning("Client resolution listener choked in clientResolved() " + crl);
|
||||||
"resolution notification [crl=" + crl +
|
|
||||||
", clobj=" + _clobj + "].");
|
|
||||||
Log.logStackTrace(e);
|
Log.logStackTrace(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -137,11 +133,10 @@ public class ClientResolver extends Invoker.Unit
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called on the invoker thread which means that it can
|
* This method is called on the invoker thread which means that it can do things like blocking
|
||||||
* do things like blocking database requests and generally whatever is
|
* database requests and generally whatever is necessary to load up all the client data that is
|
||||||
* necessary to load up all the client data that is desired by the
|
* desired by the implentation system. Any exceptions that are thrown will be caught and
|
||||||
* implentation system. Any exceptions that are thrown will be caught
|
* reported as a failure to the client resolution listener.
|
||||||
* and reported as a failure to the client resolution listener.
|
|
||||||
*/
|
*/
|
||||||
protected void resolveClientData (ClientObject clobj)
|
protected void resolveClientData (ClientObject clobj)
|
||||||
throws Exception
|
throws Exception
|
||||||
@@ -150,9 +145,8 @@ public class ClientResolver extends Invoker.Unit
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called on the dobj thread after resolveClientData
|
* This method is called on the dobj thread after resolveClientData returns normally, it should
|
||||||
* returns normally, it should finish populating the client object
|
* finish populating the client object with any data that is NOT loaded from a database.
|
||||||
* with any data that is NOT loaded from a database.
|
|
||||||
*/
|
*/
|
||||||
protected void finishResolution (ClientObject clobj)
|
protected void finishResolution (ClientObject clobj)
|
||||||
{
|
{
|
||||||
@@ -169,10 +163,8 @@ public class ClientResolver extends Invoker.Unit
|
|||||||
try {
|
try {
|
||||||
crl.resolutionFailed(_username, cause);
|
crl.resolutionFailed(_username, cause);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.warning("Client resolution listener choked during " +
|
Log.warning("Client resolution listener choked in resolutionFailed() [crl=" + crl +
|
||||||
"failure notification [crl=" + crl +
|
", username=" + _username + ", cause=" + cause + "].");
|
||||||
", username=" + _username +
|
|
||||||
", cause=" + cause + "].");
|
|
||||||
Log.logStackTrace(e);
|
Log.logStackTrace(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user