Switch to new samskivert logging API.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5134 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -21,11 +21,10 @@
|
||||
|
||||
package com.threerings;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
import com.samskivert.util.Logger;
|
||||
|
||||
/**
|
||||
* A placeholder class that contains a reference to the log object used by this
|
||||
* project.
|
||||
* Contains a reference to the log object used by this project.
|
||||
*/
|
||||
public class NaryaLog
|
||||
{
|
||||
|
||||
@@ -21,8 +21,7 @@
|
||||
|
||||
package com.threerings.admin;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import com.samskivert.util.Logger;
|
||||
|
||||
/**
|
||||
* Contains a reference to the log object used by the Admin services.
|
||||
@@ -31,28 +30,4 @@ public class Log
|
||||
{
|
||||
/** We dispatch our log messages through this logger. */
|
||||
public static Logger log = Logger.getLogger("com.threerings.narya.admin");
|
||||
|
||||
/** Convenience function. */
|
||||
public static void debug (String message)
|
||||
{
|
||||
log.fine(message);
|
||||
}
|
||||
|
||||
/** Convenience function. */
|
||||
public static void info (String message)
|
||||
{
|
||||
log.info(message);
|
||||
}
|
||||
|
||||
/** Convenience function. */
|
||||
public static void warning (String message)
|
||||
{
|
||||
log.warning(message);
|
||||
}
|
||||
|
||||
/** Convenience function. */
|
||||
public static void logStackTrace (Throwable t)
|
||||
{
|
||||
log.log(Level.WARNING, t.getMessage(), t);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ import com.samskivert.util.StringUtil;
|
||||
import com.threerings.presents.dobj.DObject;
|
||||
import com.threerings.presents.util.PresentsContext;
|
||||
|
||||
import com.threerings.admin.Log;
|
||||
import static com.threerings.admin.Log.log;
|
||||
|
||||
/**
|
||||
* Used to display and edit a particular distributed object field.
|
||||
@@ -89,7 +89,7 @@ public class AsStringFieldEditor extends FieldEditor
|
||||
return new Boolean(_value.getText().equalsIgnoreCase("true"));
|
||||
|
||||
} else {
|
||||
Log.warning("Unknown field type '" + _field.getName() + "': " +
|
||||
log.warning("Unknown field type '" + _field.getName() + "': " +
|
||||
_field.getType().getName() + ".");
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import com.samskivert.swing.VGroupLayout;
|
||||
|
||||
import com.threerings.presents.util.PresentsContext;
|
||||
|
||||
import com.threerings.admin.Log;
|
||||
import static com.threerings.admin.Log.log;
|
||||
|
||||
/**
|
||||
* Fetches a list of the configuration objects in use by the server and
|
||||
@@ -111,7 +111,7 @@ public class ConfigEditorPanel extends JPanel
|
||||
// documentation inherited from interface
|
||||
public void requestFailed (String reason)
|
||||
{
|
||||
Log.warning("Failed to get config info [reason=" + reason + "].");
|
||||
log.warning("Failed to get config info [reason=" + reason + "].");
|
||||
}
|
||||
|
||||
/** Our client context. */
|
||||
|
||||
@@ -32,10 +32,11 @@ import com.threerings.presents.dobj.DObjectManager;
|
||||
import com.threerings.presents.dobj.ObjectAccessException;
|
||||
import com.threerings.presents.dobj.Subscriber;
|
||||
|
||||
import com.threerings.admin.Log;
|
||||
import com.threerings.admin.data.AdminCodes;
|
||||
import com.threerings.admin.data.ConfigObject;
|
||||
|
||||
import static com.threerings.admin.Log.log;
|
||||
|
||||
/**
|
||||
* Handles subscribing to admin config objects.
|
||||
*/
|
||||
@@ -84,7 +85,7 @@ public class ConfigObjectManager implements AdminService.ConfigInfoListener
|
||||
// documentation inherited from interface AdminService.ConfigInfoListener
|
||||
public void requestFailed (String reason)
|
||||
{
|
||||
Log.warning("Oh bugger, we didn't get the config data: " + reason);
|
||||
log.warning("Oh bugger, we didn't get the config data: " + reason);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -121,7 +122,7 @@ public class ConfigObjectManager implements AdminService.ConfigInfoListener
|
||||
|
||||
// documentation inherited from interface Subscriber
|
||||
public void requestFailed (int oid, ObjectAccessException cause) {
|
||||
Log.warning("Unable to subscribe to config object " + _key);
|
||||
log.warning("Unable to subscribe to config object " + _key);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -40,7 +40,6 @@ import com.samskivert.util.ClassUtil;
|
||||
import com.samskivert.util.ComparableArrayList;
|
||||
import com.samskivert.util.ListUtil;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.dobj.AttributeChangeListener;
|
||||
import com.threerings.presents.dobj.AttributeChangedEvent;
|
||||
import com.threerings.presents.dobj.DObject;
|
||||
@@ -50,6 +49,8 @@ import com.threerings.presents.dobj.EntryRemovedEvent;
|
||||
import com.threerings.presents.dobj.EntryUpdatedEvent;
|
||||
import com.threerings.presents.dobj.SetListener;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* Allows simple editing of DSets within a distributed object.
|
||||
*/
|
||||
|
||||
@@ -43,7 +43,7 @@ import com.threerings.presents.dobj.DObject;
|
||||
import com.threerings.presents.dobj.ObjectAccessException;
|
||||
import com.threerings.presents.util.PresentsContext;
|
||||
|
||||
import com.threerings.admin.Log;
|
||||
import static com.threerings.admin.Log.log;
|
||||
|
||||
/**
|
||||
* Used to display and edit a particular distributed object field.
|
||||
@@ -107,7 +107,7 @@ public abstract class FieldEditor extends JPanel
|
||||
try {
|
||||
_object.changeAttribute(_field.getName(), value);
|
||||
} catch (ObjectAccessException oae) {
|
||||
Log.warning("Failed to update field " + _field.getName() +
|
||||
log.warning("Failed to update field " + _field.getName() +
|
||||
": "+ oae);
|
||||
}
|
||||
}
|
||||
@@ -128,7 +128,7 @@ public abstract class FieldEditor extends JPanel
|
||||
try {
|
||||
dvalue = getDisplayValue();
|
||||
} catch (Exception e) {
|
||||
Log.warning("Failed to parse display value " + e + ".");
|
||||
log.warning("Failed to parse display value " + e + ".");
|
||||
displayValue(getValue());
|
||||
}
|
||||
updateBorder(!ObjectUtil.equals(dvalue, getValue()));
|
||||
@@ -154,7 +154,7 @@ public abstract class FieldEditor extends JPanel
|
||||
try {
|
||||
return _field.get(_object);
|
||||
} catch (Exception e) {
|
||||
Log.warning("Failed to fetch field [field=" + _field +
|
||||
log.warning("Failed to fetch field [field=" + _field +
|
||||
", object=" + _object + ", error=" + e + "].");
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -37,9 +37,10 @@ import com.threerings.presents.dobj.Subscriber;
|
||||
import com.threerings.presents.util.PresentsContext;
|
||||
import com.threerings.presents.util.SafeSubscriber;
|
||||
|
||||
import com.threerings.admin.Log;
|
||||
import com.threerings.admin.data.ConfigObject;
|
||||
|
||||
import static com.threerings.admin.Log.log;
|
||||
|
||||
/**
|
||||
* Used to edit the distributed object fields of a particular
|
||||
* configuration object. When the panel is first shown, it will subscribe
|
||||
@@ -111,7 +112,7 @@ public class ObjectEditorPanel extends ScrollablePanel
|
||||
}
|
||||
|
||||
} catch (SecurityException se) {
|
||||
Log.warning("Unable to introspect DObject!? " + se);
|
||||
log.warning("Unable to introspect DObject!? " + se);
|
||||
}
|
||||
|
||||
SwingUtil.refresh(this);
|
||||
@@ -120,7 +121,7 @@ public class ObjectEditorPanel extends ScrollablePanel
|
||||
// documentation inherited from interface
|
||||
public void requestFailed (int oid, ObjectAccessException cause)
|
||||
{
|
||||
Log.warning("Unable to subscribe to config object: " + cause);
|
||||
log.warning("Unable to subscribe to config object: " + cause);
|
||||
}
|
||||
|
||||
protected PresentsContext _ctx;
|
||||
|
||||
@@ -30,7 +30,7 @@ import com.samskivert.util.ObjectUtil;
|
||||
import com.threerings.presents.dobj.DObject;
|
||||
import com.threerings.presents.util.PresentsContext;
|
||||
|
||||
import com.threerings.admin.Log;
|
||||
import static com.threerings.admin.Log.log;
|
||||
|
||||
/**
|
||||
* Allows editing of a dobj field using a pulldown.
|
||||
@@ -132,7 +132,7 @@ public class PulldownFieldEditor extends FieldEditor
|
||||
}
|
||||
|
||||
// cause shit to blow up minorly
|
||||
Log.warning("Value in dobj is not settable, disabling choice.");
|
||||
log.warning("Value in dobj is not settable, disabling choice.");
|
||||
Thread.dumpStack();
|
||||
_value.setEnabled(false);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@ import java.util.HashMap;
|
||||
|
||||
import com.samskivert.io.ByteArrayOutInputStream;
|
||||
import com.samskivert.util.StringUtil;
|
||||
import com.threerings.admin.Log;
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
import com.threerings.io.Streamable;
|
||||
@@ -47,6 +46,8 @@ import com.threerings.presents.dobj.EntryUpdatedEvent;
|
||||
import com.threerings.presents.dobj.ObjectAccessException;
|
||||
import com.threerings.presents.dobj.SetListener;
|
||||
|
||||
import static com.threerings.admin.Log.log;
|
||||
|
||||
/**
|
||||
* Provides a registry of configuration distributed objects. Using distributed object to store
|
||||
* runtime configuration data can be exceptionally useful in that clients (with admin privileges)
|
||||
@@ -166,7 +167,7 @@ public abstract class ConfigRegistry
|
||||
object.addListener(this);
|
||||
|
||||
} catch (SecurityException se) {
|
||||
Log.warning("Unable to reflect on " + cclass.getName() + ": " + se + ". " +
|
||||
log.warning("Unable to reflect on " + cclass.getName() + ": " + se + ". " +
|
||||
"Refusing to monitor object.");
|
||||
}
|
||||
}
|
||||
@@ -196,7 +197,7 @@ public abstract class ConfigRegistry
|
||||
try {
|
||||
value = object.getAttribute(event.getName());
|
||||
} catch (ObjectAccessException oae) {
|
||||
Log.warning("Exception getting field [name=" + event.getName() +
|
||||
log.warning("Exception getting field [name=" + event.getName() +
|
||||
", exception=" + oae + "].");
|
||||
return;
|
||||
}
|
||||
@@ -239,7 +240,7 @@ public abstract class ConfigRegistry
|
||||
} else if (value instanceof long[]) {
|
||||
setValue(key, (long[]) value);
|
||||
} else {
|
||||
Log.info("Unable to flush config obj change [cobj=" + object.getClass().getName() +
|
||||
log.info("Unable to flush config obj change [cobj=" + object.getClass().getName() +
|
||||
", key=" + key + ", type=" + value.getClass().getName() +
|
||||
", value=" + value + "].");
|
||||
}
|
||||
@@ -314,18 +315,18 @@ public abstract class ConfigRegistry
|
||||
serialize(key, nameToKey(key), deserializedValue);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.warning("Failure decoding config value [type=" + type +
|
||||
log.warning("Failure decoding config value [type=" + type +
|
||||
", field=" + field + ", exception=" + e + "].");
|
||||
}
|
||||
|
||||
} else {
|
||||
Log.warning("Can't init field of unknown type " +
|
||||
log.warning("Can't init field of unknown type " +
|
||||
"[cobj=" + object.getClass().getName() + ", key=" + key +
|
||||
", type=" + type.getName() + "].");
|
||||
}
|
||||
|
||||
} catch (IllegalAccessException iae) {
|
||||
Log.warning("Can't set field [cobj=" + object.getClass().getName() +
|
||||
log.warning("Can't set field [cobj=" + object.getClass().getName() +
|
||||
", key=" + key + ", error=" + iae + "].");
|
||||
}
|
||||
}
|
||||
@@ -340,7 +341,7 @@ public abstract class ConfigRegistry
|
||||
try {
|
||||
value = object.getAttribute(attributeName);
|
||||
} catch (ObjectAccessException oae) {
|
||||
Log.warning("Exception getting field [name=" + attributeName +
|
||||
log.warning("Exception getting field [name=" + attributeName +
|
||||
", error=" + oae + "].");
|
||||
return;
|
||||
}
|
||||
@@ -348,7 +349,7 @@ public abstract class ConfigRegistry
|
||||
if (value instanceof Streamable) {
|
||||
serialize(attributeName, key, value);
|
||||
} else {
|
||||
Log.info("Unable to flush config obj change [cobj=" + object.getClass().getName() +
|
||||
log.info("Unable to flush config obj change [cobj=" + object.getClass().getName() +
|
||||
", key=" + key + ", type=" + value.getClass().getName() +
|
||||
", value=" + value + "].");
|
||||
}
|
||||
@@ -366,7 +367,7 @@ public abstract class ConfigRegistry
|
||||
oout.flush();
|
||||
setValue(key, StringUtil.hexlate(out.toByteArray()));
|
||||
} catch (IOException ioe) {
|
||||
Log.info("Error serializing value " + value);
|
||||
log.info("Error serializing value " + value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,9 +31,10 @@ import com.samskivert.util.StringUtil;
|
||||
|
||||
import com.threerings.presents.dobj.DObject;
|
||||
|
||||
import com.threerings.admin.Log;
|
||||
import com.threerings.admin.server.persist.ConfigRepository;
|
||||
|
||||
import static com.threerings.admin.Log.log;
|
||||
|
||||
/**
|
||||
* Implements the {@link ConfigRegistry} using a JDBC database as a persistent store for the
|
||||
* configuration information. <em>Note:</em> config objects should only be created during server
|
||||
@@ -130,8 +131,7 @@ public class DatabaseConfigRegistry extends ConfigRegistry
|
||||
try {
|
||||
_data = _repo.loadConfig(_node, _path);
|
||||
} catch (PersistenceException pe) {
|
||||
Log.warning("Failed to load object configuration [path=" + _path + "].");
|
||||
Log.logStackTrace(pe);
|
||||
log.warning("Failed to load object configuration [path=" + _path + "].", pe);
|
||||
_data = new HashMap<String,String>();
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
package com.threerings.admin.server;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import com.samskivert.io.PersistenceException;
|
||||
import com.samskivert.jdbc.depot.PersistenceContext;
|
||||
@@ -79,7 +78,7 @@ public class PeeredDatabaseConfigRegistry extends DatabaseConfigRegistry
|
||||
object.changeAttribute(change.left, change.right);
|
||||
_pendingSyncs.add(change.left);
|
||||
} catch (Exception e) {
|
||||
log.log(Level.WARNING, "Config attribute sync failed " + change + ".", e);
|
||||
log.warning("Config attribute sync failed " + change + ".", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,8 +21,7 @@
|
||||
|
||||
package com.threerings.bureau;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import com.samskivert.util.Logger;
|
||||
|
||||
/**
|
||||
* Contains a reference to the log object used by the Bureau services.
|
||||
@@ -30,29 +29,5 @@ import java.util.logging.Logger;
|
||||
public class Log
|
||||
{
|
||||
/** We dispatch our log messages through this logger. */
|
||||
public static Logger log = Logger.getLogger("com.threerings.narya.bureau");
|
||||
|
||||
/** Convenience function. */
|
||||
public static void debug (String message)
|
||||
{
|
||||
log.fine(message);
|
||||
}
|
||||
|
||||
/** Convenience function. */
|
||||
public static void info (String message)
|
||||
{
|
||||
log.info(message);
|
||||
}
|
||||
|
||||
/** Convenience function. */
|
||||
public static void warning (String message)
|
||||
{
|
||||
log.warning(message);
|
||||
}
|
||||
|
||||
/** Convenience function. */
|
||||
public static void logStackTrace (Throwable t)
|
||||
{
|
||||
log.log(Level.WARNING, t.getMessage(), t);
|
||||
}
|
||||
public static Logger log = Logger.getLogger("com.threerings.bureau");
|
||||
}
|
||||
|
||||
@@ -5,13 +5,14 @@ import com.threerings.bureau.data.BureauCodes;
|
||||
import com.samskivert.util.IntMap;
|
||||
import com.samskivert.util.IntMaps;
|
||||
import com.threerings.bureau.data.AgentObject;
|
||||
import com.threerings.bureau.Log;
|
||||
import com.threerings.bureau.util.BureauContext;
|
||||
import com.threerings.presents.client.Client;
|
||||
import com.threerings.presents.dobj.Subscriber;
|
||||
import com.threerings.presents.util.SafeSubscriber;
|
||||
import com.threerings.presents.dobj.ObjectAccessException;
|
||||
|
||||
import static com.threerings.bureau.Log.log;
|
||||
|
||||
/**
|
||||
* Allows the server to create and destroy agents on a client.
|
||||
* @see BureauRegistry
|
||||
@@ -48,7 +49,7 @@ public abstract class BureauDirector extends BasicDirector
|
||||
}
|
||||
};
|
||||
|
||||
Log.info("Subscribing to object " + agentId);
|
||||
log.info("Subscribing to object " + agentId);
|
||||
|
||||
SafeSubscriber<AgentObject> subscriber =
|
||||
new SafeSubscriber<AgentObject>(agentId, delegator);
|
||||
@@ -65,19 +66,18 @@ public abstract class BureauDirector extends BasicDirector
|
||||
agent = _agents.remove(agentId);
|
||||
|
||||
if (agent == null) {
|
||||
Log.warning("Lost an agent, id " + agentId);
|
||||
log.warning("Lost an agent, id " + agentId);
|
||||
}
|
||||
else {
|
||||
try {
|
||||
agent.stop();
|
||||
}
|
||||
catch (Throwable t) {
|
||||
Log.warning("Stopping an agent caused an exception");
|
||||
Log.logStackTrace(t);
|
||||
log.warning("Stopping an agent caused an exception", t);
|
||||
}
|
||||
SafeSubscriber<AgentObject> subscriber = _subscribers.remove(agentId);
|
||||
if (subscriber == null) {
|
||||
Log.warning("Lost a subscriber for agent " + agent);
|
||||
log.warning("Lost a subscriber for agent " + agent);
|
||||
}
|
||||
else {
|
||||
subscriber.unsubscribe(_ctx.getDObjectManager());
|
||||
@@ -93,7 +93,7 @@ public abstract class BureauDirector extends BasicDirector
|
||||
{
|
||||
int oid = agentObject.getOid();
|
||||
|
||||
Log.info("Object " + oid + " now available");
|
||||
log.info("Object " + oid + " now available");
|
||||
|
||||
Agent agent;
|
||||
try {
|
||||
@@ -102,8 +102,7 @@ public abstract class BureauDirector extends BasicDirector
|
||||
agent.start();
|
||||
}
|
||||
catch (Throwable t) {
|
||||
Log.warning("Could not create agent [obj=" + agentObject + "]");
|
||||
Log.logStackTrace(t);
|
||||
log.warning("Could not create agent [obj=" + agentObject + "]", t);
|
||||
_bureauService.agentCreationFailed(_ctx.getClient(), oid);
|
||||
return;
|
||||
}
|
||||
@@ -117,8 +116,7 @@ public abstract class BureauDirector extends BasicDirector
|
||||
*/
|
||||
protected synchronized void requestFailed (int oid, ObjectAccessException cause)
|
||||
{
|
||||
Log.warning("Could not subscribe to agent [oid=" + oid + "]");
|
||||
Log.logStackTrace(cause);
|
||||
log.warning("Could not subscribe to agent [oid=" + oid + "]", cause);
|
||||
}
|
||||
|
||||
@Override // from BasicDirector
|
||||
|
||||
@@ -35,34 +35,35 @@ import com.samskivert.util.Invoker;
|
||||
import com.samskivert.util.ProcessLogger;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.threerings.bureau.Log;
|
||||
|
||||
/**
|
||||
* Abstracts the launching and termination of external processes (bureaus) that host instances of
|
||||
import static com.threerings.bureau.Log.log;
|
||||
|
||||
/**
|
||||
* Abstracts the launching and termination of external processes (bureaus) that host instances of
|
||||
* server-side code (agents).
|
||||
*/
|
||||
public class BureauRegistry
|
||||
public class BureauRegistry
|
||||
{
|
||||
/**
|
||||
* Defines the commands that are responsible for invoking a bureau. Instances are associated to
|
||||
* bureau types by the server on startup. The instances are used whenever the registry needs to
|
||||
* bureau types by the server on startup. The instances are used whenever the registry needs to
|
||||
* launch a bureau for an agent with the assocated bureau type.
|
||||
* @see setCommandGenerator
|
||||
*/
|
||||
public static interface CommandGenerator
|
||||
{
|
||||
/**
|
||||
* Launches a new bureau using the given server connect-back url and other information.
|
||||
/**
|
||||
* Launches a new bureau using the given server connect-back url and other information.
|
||||
* Called by the registry when it decides a new bureau is needed.
|
||||
* @param serverNameAndPort the name and port the bureau should use to connect back to the
|
||||
* @param serverNameAndPort the name and port the bureau should use to connect back to the
|
||||
* server, e.g. server.com:47624
|
||||
* @param bureauId the id of the bureau being launched
|
||||
* @param token the token string to use for the credentials when logging in
|
||||
* @return the builder, ready to launch
|
||||
*/
|
||||
String[] createCommand (
|
||||
String serverNameAndPort,
|
||||
String bureauId,
|
||||
String serverNameAndPort,
|
||||
String bureauId,
|
||||
String token);
|
||||
}
|
||||
|
||||
@@ -70,8 +71,8 @@ public class BureauRegistry
|
||||
* Creates a new registry, prepared to provide bureau services.
|
||||
*/
|
||||
public BureauRegistry (
|
||||
String serverNameAndPort,
|
||||
InvocationManager invmgr,
|
||||
String serverNameAndPort,
|
||||
InvocationManager invmgr,
|
||||
RootDObjectManager omgr,
|
||||
Invoker invoker)
|
||||
{
|
||||
@@ -96,13 +97,13 @@ public class BureauRegistry
|
||||
};
|
||||
|
||||
_invmgr.registerDispatcher(
|
||||
new BureauDispatcher(provider),
|
||||
new BureauDispatcher(provider),
|
||||
BureauCodes.BUREAU_GROUP);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a command generator for a given type. When an agent is started and no bureaus are
|
||||
* running, the <code>bureauType</code> is used to determine the <code>CommandGenerator</code>
|
||||
* Registers a command generator for a given type. When an agent is started and no bureaus are
|
||||
* running, the <code>bureauType</code> is used to determine the <code>CommandGenerator</code>
|
||||
* instance to call.
|
||||
* @param bureauType the type of bureau that will be launched
|
||||
* @param cmdGenerator the generator to be used for bureaus of <code>bureauType</code>
|
||||
@@ -110,7 +111,7 @@ public class BureauRegistry
|
||||
public void setCommandGenerator (String bureauType, CommandGenerator cmdGenerator)
|
||||
{
|
||||
if (_generators.get(bureauType) != null) {
|
||||
Log.warning("Generator for type already exists [type=" +
|
||||
log.warning("Generator for type already exists [type=" +
|
||||
bureauType + "]");
|
||||
return;
|
||||
}
|
||||
@@ -118,7 +119,7 @@ public class BureauRegistry
|
||||
_generators.put(bureauType, cmdGenerator);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Starts a new agent using the data in the given object, creating a new bureau if necessary.
|
||||
*/
|
||||
public void startAgent (AgentObject agent)
|
||||
@@ -128,7 +129,7 @@ public class BureauRegistry
|
||||
|
||||
_omgr.registerObject(agent);
|
||||
|
||||
Log.info("Bureau ready, sending createAgent " +
|
||||
log.info("Bureau ready, sending createAgent " +
|
||||
StringUtil.toString(agent));
|
||||
|
||||
BureauSender.createAgent(bureau.clientObj, agent.getOid());
|
||||
@@ -143,12 +144,12 @@ public class BureauRegistry
|
||||
|
||||
CommandGenerator generator = _generators.get(agent.bureauType);
|
||||
if (generator == null) {
|
||||
Log.warning("CommandGenerator not found for agent's " +
|
||||
log.warning("CommandGenerator not found for agent's " +
|
||||
"bureau type " + StringUtil.toString(agent));
|
||||
return;
|
||||
}
|
||||
|
||||
Log.info("Creating new bureau " +
|
||||
log.info("Creating new bureau " +
|
||||
StringUtil.toString(agent.bureauId) + " " +
|
||||
StringUtil.toString(generator));
|
||||
|
||||
@@ -161,7 +162,7 @@ public class BureauRegistry
|
||||
_serverNameAndPort, agent.bureauId, ""));
|
||||
|
||||
bureau.builder.redirectErrorStream(true);
|
||||
|
||||
|
||||
_invoker.postUnit(new Launcher(bureau));
|
||||
|
||||
_bureaus.put(agent.bureauId, bureau);
|
||||
@@ -170,13 +171,13 @@ public class BureauRegistry
|
||||
_omgr.registerObject(agent);
|
||||
bureau.agentStates.put(agent, Bureau.PENDING);
|
||||
|
||||
Log.info("Bureau not ready, pending agent " +
|
||||
log.info("Bureau not ready, pending agent " +
|
||||
StringUtil.toString(agent));
|
||||
|
||||
|
||||
bureau.summarize();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Destroys a previously started agent using the data in the given object.
|
||||
*/
|
||||
public void destroyAgent (AgentObject agent)
|
||||
@@ -187,7 +188,7 @@ public class BureauRegistry
|
||||
return;
|
||||
}
|
||||
|
||||
Log.info("Destroying agent " + StringUtil.toString(agent));
|
||||
log.info("Destroying agent " + StringUtil.toString(agent));
|
||||
|
||||
// transition the agent to a new state and perform the effect of the transition
|
||||
switch (found.state) {
|
||||
@@ -209,8 +210,8 @@ public class BureauRegistry
|
||||
|
||||
case Bureau.DESTROYED:
|
||||
case Bureau.STILL_BORN:
|
||||
Log.warning("Acknowledging a request to destory an agent, but agent " +
|
||||
"is in state " + found.state + ", ignoring request " +
|
||||
log.warning("Acknowledging a request to destory an agent, but agent " +
|
||||
"is in state " + found.state + ", ignoring request " +
|
||||
StringUtil.toString(found.agent));
|
||||
break;
|
||||
}
|
||||
@@ -219,14 +220,14 @@ public class BureauRegistry
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for when the bureau client acknowledges starting up. Starts all pending agents and
|
||||
* Callback for when the bureau client acknowledges starting up. Starts all pending agents and
|
||||
* causes subsequent agent start requests to be sent directly to the bureau.
|
||||
*/
|
||||
protected void bureauInitialized (ClientObject client, String bureauId)
|
||||
{
|
||||
final Bureau bureau = _bureaus.get(bureauId);
|
||||
if (bureau == null) {
|
||||
Log.warning("Acknowledging initialization of non-existent bureau " +
|
||||
log.warning("Acknowledging initialization of non-existent bureau " +
|
||||
StringUtil.toString(bureauId));
|
||||
return;
|
||||
}
|
||||
@@ -239,13 +240,13 @@ public class BureauRegistry
|
||||
}
|
||||
});
|
||||
|
||||
Log.info("Bureau created " + StringUtil.toString(bureau) +
|
||||
log.info("Bureau created " + StringUtil.toString(bureau) +
|
||||
", launching pending agents");
|
||||
|
||||
// find all pending agents
|
||||
Set<AgentObject> pending = Sets.newHashSet();
|
||||
|
||||
for (Map.Entry<AgentObject, Integer> entry :
|
||||
for (Map.Entry<AgentObject, Integer> entry :
|
||||
bureau.agentStates.entrySet()) {
|
||||
|
||||
if (entry.getValue() == Bureau.PENDING) {
|
||||
@@ -255,7 +256,7 @@ public class BureauRegistry
|
||||
|
||||
// create them
|
||||
for (AgentObject agent : pending) {
|
||||
Log.info("Creating agent " + StringUtil.toString(agent));
|
||||
log.info("Creating agent " + StringUtil.toString(agent));
|
||||
BureauSender.createAgent(bureau.clientObj, agent.getOid());
|
||||
bureau.agentStates.put(agent, Bureau.STARTED);
|
||||
}
|
||||
@@ -273,7 +274,7 @@ public class BureauRegistry
|
||||
return;
|
||||
}
|
||||
|
||||
Log.info("Agent creation confirmed " + StringUtil.toString(found.agent));
|
||||
log.info("Agent creation confirmed " + StringUtil.toString(found.agent));
|
||||
|
||||
switch (found.state) {
|
||||
case Bureau.STARTED:
|
||||
@@ -288,7 +289,7 @@ public class BureauRegistry
|
||||
case Bureau.PENDING:
|
||||
case Bureau.RUNNING:
|
||||
case Bureau.DESTROYED:
|
||||
Log.warning("Received acknowledgement of the creation of an " +
|
||||
log.warning("Received acknowledgement of the creation of an " +
|
||||
"agent in state " + found.state + ", ignoring request " +
|
||||
StringUtil.toString(found.agent));
|
||||
break;
|
||||
@@ -307,7 +308,7 @@ public class BureauRegistry
|
||||
return;
|
||||
}
|
||||
|
||||
Log.info("Agent creation failed " + StringUtil.toString(found.agent));
|
||||
log.info("Agent creation failed " + StringUtil.toString(found.agent));
|
||||
|
||||
switch (found.state) {
|
||||
case Bureau.STARTED:
|
||||
@@ -318,7 +319,7 @@ public class BureauRegistry
|
||||
case Bureau.PENDING:
|
||||
case Bureau.RUNNING:
|
||||
case Bureau.DESTROYED:
|
||||
Log.warning("Received acknowledgement of creation failure for " +
|
||||
log.warning("Received acknowledgement of creation failure for " +
|
||||
"agent in state " + found.state + ", ignoring request " +
|
||||
StringUtil.toString(found.agent));
|
||||
break;
|
||||
@@ -336,8 +337,8 @@ public class BureauRegistry
|
||||
if (found == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Log.info("Agent destruction confirmed " + StringUtil.toString(found.agent));
|
||||
|
||||
log.info("Agent destruction confirmed " + StringUtil.toString(found.agent));
|
||||
|
||||
switch (found.state) {
|
||||
case Bureau.DESTROYED:
|
||||
@@ -348,8 +349,8 @@ public class BureauRegistry
|
||||
case Bureau.STARTED:
|
||||
case Bureau.RUNNING:
|
||||
case Bureau.STILL_BORN:
|
||||
Log.warning("Acknowledging agent destruction, but state is " +
|
||||
found.state + ", ignoring request " +
|
||||
log.warning("Acknowledging agent destruction, but state is " +
|
||||
found.state + ", ignoring request " +
|
||||
StringUtil.toString(found.agent));
|
||||
break;
|
||||
}
|
||||
@@ -357,12 +358,12 @@ public class BureauRegistry
|
||||
found.bureau.summarize();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Callback for when a client is destroyed.
|
||||
*/
|
||||
protected void clientDestroyed (Bureau bureau)
|
||||
{
|
||||
Log.info("Client destroyed, destroying all agents " +
|
||||
log.info("Client destroyed, destroying all agents " +
|
||||
StringUtil.toString(bureau));
|
||||
|
||||
// clean up any agents attached to this bureau
|
||||
@@ -378,13 +379,13 @@ public class BureauRegistry
|
||||
{
|
||||
com.threerings.presents.dobj.DObject dobj = _omgr.getObject(agentId);
|
||||
if (dobj == null) {
|
||||
Log.warning("Non-existent agent in " + resolver +
|
||||
log.warning("Non-existent agent in " + resolver +
|
||||
" [agentId=" + agentId + "]");
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!(dobj instanceof AgentObject)) {
|
||||
Log.warning("Object not an agent in " + resolver +
|
||||
log.warning("Object not an agent in " + resolver +
|
||||
" " + StringUtil.toString(dobj));
|
||||
return null;
|
||||
}
|
||||
@@ -392,20 +393,20 @@ public class BureauRegistry
|
||||
AgentObject agent = (AgentObject)dobj;
|
||||
Bureau bureau = _bureaus.get(agent.bureauId);
|
||||
if (bureau == null) {
|
||||
Log.warning("Bureau not found for agent in " + resolver +
|
||||
log.warning("Bureau not found for agent in " + resolver +
|
||||
" " + StringUtil.toString(agent));
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!bureau.agentStates.containsKey(agent)) {
|
||||
Log.warning("Bureau does not have agent in " + resolver +
|
||||
log.warning("Bureau does not have agent in " + resolver +
|
||||
" " + StringUtil.toString(agent));
|
||||
return null;
|
||||
}
|
||||
|
||||
if (client != null && bureau.clientObj != client) {
|
||||
Log.warning("Masquerading request in " + resolver +
|
||||
" " + StringUtil.toString(agent) +
|
||||
log.warning("Masquerading request in " + resolver +
|
||||
" " + StringUtil.toString(agent) +
|
||||
" " + StringUtil.toString(bureau.clientObj) +
|
||||
" " + StringUtil.toString(client));
|
||||
return null;
|
||||
@@ -421,7 +422,7 @@ public class BureauRegistry
|
||||
{
|
||||
Launcher (Bureau bureau)
|
||||
{
|
||||
super("Launcher for " + bureau +
|
||||
super("Launcher for " + bureau +
|
||||
StringUtil.toString(bureau.builder.command()));
|
||||
_bureau = bureau;
|
||||
}
|
||||
@@ -430,26 +431,20 @@ public class BureauRegistry
|
||||
{
|
||||
try {
|
||||
_result = _bureau.builder.start();
|
||||
|
||||
// log the output of the process and prefix with bureau id
|
||||
ProcessLogger.copyMergedOutput(
|
||||
Log.log, _bureau.bureauId, _result);
|
||||
}
|
||||
catch (Exception e) {
|
||||
Log.warning("Could not launch process for bureau " +
|
||||
StringUtil.toString(_bureau));
|
||||
Log.logStackTrace(e);
|
||||
}
|
||||
ProcessLogger.copyMergedOutput(log, _bureau.bureauId, _result);
|
||||
|
||||
} catch (Exception e) {
|
||||
log.warning("Could not launch process", "bureau", _bureau, e);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void handleResult ()
|
||||
{
|
||||
_bureau.process = _result;
|
||||
_bureau.builder = null;
|
||||
Log.info("Bureau launched " +
|
||||
StringUtil.toString(_bureau));
|
||||
log.info("Bureau launched", "bureau", _bureau);
|
||||
}
|
||||
|
||||
protected Bureau _bureau;
|
||||
@@ -460,8 +455,8 @@ public class BureauRegistry
|
||||
protected static class FoundAgent
|
||||
{
|
||||
FoundAgent (
|
||||
Bureau bureau,
|
||||
AgentObject agent,
|
||||
Bureau bureau,
|
||||
AgentObject agent,
|
||||
int state)
|
||||
{
|
||||
this.bureau = bureau;
|
||||
@@ -493,7 +488,7 @@ public class BureauRegistry
|
||||
// Agent ack'ed, now live and hosting, ready to tell other clients
|
||||
static final int RUNNING = 2;
|
||||
|
||||
// Agent destruction requested, waiting for acknowledge (after which the agent is removed
|
||||
// Agent destruction requested, waiting for acknowledge (after which the agent is removed
|
||||
// from the Bureau, so has no state)
|
||||
static final int DESTROYED = 3;
|
||||
|
||||
@@ -512,7 +507,7 @@ public class BureauRegistry
|
||||
// with this id should be associated with one instance
|
||||
String bureauId;
|
||||
|
||||
// The client object of the bureau that has opened a dobj connection to
|
||||
// The client object of the bureau that has opened a dobj connection to
|
||||
// the registry
|
||||
ClientObject clientObj;
|
||||
|
||||
@@ -560,7 +555,7 @@ public class BureauRegistry
|
||||
StringBuilder str = new StringBuilder();
|
||||
str.append("Bureau ").append(bureauId).append(" [");
|
||||
agentSummary(str).append("]");
|
||||
Log.info(str.toString());
|
||||
log.info(str.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,8 +21,7 @@
|
||||
|
||||
package com.threerings.crowd;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import com.samskivert.util.Logger;
|
||||
|
||||
/**
|
||||
* Contains a reference to the log object used by the Crowd services.
|
||||
@@ -30,30 +29,5 @@ import java.util.logging.Logger;
|
||||
public class Log
|
||||
{
|
||||
/** We dispatch our log messages through this logger. */
|
||||
public static Logger log =
|
||||
Logger.getLogger("com.threerings.narya.crowd");
|
||||
|
||||
/** Convenience function. */
|
||||
public static void debug (String message)
|
||||
{
|
||||
log.fine(message);
|
||||
}
|
||||
|
||||
/** Convenience function. */
|
||||
public static void info (String message)
|
||||
{
|
||||
log.info(message);
|
||||
}
|
||||
|
||||
/** Convenience function. */
|
||||
public static void warning (String message)
|
||||
{
|
||||
log.warning(message);
|
||||
}
|
||||
|
||||
/** Convenience function. */
|
||||
public static void logStackTrace (Throwable t)
|
||||
{
|
||||
log.log(Level.WARNING, t.getMessage(), t);
|
||||
}
|
||||
public static Logger log = Logger.getLogger("com.threerings.crowd");
|
||||
}
|
||||
|
||||
@@ -49,7 +49,6 @@ import com.threerings.util.MessageManager;
|
||||
import com.threerings.util.Name;
|
||||
import com.threerings.util.TimeUtil;
|
||||
|
||||
import com.threerings.crowd.Log;
|
||||
import com.threerings.crowd.client.LocationObserver;
|
||||
import com.threerings.crowd.data.BodyObject;
|
||||
import com.threerings.crowd.data.CrowdCodes;
|
||||
@@ -63,6 +62,8 @@ import com.threerings.crowd.chat.data.TellFeedbackMessage;
|
||||
import com.threerings.crowd.chat.data.UserMessage;
|
||||
import com.threerings.crowd.chat.data.UserSystemMessage;
|
||||
|
||||
import static com.threerings.crowd.Log.log;
|
||||
|
||||
/**
|
||||
* The chat director is the client side coordinator of all chat related services. It handles both
|
||||
* place constrained chat as well as direct messaging.
|
||||
@@ -148,7 +149,7 @@ public class ChatDirector extends BasicDirector
|
||||
|
||||
// register our default chat handlers
|
||||
if (_bundle == null || _msgmgr == null) {
|
||||
Log.warning("Null bundle or message manager given to ChatDirector");
|
||||
log.warning("Null bundle or message manager given to ChatDirector");
|
||||
return;
|
||||
}
|
||||
registerCommandHandlers();
|
||||
@@ -1001,7 +1002,7 @@ public class ChatDirector extends BasicDirector
|
||||
if (bundle != null && _msgmgr != null) {
|
||||
MessageBundle msgb = _msgmgr.getBundle(bundle);
|
||||
if (msgb == null) {
|
||||
Log.warning("No message bundle available to translate message " +
|
||||
log.warning("No message bundle available to translate message " +
|
||||
"[bundle=" + bundle + ", message=" + message + "].");
|
||||
} else {
|
||||
message = msgb.xlate(message);
|
||||
|
||||
@@ -30,7 +30,7 @@ import com.samskivert.util.StringUtil;
|
||||
|
||||
import com.threerings.util.Name;
|
||||
|
||||
import com.threerings.crowd.Log;
|
||||
import static com.threerings.crowd.Log.log;
|
||||
|
||||
/**
|
||||
* A chat filter that can filter out curse words from user chat.
|
||||
@@ -150,7 +150,7 @@ public abstract class CurseFilter implements ChatFilter
|
||||
String mapping = st.nextToken();
|
||||
StringTokenizer st2 = new StringTokenizer(mapping, "=");
|
||||
if (st2.countTokens() != 2) {
|
||||
Log.warning("Something looks wrong in the x.cursewords " +
|
||||
log.warning("Something looks wrong in the x.cursewords " +
|
||||
"properties (" + mapping + "), skipping.");
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -27,10 +27,11 @@ import com.threerings.presents.data.ClientObject;
|
||||
import com.threerings.presents.dobj.DObject;
|
||||
import com.threerings.presents.server.InvocationManager;
|
||||
|
||||
import com.threerings.crowd.Log;
|
||||
import com.threerings.crowd.chat.data.ChatCodes;
|
||||
import com.threerings.crowd.data.BodyObject;
|
||||
|
||||
import static com.threerings.crowd.Log.log;
|
||||
|
||||
/**
|
||||
* Wires up the {@link SpeakService} to a particular distributed object. A server entity can make
|
||||
* "speech" available among the subscribers of a particular distributed object by constructing a
|
||||
@@ -86,7 +87,7 @@ public class SpeakHandler
|
||||
// ensure that the speaker is valid
|
||||
if ((mode == ChatCodes.BROADCAST_MODE) ||
|
||||
(_validator != null && !_validator.isValidSpeaker(_speakObj, caller, mode))) {
|
||||
Log.warning("Refusing invalid speak request [caller=" + caller.who() +
|
||||
log.warning("Refusing invalid speak request [caller=" + caller.who() +
|
||||
", speakObj=" + _speakObj.which() +
|
||||
", message=" + message + ", mode=" + mode + "].");
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ import com.threerings.presents.data.ClientObject;
|
||||
import com.threerings.presents.dobj.DObject;
|
||||
import com.threerings.presents.server.InvocationProvider;
|
||||
|
||||
import com.threerings.crowd.Log;
|
||||
import com.threerings.crowd.data.BodyObject;
|
||||
import com.threerings.crowd.server.CrowdServer;
|
||||
|
||||
@@ -42,6 +41,8 @@ import com.threerings.crowd.chat.data.SpeakObject;
|
||||
import com.threerings.crowd.chat.data.SystemMessage;
|
||||
import com.threerings.crowd.chat.data.UserMessage;
|
||||
|
||||
import static com.threerings.crowd.Log.log;
|
||||
|
||||
/**
|
||||
* Provides the back-end of the chat speaking facilities.
|
||||
*/
|
||||
@@ -174,7 +175,7 @@ public class SpeakUtil
|
||||
public static void sendMessage (DObject speakObj, ChatMessage msg)
|
||||
{
|
||||
if (speakObj == null) {
|
||||
Log.warning("Dropping speak message, no speak obj '" + msg + "'.");
|
||||
log.warning("Dropping speak message, no speak obj '" + msg + "'.");
|
||||
Thread.dumpStack();
|
||||
return;
|
||||
}
|
||||
@@ -192,7 +193,7 @@ public class SpeakUtil
|
||||
_messageMapper.message = null;
|
||||
|
||||
} else {
|
||||
Log.info("Unable to note listeners [dclass=" + speakObj.getClass() +
|
||||
log.info("Unable to note listeners [dclass=" + speakObj.getClass() +
|
||||
", msg=" + msg + "].");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
|
||||
package com.threerings.crowd.client;
|
||||
|
||||
import java.util.logging.Level;
|
||||
|
||||
import com.samskivert.util.ObserverList;
|
||||
import com.samskivert.util.ObserverList.ObserverOp;
|
||||
import com.samskivert.util.ResultListener;
|
||||
@@ -262,7 +260,7 @@ public class LocationDirector extends BasicDirector
|
||||
try {
|
||||
_controller.mayLeavePlace(_plobj);
|
||||
} catch (Exception e) {
|
||||
log.log(Level.WARNING, "Place controller choked in mayLeavePlace " +
|
||||
log.warning("Place controller choked in mayLeavePlace " +
|
||||
"[plobj=" + _plobj + "].", e);
|
||||
}
|
||||
}
|
||||
@@ -324,7 +322,7 @@ public class LocationDirector extends BasicDirector
|
||||
_subber.subscribe(_ctx.getDObjectManager());
|
||||
|
||||
} catch (Exception e) {
|
||||
log.log(Level.WARNING, "Failed to create place controller [config=" + config + "].", e);
|
||||
log.warning("Failed to create place controller [config=" + config + "].", e);
|
||||
handleFailure(_placeId, LocationCodes.E_INTERNAL_ERROR);
|
||||
}
|
||||
}
|
||||
@@ -347,7 +345,7 @@ public class LocationDirector extends BasicDirector
|
||||
try {
|
||||
_controller.didLeavePlace(_plobj);
|
||||
} catch (Exception e) {
|
||||
log.log(Level.WARNING, "Place controller choked in didLeavePlace " +
|
||||
log.warning("Place controller choked in didLeavePlace " +
|
||||
"[plobj=" + _plobj + "].", e);
|
||||
}
|
||||
}
|
||||
@@ -461,7 +459,7 @@ public class LocationDirector extends BasicDirector
|
||||
try {
|
||||
_controller.willEnterPlace(_plobj);
|
||||
} catch (Exception e) {
|
||||
log.log(Level.WARNING, "Controller choked in willEnterPlace " +
|
||||
log.warning("Controller choked in willEnterPlace " +
|
||||
"[place=" + _plobj + "].", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,11 +33,12 @@ import com.threerings.presents.dobj.EntryRemovedEvent;
|
||||
import com.threerings.presents.dobj.EntryUpdatedEvent;
|
||||
import com.threerings.presents.dobj.SetListener;
|
||||
|
||||
import com.threerings.crowd.Log;
|
||||
import com.threerings.crowd.data.OccupantInfo;
|
||||
import com.threerings.crowd.data.PlaceObject;
|
||||
import com.threerings.crowd.util.CrowdContext;
|
||||
|
||||
import static com.threerings.crowd.Log.log;
|
||||
|
||||
/**
|
||||
* The occupant director listens for occupants of places to enter and
|
||||
* exit, and dispatches notices to interested parties about these events.
|
||||
|
||||
@@ -23,9 +23,10 @@ package com.threerings.crowd.client;
|
||||
|
||||
import java.awt.Container;
|
||||
|
||||
import com.threerings.crowd.Log;
|
||||
import com.threerings.crowd.data.PlaceObject;
|
||||
|
||||
import static com.threerings.crowd.Log.log;
|
||||
|
||||
/**
|
||||
* Provides a mechanism for dispatching notifications to all user
|
||||
* interface elements in a hierarchy that implement the {@link PlaceView}
|
||||
@@ -51,9 +52,8 @@ public class PlaceViewUtil
|
||||
try {
|
||||
((PlaceView)root).willEnterPlace(plobj);
|
||||
} catch (Exception e) {
|
||||
Log.warning("Component choked on willEnterPlace() " +
|
||||
"[component=" + root + ", plobj=" + plobj + "].");
|
||||
Log.logStackTrace(e);
|
||||
log.warning("Component choked on willEnterPlace() " +
|
||||
"[component=" + root + ", plobj=" + plobj + "].", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,9 +84,8 @@ public class PlaceViewUtil
|
||||
try {
|
||||
((PlaceView)root).didLeavePlace(plobj);
|
||||
} catch (Exception e) {
|
||||
Log.warning("Component choked on didLeavePlace() " +
|
||||
"[component=" + root + ", plobj=" + plobj + "].");
|
||||
Log.logStackTrace(e);
|
||||
log.warning("Component choked on didLeavePlace() " +
|
||||
"[component=" + root + ", plobj=" + plobj + "].", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,9 +26,10 @@ import com.samskivert.util.StringUtil;
|
||||
import com.threerings.io.SimpleStreamableObject;
|
||||
import com.threerings.util.ActionScript;
|
||||
|
||||
import com.threerings.crowd.Log;
|
||||
import com.threerings.crowd.client.PlaceController;
|
||||
|
||||
import static com.threerings.crowd.Log.log;
|
||||
|
||||
/**
|
||||
* The place config class encapsulates the configuration information for a
|
||||
* particular type of place. The hierarchy of place config objects mimics
|
||||
@@ -67,14 +68,12 @@ public abstract class PlaceConfig extends SimpleStreamableObject
|
||||
"PlaceConfig.createController() must be overridden.");
|
||||
}
|
||||
|
||||
Log.warning("Providing backwards compatibility. PlaceConfig." +
|
||||
log.warning("Providing backwards compatibility. PlaceConfig." +
|
||||
"createController() should be overridden directly.");
|
||||
try {
|
||||
return (PlaceController)cclass.newInstance();
|
||||
} catch (Exception e) {
|
||||
Log.warning("Failed to instantiate controller class '" +
|
||||
cclass + "'.");
|
||||
Log.logStackTrace(e);
|
||||
log.warning("Failed to instantiate controller class '" + cclass + "'.", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,10 +31,11 @@ import com.threerings.presents.dobj.DSet;
|
||||
import com.threerings.presents.dobj.OidList;
|
||||
import com.threerings.presents.dobj.ServerMessageEvent;
|
||||
|
||||
import com.threerings.crowd.Log;
|
||||
import com.threerings.crowd.chat.data.SpeakMarshaller;
|
||||
import com.threerings.crowd.chat.data.SpeakObject;
|
||||
|
||||
import static com.threerings.crowd.Log.log;
|
||||
|
||||
/**
|
||||
* A distributed object that contains information on a place that is occupied by bodies. This place
|
||||
* might be a chat room, a game room, an island in a massively multiplayer piratical universe,
|
||||
@@ -131,8 +132,7 @@ public class PlaceObject extends DObject
|
||||
}
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
Log.warning("PlaceObject.getOccupantInfo choked.");
|
||||
Log.logStackTrace(t);
|
||||
log.warning("PlaceObject.getOccupantInfo choked.", t);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -26,12 +26,13 @@ import com.threerings.presents.server.InvocationException;
|
||||
import com.threerings.presents.server.InvocationManager;
|
||||
import com.threerings.presents.server.InvocationProvider;
|
||||
|
||||
import com.threerings.crowd.Log;
|
||||
import com.threerings.crowd.data.BodyObject;
|
||||
import com.threerings.crowd.data.CrowdCodes;
|
||||
import com.threerings.crowd.data.OccupantInfo;
|
||||
import com.threerings.crowd.data.Place;
|
||||
|
||||
import static com.threerings.crowd.Log.log;
|
||||
|
||||
/**
|
||||
* Provides the server-side side of the body-related invocation services.
|
||||
*/
|
||||
@@ -76,7 +77,7 @@ public class BodyProvider
|
||||
}
|
||||
|
||||
// update their status!
|
||||
Log.debug("Setting user idle state [user=" + bobj.username + ", status=" + nstatus + "].");
|
||||
log.debug("Setting user idle state [user=" + bobj.username + ", status=" + nstatus + "].");
|
||||
updateOccupantStatus(bobj, bobj.location, nstatus);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,10 +33,11 @@ import com.threerings.presents.server.InvocationManager;
|
||||
import com.threerings.presents.server.PresentsClient;
|
||||
import com.threerings.presents.server.PresentsServer;
|
||||
|
||||
import com.threerings.crowd.Log;
|
||||
import com.threerings.crowd.chat.server.ChatProvider;
|
||||
import com.threerings.crowd.data.BodyObject;
|
||||
|
||||
import static com.threerings.crowd.Log.log;
|
||||
|
||||
/**
|
||||
* The crowd server extends the presents server by configuring it to use the
|
||||
* extensions provided by the crowd layer to support crowd services.
|
||||
@@ -143,8 +144,7 @@ public class CrowdServer extends PresentsServer
|
||||
server.init();
|
||||
server.run();
|
||||
} catch (Exception e) {
|
||||
Log.warning("Unable to initialize server.");
|
||||
Log.logStackTrace(e);
|
||||
log.warning("Unable to initialize server.", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ import com.threerings.presents.server.InvocationManager;
|
||||
import com.threerings.presents.server.InvocationProvider;
|
||||
import com.threerings.presents.server.PresentsClient;
|
||||
|
||||
import com.threerings.crowd.Log;
|
||||
import com.threerings.crowd.client.LocationService;
|
||||
import com.threerings.crowd.data.BodyObject;
|
||||
import com.threerings.crowd.data.LocationCodes;
|
||||
@@ -39,6 +38,8 @@ import com.threerings.crowd.data.PlaceConfig;
|
||||
import com.threerings.crowd.data.PlaceObject;
|
||||
import com.threerings.crowd.server.CrowdServer;
|
||||
|
||||
import static com.threerings.crowd.Log.log;
|
||||
|
||||
/**
|
||||
* This class provides the server end of the location services.
|
||||
*/
|
||||
@@ -96,7 +97,7 @@ public class LocationProvider
|
||||
// make sure the place in question actually exists
|
||||
PlaceManager pmgr = _plreg.getPlaceManager(placeOid);
|
||||
if (pmgr == null) {
|
||||
Log.info("Requested to move to non-existent place [who=" + source.who() +
|
||||
log.info("Requested to move to non-existent place [who=" + source.who() +
|
||||
", placeOid=" + placeOid + "].");
|
||||
throw new InvocationException(NO_SUCH_PLACE);
|
||||
}
|
||||
@@ -105,7 +106,7 @@ public class LocationProvider
|
||||
// because we don't need to update anything in distributed object world
|
||||
Place place = pmgr.getLocation();
|
||||
if (place.equals(source.location)) {
|
||||
Log.debug("Going along with client request to move to where they already are " +
|
||||
log.debug("Going along with client request to move to where they already are " +
|
||||
"[source=" + source.who() + ", place=" + place + "].");
|
||||
return pmgr.getConfig();
|
||||
}
|
||||
@@ -196,12 +197,12 @@ public class LocationProvider
|
||||
}
|
||||
|
||||
} else {
|
||||
Log.info("Body's prior location no longer around? [boid=" + bodoid +
|
||||
log.info("Body's prior location no longer around? [boid=" + bodoid +
|
||||
", place=" + oldloc + "].");
|
||||
}
|
||||
|
||||
} catch (ClassCastException cce) {
|
||||
Log.warning("Body claims to occupy non-PlaceObject!? [boid=" + bodoid +
|
||||
log.warning("Body claims to occupy non-PlaceObject!? [boid=" + bodoid +
|
||||
", place=" + oldloc + ", error=" + cce + "].");
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ package com.threerings.crowd.server;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
@@ -51,7 +50,6 @@ import com.threerings.presents.dobj.SetAdapter;
|
||||
import com.threerings.presents.server.InvocationManager;
|
||||
import com.threerings.presents.server.PresentsDObjectMgr;
|
||||
|
||||
import com.threerings.crowd.Log;
|
||||
import com.threerings.crowd.data.BodyObject;
|
||||
import com.threerings.crowd.data.OccupantInfo;
|
||||
import com.threerings.crowd.data.Place;
|
||||
@@ -62,6 +60,8 @@ import com.threerings.crowd.chat.data.SpeakMarshaller;
|
||||
import com.threerings.crowd.chat.server.SpeakDispatcher;
|
||||
import com.threerings.crowd.chat.server.SpeakHandler;
|
||||
|
||||
import static com.threerings.crowd.Log.log;
|
||||
|
||||
/**
|
||||
* The place manager is the server-side entity that handles all place-related interaction. It
|
||||
* subscribes to the place object and reacts to message and other events. Behavior specific to a
|
||||
@@ -309,9 +309,8 @@ public class PlaceManager
|
||||
return info;
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.warning("Failure building occupant info [where=" + where() +
|
||||
", body=" + body + "].");
|
||||
Log.logStackTrace(e);
|
||||
log.warning("Failure building occupant info [where=" + where() +
|
||||
", body=" + body + "].", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -546,9 +545,7 @@ public class PlaceManager
|
||||
*/
|
||||
protected void bodyEntered (final int bodyOid)
|
||||
{
|
||||
if (Log.log.getLevel() == Level.FINE) {
|
||||
Log.debug("Body entered [where=" + where() + ", oid=" + bodyOid + "].");
|
||||
}
|
||||
log.debug("Body entered", "where", where(), "oid", bodyOid);
|
||||
|
||||
// let our delegates know what's up
|
||||
applyToDelegates(new DelegateOp() {
|
||||
@@ -566,9 +563,7 @@ public class PlaceManager
|
||||
*/
|
||||
protected void bodyLeft (final int bodyOid)
|
||||
{
|
||||
if (Log.log.getLevel() == Level.FINE) {
|
||||
Log.debug("Body left [where=" + where() + ", oid=" + bodyOid + "].");
|
||||
}
|
||||
log.debug("Body left", "where", where(), "oid", bodyOid);
|
||||
|
||||
// if their occupant info hasn't been removed (which may be the case if they logged off
|
||||
// rather than left via a MoveTo request), we need to get it on out of here
|
||||
@@ -643,7 +638,7 @@ public class PlaceManager
|
||||
if (idlePeriod > 0L && _shutdownInterval == null) {
|
||||
_shutdownInterval = new Interval((PresentsDObjectMgr)_omgr) {
|
||||
public void expired () {
|
||||
Log.debug("Unloading idle place '" + where () + "'.");
|
||||
log.debug("Unloading idle place '" + where () + "'.");
|
||||
shutdown();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -30,12 +30,13 @@ import com.threerings.presents.dobj.RootDObjectManager;
|
||||
import com.threerings.presents.server.InvocationException;
|
||||
import com.threerings.presents.server.InvocationManager;
|
||||
|
||||
import com.threerings.crowd.Log;
|
||||
import com.threerings.crowd.data.CrowdCodes;
|
||||
import com.threerings.crowd.data.Place;
|
||||
import com.threerings.crowd.data.PlaceConfig;
|
||||
import com.threerings.crowd.data.PlaceObject;
|
||||
|
||||
import static com.threerings.crowd.Log.log;
|
||||
|
||||
/**
|
||||
* The place registry keeps track of all of the active places in the server. It should be used to
|
||||
* create new places and it will take care of instantiating and initializing a place manager to
|
||||
@@ -197,9 +198,8 @@ public class PlaceRegistry
|
||||
pmgr.init(this, _invmgr, _omgr, config);
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.logStackTrace(e);
|
||||
throw new InstantiationException(
|
||||
"Error creating place manager [config=" + config + "].");
|
||||
log.warning(e);
|
||||
throw new InstantiationException("Error creating PlaceManager for " + config);
|
||||
}
|
||||
|
||||
// give the manager an opportunity to abort the whole process if it fails any permissions
|
||||
@@ -226,8 +226,7 @@ public class PlaceRegistry
|
||||
pmgr.startup(plobj);
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.warning("Error starting place manager [obj=" + plobj + ", pmgr=" + pmgr + "].");
|
||||
Log.logStackTrace(e);
|
||||
log.warning("Error starting place manager [obj=" + plobj + ", pmgr=" + pmgr + "].", e);
|
||||
}
|
||||
|
||||
return pmgr;
|
||||
@@ -241,7 +240,7 @@ public class PlaceRegistry
|
||||
int ploid = pmgr.getPlaceObject().getOid();
|
||||
// remove it from the table
|
||||
if (_pmgrs.remove(ploid) == null) {
|
||||
Log.warning("Requested to unmap unmapped place manager [pmgr=" + pmgr + "].");
|
||||
log.warning("Requested to unmap unmapped place manager [pmgr=" + pmgr + "].");
|
||||
|
||||
// } else {
|
||||
// Log.info("Unmapped place manager [class=" + pmgr.getClass().getName() +
|
||||
|
||||
@@ -35,7 +35,6 @@ import java.security.PrivilegedActionException;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import com.samskivert.util.ClassUtil;
|
||||
import com.samskivert.util.StringUtil;
|
||||
|
||||
@@ -21,8 +21,7 @@
|
||||
|
||||
package com.threerings.presents;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import com.samskivert.util.Logger;
|
||||
|
||||
/**
|
||||
* Contains a reference to the log object used by the Presents services.
|
||||
@@ -30,29 +29,5 @@ import java.util.logging.Logger;
|
||||
public class Log
|
||||
{
|
||||
/** We dispatch our log messages through this logger. */
|
||||
public static Logger log = Logger.getLogger("com.threerings.narya.presents");
|
||||
|
||||
/** Convenience function. */
|
||||
public static void debug (String message)
|
||||
{
|
||||
log.fine(message);
|
||||
}
|
||||
|
||||
/** Convenience function. */
|
||||
public static void info (String message)
|
||||
{
|
||||
log.info(message);
|
||||
}
|
||||
|
||||
/** Convenience function. */
|
||||
public static void warning (String message)
|
||||
{
|
||||
log.warning(message);
|
||||
}
|
||||
|
||||
/** Convenience function. */
|
||||
public static void logStackTrace (Throwable t)
|
||||
{
|
||||
log.log(Level.WARNING, t.getMessage(), t);
|
||||
}
|
||||
public static Logger log = Logger.getLogger("com.threerings.presents");
|
||||
}
|
||||
|
||||
@@ -51,7 +51,6 @@ import com.threerings.io.ObjectOutputStream;
|
||||
import com.threerings.io.UnreliableObjectInputStream;
|
||||
import com.threerings.io.UnreliableObjectOutputStream;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.data.AuthCodes;
|
||||
import com.threerings.presents.dobj.DObjectManager;
|
||||
import com.threerings.presents.net.AuthRequest;
|
||||
@@ -65,6 +64,8 @@ import com.threerings.presents.net.Transport;
|
||||
import com.threerings.presents.net.UpstreamMessage;
|
||||
import com.threerings.presents.util.DatagramSequencer;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* The client performs all network I/O on separate threads (one for reading and one for
|
||||
* writing). The communicator class encapsulates that functionality.
|
||||
@@ -193,7 +194,7 @@ public class BlockingCommunicator extends Communicator
|
||||
*/
|
||||
protected synchronized void logonSucceeded (AuthResponseData data)
|
||||
{
|
||||
Log.debug("Logon succeeded: " + data);
|
||||
log.debug("Logon succeeded: " + data);
|
||||
|
||||
// create our distributed object manager
|
||||
_omgr = new ClientDObjectMgr(this, _client);
|
||||
@@ -224,8 +225,7 @@ public class BlockingCommunicator extends Communicator
|
||||
return;
|
||||
}
|
||||
|
||||
Log.info("Connection failed: " + ioe);
|
||||
Log.logStackTrace(ioe);
|
||||
log.info("Connection failed", ioe);
|
||||
|
||||
// let the client know that things went south
|
||||
_client.notifyObservers(Client.CLIENT_CONNECTION_FAILED, ioe);
|
||||
@@ -245,7 +245,7 @@ public class BlockingCommunicator extends Communicator
|
||||
return;
|
||||
}
|
||||
|
||||
Log.debug("Connection closed.");
|
||||
log.debug("Connection closed.");
|
||||
// now do the whole logoff thing
|
||||
logoff();
|
||||
}
|
||||
@@ -267,7 +267,7 @@ public class BlockingCommunicator extends Communicator
|
||||
_client.cleanup(_logonError);
|
||||
}
|
||||
|
||||
Log.debug("Reader thread exited.");
|
||||
log.debug("Reader thread exited.");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -277,7 +277,7 @@ public class BlockingCommunicator extends Communicator
|
||||
{
|
||||
// clear out our writer reference
|
||||
_writer = null;
|
||||
Log.debug("Writer thread exited.");
|
||||
log.debug("Writer thread exited.");
|
||||
|
||||
// let the client observers know that we're logged off
|
||||
_client.notifyObservers(Client.CLIENT_DID_LOGOFF, null);
|
||||
@@ -299,12 +299,12 @@ public class BlockingCommunicator extends Communicator
|
||||
protected void closeChannel ()
|
||||
{
|
||||
if (_channel != null) {
|
||||
Log.debug("Closing socket channel.");
|
||||
log.debug("Closing socket channel.");
|
||||
|
||||
try {
|
||||
_channel.close();
|
||||
} catch (IOException ioe) {
|
||||
Log.warning("Error closing failed socket: " + ioe);
|
||||
log.warning("Error closing failed socket: " + ioe);
|
||||
}
|
||||
_channel = null;
|
||||
|
||||
@@ -326,7 +326,7 @@ public class BlockingCommunicator extends Communicator
|
||||
closeDatagramChannel();
|
||||
}
|
||||
|
||||
Log.debug("Datagram reader thread exited.");
|
||||
log.debug("Datagram reader thread exited.");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -336,7 +336,7 @@ public class BlockingCommunicator extends Communicator
|
||||
{
|
||||
// clear out our writer reference
|
||||
_datagramWriter = null;
|
||||
Log.debug("Datagram writer thread exited.");
|
||||
log.debug("Datagram writer thread exited.");
|
||||
|
||||
closeDatagramChannel();
|
||||
}
|
||||
@@ -350,17 +350,17 @@ public class BlockingCommunicator extends Communicator
|
||||
try {
|
||||
_selector.close();
|
||||
} catch (IOException ioe) {
|
||||
Log.warning("Error closing selector: " + ioe);
|
||||
log.warning("Error closing selector: " + ioe);
|
||||
}
|
||||
_selector = null;
|
||||
}
|
||||
if (_datagramChannel != null) {
|
||||
Log.debug("Closing datagram socket channel.");
|
||||
log.debug("Closing datagram socket channel.");
|
||||
|
||||
try {
|
||||
_datagramChannel.close();
|
||||
} catch (IOException ioe) {
|
||||
Log.warning("Error closing datagram socket: " + ioe);
|
||||
log.warning("Error closing datagram socket: " + ioe);
|
||||
}
|
||||
_datagramChannel = null;
|
||||
|
||||
@@ -377,7 +377,7 @@ public class BlockingCommunicator extends Communicator
|
||||
throws IOException
|
||||
{
|
||||
if (debugLogMessages()) {
|
||||
Log.info("SEND " + msg);
|
||||
log.info("SEND " + msg);
|
||||
}
|
||||
|
||||
// first we write the message so that we can measure it's length
|
||||
@@ -389,11 +389,11 @@ public class BlockingCommunicator extends Communicator
|
||||
ByteBuffer buffer = _fout.frameAndReturnBuffer();
|
||||
if (buffer.limit() > 4096) {
|
||||
String txt = StringUtil.truncate(String.valueOf(msg), 80, "...");
|
||||
Log.info("Whoa, writin' a big one [msg=" + txt + ", size=" + buffer.limit() + "].");
|
||||
log.info("Whoa, writin' a big one [msg=" + txt + ", size=" + buffer.limit() + "].");
|
||||
}
|
||||
int wrote = _channel.write(buffer);
|
||||
if (wrote != buffer.limit()) {
|
||||
Log.warning("Aiya! Couldn't write entire message [msg=" + msg +
|
||||
log.warning("Aiya! Couldn't write entire message [msg=" + msg +
|
||||
", size=" + buffer.limit() + ", wrote=" + wrote + "].");
|
||||
// } else {
|
||||
// Log.info("Wrote " + wrote + " bytes.");
|
||||
@@ -425,7 +425,7 @@ public class BlockingCommunicator extends Communicator
|
||||
ByteBuffer buf = _bout.flip();
|
||||
int size = buf.remaining();
|
||||
if (size > Client.MAX_DATAGRAM_SIZE) {
|
||||
Log.warning("Dropping oversized datagram [size=" + size +
|
||||
log.warning("Dropping oversized datagram [size=" + size +
|
||||
", msg=" + msg + "].");
|
||||
return;
|
||||
}
|
||||
@@ -466,7 +466,7 @@ public class BlockingCommunicator extends Communicator
|
||||
try {
|
||||
DownstreamMessage msg = (DownstreamMessage)_oin.readObject();
|
||||
if (debugLogMessages()) {
|
||||
Log.info("RECEIVE " + msg);
|
||||
log.info("RECEIVE " + msg);
|
||||
}
|
||||
return msg;
|
||||
|
||||
@@ -496,7 +496,7 @@ public class BlockingCommunicator extends Communicator
|
||||
return null; // received out of order
|
||||
}
|
||||
if (debugLogMessages()) {
|
||||
Log.info("DATAGRAM " + msg);
|
||||
log.info("DATAGRAM " + msg);
|
||||
}
|
||||
return msg;
|
||||
|
||||
@@ -521,7 +521,7 @@ public class BlockingCommunicator extends Communicator
|
||||
{
|
||||
// the default implementation just connects to the first port and does no cycling
|
||||
int port = _client.getPorts()[0];
|
||||
Log.info("Connecting [host=" + host + ", port=" + port + "].");
|
||||
log.info("Connecting [host=" + host + ", port=" + port + "].");
|
||||
synchronized (BlockingCommunicator.this) {
|
||||
_channel = SocketChannel.open(new InetSocketAddress(host, port));
|
||||
}
|
||||
@@ -554,8 +554,7 @@ public class BlockingCommunicator extends Communicator
|
||||
logon();
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.debug("Logon failed: " + e);
|
||||
// Log.logStackTrace(e);
|
||||
log.debug("Logon failed: " + e);
|
||||
// once we're shutdown we'll report this error
|
||||
_logonError = e;
|
||||
// terminate our communicator thread
|
||||
@@ -596,10 +595,10 @@ public class BlockingCommunicator extends Communicator
|
||||
sendMessage(req);
|
||||
|
||||
// now wait for the auth response
|
||||
Log.debug("Waiting for auth response.");
|
||||
log.debug("Waiting for auth response.");
|
||||
AuthResponse rsp = (AuthResponse)receiveMessage();
|
||||
AuthResponseData data = rsp.getData();
|
||||
Log.debug("Got auth response: " + data);
|
||||
log.debug("Got auth response: " + data);
|
||||
|
||||
// if the auth request failed, we want to let the communicator know by throwing a logon
|
||||
// exception
|
||||
@@ -627,7 +626,7 @@ public class BlockingCommunicator extends Communicator
|
||||
} catch (InterruptedIOException iioe) {
|
||||
// somebody set up us the bomb! we've been interrupted which means that we're being
|
||||
// shut down, so we just report it and return from iterate() like a good monkey
|
||||
Log.debug("Reader thread woken up in time to die.");
|
||||
log.debug("Reader thread woken up in time to die.");
|
||||
|
||||
} catch (EOFException eofe) {
|
||||
// let the communicator know that our connection was closed
|
||||
@@ -642,14 +641,13 @@ public class BlockingCommunicator extends Communicator
|
||||
shutdown();
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.warning("Error processing message [msg=" + msg + ", error=" + e + "].");
|
||||
log.warning("Error processing message [msg=" + msg + ", error=" + e + "].");
|
||||
}
|
||||
}
|
||||
|
||||
protected void handleIterateFailure (Exception e)
|
||||
{
|
||||
Log.warning("Uncaught exception it reader thread.");
|
||||
Log.logStackTrace(e);
|
||||
log.warning("Uncaught exception it reader thread.", e);
|
||||
}
|
||||
|
||||
protected void didShutdown ()
|
||||
@@ -702,8 +700,7 @@ public class BlockingCommunicator extends Communicator
|
||||
|
||||
protected void handleIterateFailure (Exception e)
|
||||
{
|
||||
Log.warning("Uncaught exception it writer thread.");
|
||||
Log.logStackTrace(e);
|
||||
log.warning("Uncaught exception it writer thread.", e);
|
||||
}
|
||||
|
||||
protected void didShutdown ()
|
||||
@@ -729,7 +726,7 @@ public class BlockingCommunicator extends Communicator
|
||||
try {
|
||||
connect();
|
||||
} catch (IOException ioe) {
|
||||
Log.warning("Failed to open datagram channel [error=" + ioe + "].");
|
||||
log.warning("Failed to open datagram channel [error=" + ioe + "].");
|
||||
shutdown();
|
||||
}
|
||||
}
|
||||
@@ -749,7 +746,7 @@ public class BlockingCommunicator extends Communicator
|
||||
try {
|
||||
_digest = MessageDigest.getInstance("MD5");
|
||||
} catch (NoSuchAlgorithmException nsae) {
|
||||
Log.warning("Missing MD5 algorithm.");
|
||||
log.warning("Missing MD5 algorithm.");
|
||||
shutdown();
|
||||
return;
|
||||
}
|
||||
@@ -785,14 +782,14 @@ public class BlockingCommunicator extends Communicator
|
||||
|
||||
// check if we managed to establish a connection
|
||||
if (cport > 0) {
|
||||
Log.info("Datagram connection established [port=" + cport + "].");
|
||||
log.info("Datagram connection established [port=" + cport + "].");
|
||||
|
||||
// start up the writer thread
|
||||
_datagramWriter = new DatagramWriter();
|
||||
_datagramWriter.start();
|
||||
|
||||
} else {
|
||||
Log.info("Failed to establish datagram connection.");
|
||||
log.info("Failed to establish datagram connection.");
|
||||
shutdown();
|
||||
}
|
||||
}
|
||||
@@ -835,20 +832,19 @@ public class BlockingCommunicator extends Communicator
|
||||
} catch (AsynchronousCloseException ace) {
|
||||
// somebody set up us the bomb! we've been interrupted which means that we're being
|
||||
// shut down, so we just report it and return from iterate() like a good monkey
|
||||
Log.debug("Datagram reader thread woken up in time to die.");
|
||||
log.debug("Datagram reader thread woken up in time to die.");
|
||||
|
||||
} catch (IOException ioe) {
|
||||
Log.warning("Error receiving datagram [error=" + ioe + "].");
|
||||
log.warning("Error receiving datagram [error=" + ioe + "].");
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.warning("Error processing message [msg=" + msg + ", error=" + e + "].");
|
||||
log.warning("Error processing message [msg=" + msg + ", error=" + e + "].");
|
||||
}
|
||||
}
|
||||
|
||||
protected void handleIterateFailure (Exception e)
|
||||
{
|
||||
Log.warning("Uncaught exception in datagram reader thread.");
|
||||
Log.logStackTrace(e);
|
||||
log.warning("Uncaught exception in datagram reader thread.", e);
|
||||
}
|
||||
|
||||
protected void didShutdown ()
|
||||
@@ -886,14 +882,13 @@ public class BlockingCommunicator extends Communicator
|
||||
sendDatagram(msg);
|
||||
|
||||
} catch (IOException ioe) {
|
||||
Log.warning("Error sending datagram [error=" + ioe + "].");
|
||||
log.warning("Error sending datagram [error=" + ioe + "].");
|
||||
}
|
||||
}
|
||||
|
||||
protected void handleIterateFailure (Exception e)
|
||||
{
|
||||
Log.warning("Uncaught exception in datagram writer thread.");
|
||||
Log.logStackTrace(e);
|
||||
log.warning("Uncaught exception in datagram writer thread.", e);
|
||||
}
|
||||
|
||||
protected void didShutdown ()
|
||||
|
||||
@@ -32,9 +32,10 @@ import com.samskivert.swing.RuntimeAdjust;
|
||||
import com.samskivert.util.IntListUtil;
|
||||
import com.samskivert.util.Interval;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.data.AuthCodes;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* Customizes the blocking communicator with some things that we only do on users' machines (where
|
||||
* there's only one client running, not potentially dozens, and where we're not sending high
|
||||
@@ -78,7 +79,7 @@ public class ClientCommunicator extends BlockingCommunicator
|
||||
for (int ii = 0; ii < ports.length; ii++) {
|
||||
int port = ports[(ii+ppidx)%ports.length];
|
||||
int nextPort = ports[(ii+ppidx+1)%ports.length];
|
||||
Log.info("Connecting [host=" + host + ", port=" + port + "].");
|
||||
log.info("Connecting [host=" + host + ", port=" + port + "].");
|
||||
InetSocketAddress addr = new InetSocketAddress(host, port);
|
||||
try {
|
||||
synchronized (this) {
|
||||
|
||||
@@ -35,10 +35,11 @@ import com.samskivert.util.StringUtil;
|
||||
import com.samskivert.util.IntMap;
|
||||
import com.samskivert.util.Interval;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.dobj.*;
|
||||
import com.threerings.presents.net.*;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* The client distributed object manager manages a set of proxy objects which mirror the
|
||||
* distributed objects maintained on the server. Requests for modifications, etc. are forwarded to
|
||||
@@ -165,7 +166,7 @@ public class ClientDObjectMgr
|
||||
} else if (obj instanceof UnsubscribeResponse) {
|
||||
int oid = ((UnsubscribeResponse)obj).getOid();
|
||||
if (_dead.remove(oid) == null) {
|
||||
Log.warning("Received unsub ACK from unknown object [oid=" + oid + "].");
|
||||
log.warning("Received unsub ACK from unknown object [oid=" + oid + "].");
|
||||
}
|
||||
|
||||
} else if (obj instanceof FailureResponse) {
|
||||
@@ -221,7 +222,7 @@ public class ClientDObjectMgr
|
||||
DObject target = _ocache.get(remoteOid);
|
||||
if (target == null) {
|
||||
if (!_dead.containsKey(remoteOid)) {
|
||||
Log.warning("Unable to dispatch event on non-proxied object " + event + ".");
|
||||
log.warning("Unable to dispatch event on non-proxied object " + event + ".");
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -277,8 +278,7 @@ public class ClientDObjectMgr
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.warning("Failure processing event [event=" + event + ", target=" + target + "].");
|
||||
Log.logStackTrace(e);
|
||||
log.warning("Failure processing event", "event", event, "target", target, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -298,7 +298,7 @@ public class ClientDObjectMgr
|
||||
// let the penders know that the object is available
|
||||
PendingRequest<?> req = _penders.remove(obj.getOid());
|
||||
if (req == null) {
|
||||
Log.warning("Got object, but no one cares?! [oid=" + obj.getOid() +
|
||||
log.warning("Got object, but no one cares?! [oid=" + obj.getOid() +
|
||||
", obj=" + obj + "].");
|
||||
return;
|
||||
}
|
||||
@@ -321,7 +321,7 @@ public class ClientDObjectMgr
|
||||
// let the penders know that the object is not available
|
||||
PendingRequest<?> req = _penders.remove(oid);
|
||||
if (req == null) {
|
||||
Log.warning("Failed to get object, but no one cares?! [oid=" + oid + "].");
|
||||
log.warning("Failed to get object, but no one cares?! [oid=" + oid + "].");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -383,7 +383,7 @@ public class ClientDObjectMgr
|
||||
dobj.removeSubscriber(target);
|
||||
|
||||
} else {
|
||||
Log.info("Requested to remove subscriber from non-proxied object [oid=" + oid +
|
||||
log.info("Requested to remove subscriber from non-proxied object [oid=" + oid +
|
||||
", sub=" + target + "].");
|
||||
}
|
||||
}
|
||||
@@ -505,9 +505,9 @@ public class ClientDObjectMgr
|
||||
/** A debug hook that allows the dumping of all objects in the object table out to the log. */
|
||||
protected DebugChords.Hook DUMP_OTABLE_HOOK = new DebugChords.Hook() {
|
||||
public void invoke () {
|
||||
Log.info("Dumping " + _ocache.size() + " objects:");
|
||||
log.info("Dumping " + _ocache.size() + " objects:");
|
||||
for (DObject obj : _ocache.values()) {
|
||||
Log.info(obj.getClass().getName() + " " + obj);
|
||||
log.info(obj.getClass().getName() + " " + obj);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -23,10 +23,11 @@ package com.threerings.presents.client;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.net.PingRequest;
|
||||
import com.threerings.presents.net.PongResponse;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* Used to compute the client/server time delta, attempting to account for
|
||||
* the network delay experienced when the server sends its current time to
|
||||
@@ -95,7 +96,7 @@ public class DeltaCalculator
|
||||
// minus the server's send time (plus network delay): dT = C - S
|
||||
_deltas[_iter] = recv - (server + nettime);
|
||||
|
||||
Log.debug("Calculated delta [delay=" + delay +
|
||||
log.debug("Calculated delta [delay=" + delay +
|
||||
", nettime=" + nettime + ", delta=" + _deltas[_iter] +
|
||||
", rtt=" + (recv-send) + "].");
|
||||
|
||||
|
||||
@@ -22,7 +22,8 @@
|
||||
package com.threerings.presents.client;
|
||||
|
||||
import com.samskivert.util.StringUtil;
|
||||
import com.threerings.presents.Log;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* Provides the basic functionality used to dispatch invocation
|
||||
@@ -45,7 +46,7 @@ public abstract class InvocationDecoder
|
||||
*/
|
||||
public void dispatchNotification (int methodId, Object[] args)
|
||||
{
|
||||
Log.warning("Requested to dispatch unknown method " +
|
||||
log.warning("Requested to dispatch unknown method " +
|
||||
"[receiver=" + receiver + ", methodId=" + methodId +
|
||||
", args=" + StringUtil.toString(args) + "].");
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ import java.util.Iterator;
|
||||
import com.samskivert.util.HashIntMap;
|
||||
import com.samskivert.util.StringUtil;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.client.InvocationReceiver.Registration;
|
||||
|
||||
import com.threerings.presents.data.ClientObject;
|
||||
@@ -47,6 +46,8 @@ import com.threerings.presents.dobj.Subscriber;
|
||||
|
||||
import com.threerings.presents.net.Transport;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* Handles the client side management of the invocation services.
|
||||
*/
|
||||
@@ -67,7 +68,7 @@ public class InvocationDirector
|
||||
{
|
||||
// sanity check
|
||||
if (_clobj != null) {
|
||||
Log.warning("Zoiks, client object around during invmgr init!");
|
||||
log.warning("Zoiks, client object around during invmgr init!");
|
||||
cleanup();
|
||||
}
|
||||
|
||||
@@ -97,7 +98,7 @@ public class InvocationDirector
|
||||
|
||||
public void requestFailed (int oid, ObjectAccessException cause) {
|
||||
// aiya! we were unable to subscribe to the client object. we're hosed!
|
||||
Log.warning("Invocation director unable to subscribe to client object " +
|
||||
log.warning("Invocation director unable to subscribe to client object " +
|
||||
"[cloid=" + cloid + ", cause=" + cause + "]!");
|
||||
_client.getClientObjectFailed(cause);
|
||||
}
|
||||
@@ -151,7 +152,7 @@ public class InvocationDirector
|
||||
if (_clobj != null) {
|
||||
Registration rreg = _clobj.receivers.get(receiverCode);
|
||||
if (rreg == null) {
|
||||
Log.warning("Receiver unregistered for which we have no id to code mapping " +
|
||||
log.warning("Receiver unregistered for which we have no id to code mapping " +
|
||||
"[code=" + receiverCode + "].");
|
||||
} else {
|
||||
Object decoder = _receivers.remove(rreg.receiverId);
|
||||
@@ -209,7 +210,7 @@ public class InvocationDirector
|
||||
int invOid, int invCode, int methodId, Object[] args, Transport transport)
|
||||
{
|
||||
if (_clobj == null) {
|
||||
Log.warning("Dropping invocation request on shutdown director [code=" + invCode +
|
||||
log.warning("Dropping invocation request on shutdown director [code=" + invCode +
|
||||
", methodId=" + methodId + "].");
|
||||
return;
|
||||
}
|
||||
@@ -273,7 +274,7 @@ public class InvocationDirector
|
||||
// look up the invocation marshaller registered for that response
|
||||
ListenerMarshaller listener = _listeners.remove(reqId);
|
||||
if (listener == null) {
|
||||
Log.warning("Received invocation response for which we have no registered listener " +
|
||||
log.warning("Received invocation response for which we have no registered listener " +
|
||||
"[reqId=" + reqId + ", methId=" + methodId + ", args=" +
|
||||
StringUtil.toString(args) + "]. It is possible that this listener was " +
|
||||
"flushed because the response did not arrive within " +
|
||||
@@ -288,9 +289,8 @@ public class InvocationDirector
|
||||
try {
|
||||
listener.dispatchResponse(methodId, args);
|
||||
} catch (Throwable t) {
|
||||
Log.warning("Invocation response listener choked [listener=" + listener +
|
||||
", methId=" + methodId + ", args=" + StringUtil.toString(args) + "].");
|
||||
Log.logStackTrace(t);
|
||||
log.warning("Invocation response listener choked [listener=" + listener +
|
||||
", methId=" + methodId + ", args=" + StringUtil.toString(args) + "].", t);
|
||||
}
|
||||
|
||||
// flush expired listeners periodically
|
||||
@@ -309,7 +309,7 @@ public class InvocationDirector
|
||||
// look up the decoder registered for this receiver
|
||||
InvocationDecoder decoder = _receivers.get(receiverId);
|
||||
if (decoder == null) {
|
||||
Log.warning("Received notification for which we have no registered receiver " +
|
||||
log.warning("Received notification for which we have no registered receiver " +
|
||||
"[recvId=" + receiverId + ", methodId=" + methodId +
|
||||
", args=" + StringUtil.toString(args) + "].");
|
||||
return;
|
||||
@@ -321,9 +321,8 @@ public class InvocationDirector
|
||||
try {
|
||||
decoder.dispatchNotification(methodId, args);
|
||||
} catch (Throwable t) {
|
||||
Log.warning("Invocation notification receiver choked [receiver=" + decoder.receiver +
|
||||
", methId=" + methodId + ", args=" + StringUtil.toString(args) + "].");
|
||||
Log.logStackTrace(t);
|
||||
log.warning("Invocation notification receiver choked [receiver=" + decoder.receiver +
|
||||
", methId=" + methodId + ", args=" + StringUtil.toString(args) + "].", t);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -362,7 +361,7 @@ public class InvocationDirector
|
||||
}
|
||||
|
||||
public void requestFailed (int oid, ObjectAccessException cause) {
|
||||
Log.warning("Aiya! Unable to subscribe to changed client object [cloid=" + oid +
|
||||
log.warning("Aiya! Unable to subscribe to changed client object [cloid=" + oid +
|
||||
", cause=" + cause + "].");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -25,8 +25,6 @@ import com.samskivert.util.StringUtil;
|
||||
|
||||
import com.threerings.io.Streamable;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
|
||||
import com.threerings.presents.client.Client;
|
||||
import com.threerings.presents.client.InvocationService.ConfirmListener;
|
||||
import com.threerings.presents.client.InvocationService.ResultListener;
|
||||
@@ -37,6 +35,8 @@ import com.threerings.presents.dobj.InvocationResponseEvent;
|
||||
|
||||
import com.threerings.presents.net.Transport;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* Provides a base from which all invocation service marshallers extend. Handles functionality
|
||||
* common to all marshallers.
|
||||
@@ -110,7 +110,7 @@ public class InvocationMarshaller
|
||||
listener.requestFailed((String)args[0]);
|
||||
|
||||
} else {
|
||||
Log.warning("Requested to dispatch unknown invocation response " +
|
||||
log.warning("Requested to dispatch unknown invocation response " +
|
||||
"[listener=" + listener + ", methodId=" + methodId +
|
||||
", args=" + StringUtil.toString(args) + "].");
|
||||
}
|
||||
@@ -130,7 +130,7 @@ public class InvocationMarshaller
|
||||
throws Throwable
|
||||
{
|
||||
if (_invId != null && getClass() != ListenerMarshaller.class) {
|
||||
Log.warning("Invocation listener never responded to: " + _invId);
|
||||
log.warning("Invocation listener never responded to: " + _invId);
|
||||
}
|
||||
super.finalize();
|
||||
}
|
||||
|
||||
@@ -36,9 +36,10 @@ import com.samskivert.util.StringUtil;
|
||||
import com.threerings.io.Streamable;
|
||||
import com.threerings.util.TrackedObject;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.net.Transport;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* The distributed object forms the foundation of the Presents system. All information shared among
|
||||
* users of the system is done via distributed objects. A distributed object has a set of
|
||||
@@ -164,8 +165,8 @@ public class DObject
|
||||
_scount++;
|
||||
|
||||
} else {
|
||||
Log.warning("Refusing subscriber that's already in the list [dobj=" + which() +
|
||||
", subscriber=" + sub + "]");
|
||||
log.warning("Refusing subscriber that's already in the list", "dobj", which(),
|
||||
"subscriber", sub);
|
||||
Thread.dumpStack();
|
||||
}
|
||||
}
|
||||
@@ -225,7 +226,7 @@ public class DObject
|
||||
if (els != null) {
|
||||
_listeners = els;
|
||||
} else {
|
||||
Log.warning("Refusing repeat listener registration [dobj=" + which() +
|
||||
log.warning("Refusing repeat listener registration [dobj=" + which() +
|
||||
", list=" + listener + "]");
|
||||
Thread.dumpStack();
|
||||
}
|
||||
@@ -357,7 +358,7 @@ public class DObject
|
||||
// clear the lock from the list
|
||||
if (ListUtil.clear(_locks, name) == null) {
|
||||
// complain if we didn't find the lock
|
||||
Log.info("Unable to clear non-existent lock [lock=" + name + ", dobj=" + this + "].");
|
||||
log.info("Unable to clear non-existent lock [lock=" + name + ", dobj=" + this + "].");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -438,9 +439,8 @@ public class DObject
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.warning("Listener choked during notification [list=" + listener +
|
||||
", event=" + event + "].");
|
||||
Log.logStackTrace(e);
|
||||
log.warning("Listener choked during notification [list=" + listener +
|
||||
", event=" + event + "].", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -464,9 +464,7 @@ public class DObject
|
||||
((ProxySubscriber)sub).eventReceived(event);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.warning("Proxy choked during notification [sub=" + sub +
|
||||
", event=" + event + "].");
|
||||
Log.logStackTrace(e);
|
||||
log.warning("Proxy choked during notification", "sub", sub, "event", event, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -555,7 +553,7 @@ public class DObject
|
||||
_omgr.postEvent(event);
|
||||
|
||||
} else {
|
||||
Log.info("Dropping event for non- or no longer managed object [oid=" + getOid() +
|
||||
log.info("Dropping event for non- or no longer managed object [oid=" + getOid() +
|
||||
", class=" + getClass().getName() + ", event=" + event + "].");
|
||||
}
|
||||
}
|
||||
@@ -734,7 +732,7 @@ public class DObject
|
||||
{
|
||||
// sanity check
|
||||
if (_tcount != 0) {
|
||||
Log.warning("Transaction cleared with non-zero nesting count [dobj=" + this + "].");
|
||||
log.warning("Transaction cleared with non-zero nesting count", "dobj", this);
|
||||
_tcount = 0;
|
||||
}
|
||||
|
||||
@@ -827,7 +825,7 @@ public class DObject
|
||||
if (_omgr != null && _omgr.isManager(this)) {
|
||||
oldEntry = set.removeKey(key);
|
||||
if (oldEntry == null) {
|
||||
Log.warning("Requested to remove non-element [set=" + name + ", key=" + key + "].");
|
||||
log.warning("Requested to remove non-element", "set", name, "key", key);
|
||||
Thread.dumpStack();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
import com.threerings.io.Streamable;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* The distributed set class provides a means by which an unordered set of objects can be
|
||||
@@ -199,7 +199,7 @@ public class DSet<E extends DSet.Entry>
|
||||
// the crazy sanity checks
|
||||
if (_size < 0 ||_size > _entries.length ||
|
||||
(_size > 0 && _entries[_size-1] == null)) {
|
||||
Log.warning("DSet in a bad way [size=" + _size +
|
||||
log.warning("DSet in a bad way [size=" + _size +
|
||||
", entries=" + StringUtil.toString(_entries) + "].");
|
||||
Thread.dumpStack();
|
||||
}
|
||||
@@ -221,7 +221,7 @@ public class DSet<E extends DSet.Entry>
|
||||
throw new ConcurrentModificationException();
|
||||
}
|
||||
if (_ssize != _size) {
|
||||
Log.warning("Size changed during iteration [ssize=" + _ssize +
|
||||
log.warning("Size changed during iteration [ssize=" + _ssize +
|
||||
", nsize=" + _size +
|
||||
", entsries=" + StringUtil.toString(_entries) + "].");
|
||||
Thread.dumpStack();
|
||||
@@ -273,7 +273,7 @@ public class DSet<E extends DSet.Entry>
|
||||
|
||||
// if the element is already in the set, bail now
|
||||
if (eidx >= 0) {
|
||||
Log.warning("Refusing to add duplicate entry [entry=" + elem + ", set=" + this + "].");
|
||||
log.warning("Refusing to add duplicate entry [entry=" + elem + ", set=" + this + "].");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ public class DSet<E extends DSet.Entry>
|
||||
if (_size >= elength) {
|
||||
// sanity check
|
||||
if (elength > 2048) {
|
||||
Log.warning("Requested to expand to questionably large size [l=" + elength + "].");
|
||||
log.warning("Requested to expand to questionably large size [l=" + elength + "].");
|
||||
Thread.dumpStack();
|
||||
}
|
||||
|
||||
@@ -331,7 +331,7 @@ public class DSet<E extends DSet.Entry>
|
||||
{
|
||||
// don't fail, but generate a warning if we're passed a null key
|
||||
if (key == null) {
|
||||
Log.warning("Requested to remove null key.");
|
||||
log.warning("Requested to remove null key.");
|
||||
Thread.dumpStack();
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ package com.threerings.presents.dobj;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import com.samskivert.util.MethodFinder;
|
||||
import com.samskivert.util.StringUtil;
|
||||
@@ -110,7 +109,7 @@ public class DynamicListener
|
||||
try {
|
||||
method.invoke(_target, arguments);
|
||||
} catch (Exception e) {
|
||||
log.log(Level.WARNING, "Failed to dispatch event callback " +
|
||||
log.warning("Failed to dispatch event callback " +
|
||||
name + "(" + StringUtil.toString(arguments) + ").", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ package com.threerings.presents.dobj;
|
||||
|
||||
import com.samskivert.util.StringUtil;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* An entry added event is dispatched when an entry is added to a {@link DSet} attribute of a
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
package com.threerings.presents.dobj;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* An entry removed event is dispatched when an entry is removed from a {@link DSet} attribute of a
|
||||
@@ -88,7 +88,7 @@ public class EntryRemovedEvent<T extends DSet.Entry> extends NamedEvent
|
||||
_oldEntry = set.removeKey(_key);
|
||||
if (_oldEntry == null) {
|
||||
// complain if there was actually nothing there
|
||||
Log.warning("No matching entry to remove [key=" + _key + ", set=" + set + "].");
|
||||
log.warning("No matching entry to remove [key=" + _key + ", set=" + set + "].");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,10 +23,10 @@ package com.threerings.presents.dobj;
|
||||
|
||||
import com.samskivert.util.StringUtil;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
|
||||
import com.threerings.presents.net.Transport;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* An entry updated event is dispatched when an entry of a {@link DSet} is updated. It can also be
|
||||
* constructed to request the update of an entry and posted to the dobjmgr.
|
||||
@@ -107,7 +107,7 @@ public class EntryUpdatedEvent<T extends DSet.Entry> extends NamedEvent
|
||||
_oldEntry = set.update(_entry);
|
||||
if (_oldEntry == null) {
|
||||
// complain if we didn't update anything
|
||||
Log.warning("No matching entry to update [entry=" + this + ", set=" + set + "].");
|
||||
log.warning("No matching entry to update [entry=" + this + ", set=" + set + "].");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import java.io.IOException;
|
||||
import com.threerings.io.ObjectInputStream;
|
||||
import com.threerings.io.ObjectOutputStream;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
public class PongResponse extends DownstreamMessage
|
||||
{
|
||||
@@ -90,7 +90,7 @@ public class PongResponse extends DownstreamMessage
|
||||
// the time spent between unpacking the ping and packing the pong
|
||||
// is the processing delay
|
||||
if (_pingStamp == 0L) {
|
||||
Log.warning("Pong response written that was not constructed " +
|
||||
log.warning("Pong response written that was not constructed " +
|
||||
"with a valid ping stamp [rsp=" + this + "].");
|
||||
_processDelay = 0;
|
||||
} else {
|
||||
|
||||
@@ -31,7 +31,6 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import com.samskivert.jdbc.RepositoryUnit;
|
||||
import com.samskivert.jdbc.WriteOnlyUnit;
|
||||
@@ -162,7 +161,7 @@ public class PeerManager
|
||||
try {
|
||||
execute();
|
||||
} catch (Throwable t) {
|
||||
log.log(Level.WARNING, getClass().getName() + " failed.");
|
||||
log.warning(getClass().getName() + " failed.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,7 +334,7 @@ public class PeerManager
|
||||
oout.writeObject(action);
|
||||
actionBytes = bout.toByteArray();
|
||||
} catch (Exception e) {
|
||||
log.log(Level.WARNING, "Failed to serialize node action [action=" + action + "].", e);
|
||||
log.warning("Failed to serialize node action [action=" + action + "].", e);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -603,7 +602,7 @@ public class PeerManager
|
||||
}
|
||||
}
|
||||
public void requestFailed (Exception cause) {
|
||||
log.log(Level.WARNING, "Lock acquisition failed [lock=" + lock + "].", cause);
|
||||
log.warning("Lock acquisition failed [lock=" + lock + "].", cause);
|
||||
operation.fail(null);
|
||||
}
|
||||
});
|
||||
@@ -731,7 +730,7 @@ public class PeerManager
|
||||
action = (NodeAction)oin.readObject();
|
||||
action.invoke();
|
||||
} catch (Exception e) {
|
||||
log.log(Level.WARNING, "Failed to execute node action [from=" + caller.who() +
|
||||
log.warning("Failed to execute node action [from=" + caller.who() +
|
||||
", action=" + action + ", serializedSize=" + serializedAction.length + "].");
|
||||
}
|
||||
}
|
||||
@@ -807,7 +806,7 @@ public class PeerManager
|
||||
try {
|
||||
refreshPeer(record);
|
||||
} catch (Exception e) {
|
||||
log.log(Level.WARNING, "Failure refreshing peer " + record + ".", e);
|
||||
log.warning("Failure refreshing peer " + record + ".", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ public class PeerNode
|
||||
// if our client hasn't updated its record since we last tried to logon, then just
|
||||
// chill
|
||||
if ((_lastConnectStamp - _record.lastUpdated.getTime()) > STALE_INTERVAL) {
|
||||
log.fine("Not reconnecting to stale client [record=" + _record +
|
||||
log.debug("Not reconnecting to stale client [record=" + _record +
|
||||
", lastTry=" + new Date(_lastConnectStamp) + "].");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
|
||||
package com.threerings.presents.server;
|
||||
|
||||
import java.util.logging.Level;
|
||||
|
||||
import com.samskivert.io.PersistenceException;
|
||||
|
||||
import com.samskivert.util.Invoker;
|
||||
@@ -69,7 +67,7 @@ public abstract class Authenticator
|
||||
try {
|
||||
processAuthentication(conn, rsp);
|
||||
} catch (Exception e) { // Persistence or Runtime
|
||||
log.log(Level.WARNING, "Error authenticating user [areq=" + req + "].", e);
|
||||
log.warning("Error authenticating user [areq=" + req + "].", e);
|
||||
rdata.code = AuthCodes.SERVER_ERROR;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -25,7 +25,6 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import com.samskivert.util.Interval;
|
||||
import com.samskivert.util.ObserverList;
|
||||
@@ -119,7 +118,7 @@ public class ClientManager
|
||||
try {
|
||||
pc.shutdown();
|
||||
} catch (Exception e) {
|
||||
log.log(Level.WARNING, "Client choked in shutdown() [client=" +
|
||||
log.warning("Client choked in shutdown() [client=" +
|
||||
StringUtil.safeToString(pc) + "].", e);
|
||||
}
|
||||
}
|
||||
@@ -298,7 +297,7 @@ public class ClientManager
|
||||
return;
|
||||
}
|
||||
|
||||
log.fine("Destroying client " + clobj.who() + ".");
|
||||
log.debug("Destroying client " + clobj.who() + ".");
|
||||
|
||||
// we're all clear to go; remove the mapping
|
||||
_objmap.remove(username);
|
||||
@@ -402,7 +401,7 @@ public class ClientManager
|
||||
// remove the client from the connection map
|
||||
PresentsClient client = _conmap.remove(conn);
|
||||
if (client != null) {
|
||||
log.fine("Unmapped client [client=" + client + ", conn=" + conn + "].");
|
||||
log.debug("Unmapped client [client=" + client + ", conn=" + conn + "].");
|
||||
// let the client know the connection went away
|
||||
client.wasUnmapped();
|
||||
|
||||
@@ -497,7 +496,7 @@ public class ClientManager
|
||||
", dtime=" + (now-client.getNetworkStamp()) + "ms].");
|
||||
client.endSession();
|
||||
} catch (Exception e) {
|
||||
log.log(Level.WARNING, "Choke while flushing client [victim=" + client + "].", e);
|
||||
log.warning("Choke while flushing client [victim=" + client + "].", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -515,7 +514,7 @@ public class ClientManager
|
||||
_clop.apply(clobj);
|
||||
|
||||
} catch (Exception e) {
|
||||
log.log(Level.WARNING, "Client op failed [username=" + username +
|
||||
log.warning("Client op failed [username=" + username +
|
||||
", clop=" + _clop + "].", e);
|
||||
|
||||
} finally {
|
||||
|
||||
@@ -26,12 +26,13 @@ import java.util.ArrayList;
|
||||
import com.samskivert.util.Invoker;
|
||||
import com.threerings.util.Name;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.data.ClientObject;
|
||||
import com.threerings.presents.data.PermissionPolicy;
|
||||
import com.threerings.presents.dobj.DObject;
|
||||
import com.threerings.presents.dobj.ObjectAccessException;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* Used to resolve client data when a user starts a session (or when some other entity needs access
|
||||
* to a client object). Implementations will want to extend this class and override {@link
|
||||
@@ -121,8 +122,7 @@ public class ClientResolver extends Invoker.Unit
|
||||
_clobj.reference();
|
||||
crl.clientResolved(_username, _clobj);
|
||||
} catch (Exception e) {
|
||||
Log.warning("Client resolution listener choked in clientResolved() " + crl);
|
||||
Log.logStackTrace(e);
|
||||
log.warning("Client resolution listener choked in clientResolved() " + crl, e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,9 +172,8 @@ public class ClientResolver extends Invoker.Unit
|
||||
try {
|
||||
crl.resolutionFailed(_username, cause);
|
||||
} catch (Exception e) {
|
||||
Log.warning("Client resolution listener choked in resolutionFailed() [crl=" + crl +
|
||||
", username=" + _username + ", cause=" + cause + "].");
|
||||
Log.logStackTrace(e);
|
||||
log.warning("Client resolution listener choked in resolutionFailed() [crl=" + crl +
|
||||
", username=" + _username + ", cause=" + cause + "].", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,10 +23,11 @@ package com.threerings.presents.server;
|
||||
|
||||
import com.samskivert.util.StringUtil;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.data.ClientObject;
|
||||
import com.threerings.presents.data.InvocationMarshaller;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* Provides the base class via which invocation service requests are
|
||||
* dispatched.
|
||||
@@ -49,7 +50,7 @@ public abstract class InvocationDispatcher
|
||||
ClientObject source, int methodId, Object[] args)
|
||||
throws InvocationException
|
||||
{
|
||||
Log.warning("Requested to dispatch unknown method " +
|
||||
log.warning("Requested to dispatch unknown method " +
|
||||
"[provider=" + provider +
|
||||
", sourceOid=" + source.getOid() +
|
||||
", methodId=" + methodId +
|
||||
|
||||
@@ -30,7 +30,6 @@ import com.samskivert.util.StringUtil;
|
||||
import com.threerings.io.Streamable;
|
||||
import com.threerings.util.StreamableArrayList;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.data.ClientObject;
|
||||
import com.threerings.presents.data.InvocationMarshaller.ListenerMarshaller;
|
||||
import com.threerings.presents.data.InvocationMarshaller;
|
||||
@@ -44,6 +43,8 @@ import com.threerings.presents.dobj.RootDObjectManager;
|
||||
|
||||
import com.threerings.presents.net.Transport;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* The invocation services provide client to server invocations (service requests) and server to
|
||||
* client invocations (responses and notifications). Via this mechanism, the client can make
|
||||
@@ -154,13 +155,13 @@ public class InvocationManager
|
||||
public void clearDispatcher (InvocationMarshaller marsh)
|
||||
{
|
||||
if (marsh == null) {
|
||||
Log.warning("Refusing to unregister null marshaller.");
|
||||
log.warning("Refusing to unregister null marshaller.");
|
||||
Thread.dumpStack();
|
||||
return;
|
||||
}
|
||||
|
||||
if (_dispatchers.remove(marsh.getInvocationCode()) == null) {
|
||||
Log.warning("Requested to remove unregistered marshaller? " +
|
||||
log.warning("Requested to remove unregistered marshaller? " +
|
||||
"[marsh=" + marsh + "].");
|
||||
Thread.dumpStack();
|
||||
}
|
||||
@@ -218,7 +219,7 @@ public class InvocationManager
|
||||
// make sure the client is still around
|
||||
ClientObject source = (ClientObject)_omgr.getObject(clientOid);
|
||||
if (source == null) {
|
||||
Log.info("Client no longer around for invocation " +
|
||||
log.info("Client no longer around for invocation " +
|
||||
"request [clientOid=" + clientOid +
|
||||
", code=" + invCode + ", methId=" + methodId +
|
||||
", args=" + StringUtil.toString(args) + "].");
|
||||
@@ -228,7 +229,7 @@ public class InvocationManager
|
||||
// look up the dispatcher
|
||||
InvocationDispatcher disp = _dispatchers.get(invCode);
|
||||
if (disp == null) {
|
||||
Log.info("Received invocation request but dispatcher " +
|
||||
log.info("Received invocation request but dispatcher " +
|
||||
"registration was already cleared [code=" + invCode +
|
||||
", methId=" + methodId +
|
||||
", args=" + StringUtil.toString(args) + ", marsh=" +
|
||||
@@ -271,7 +272,7 @@ public class InvocationManager
|
||||
rlist.requestFailed(ie.getMessage());
|
||||
|
||||
} else {
|
||||
Log.warning("Service request failed but we've got no " +
|
||||
log.warning("Service request failed but we've got no " +
|
||||
"listener to inform of the failure " +
|
||||
"[caller=" + source.who() + ", code=" + invCode +
|
||||
", dispatcher=" + disp + ", methodId=" + methodId +
|
||||
@@ -280,10 +281,9 @@ public class InvocationManager
|
||||
}
|
||||
|
||||
} catch (Throwable t) {
|
||||
Log.warning("Dispatcher choked [disp=" + disp +
|
||||
log.warning("Dispatcher choked [disp=" + disp +
|
||||
", caller=" + source.who() + ", methId=" + methodId +
|
||||
", args=" + StringUtil.toString(args) + "].");
|
||||
Log.logStackTrace(t);
|
||||
", args=" + StringUtil.toString(args) + "].", t);
|
||||
|
||||
// avoid logging an error when the listener notices that it's
|
||||
// been ignored.
|
||||
|
||||
@@ -23,13 +23,14 @@ package com.threerings.presents.server;
|
||||
|
||||
import com.samskivert.util.StringUtil;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.client.InvocationReceiver.Registration;
|
||||
import com.threerings.presents.data.ClientObject;
|
||||
import com.threerings.presents.dobj.InvocationNotificationEvent;
|
||||
|
||||
import com.threerings.presents.net.Transport;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* Provides basic functionality used by all invocation sender classes.
|
||||
*/
|
||||
@@ -56,7 +57,7 @@ public abstract class InvocationSender
|
||||
// specific client
|
||||
Registration rreg = target.receivers.get(receiverCode);
|
||||
if (rreg == null) {
|
||||
Log.warning("Unable to locate receiver for invocation service notification " +
|
||||
log.warning("Unable to locate receiver for invocation service notification " +
|
||||
"[clobj=" + target.who() + ", code=" + receiverCode +
|
||||
", methId=" + methodId + ", args=" + StringUtil.toString(args) + "].");
|
||||
Thread.dumpStack();
|
||||
|
||||
@@ -25,7 +25,6 @@ import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.util.HashMap;
|
||||
import java.util.TimeZone;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import com.samskivert.util.HashIntMap;
|
||||
import com.samskivert.util.ResultListener;
|
||||
@@ -247,7 +246,7 @@ public class PresentsClient
|
||||
}
|
||||
|
||||
public void resolutionFailed (Name username, Exception reason) {
|
||||
log.log(Level.WARNING, "Unable to resolve new client object [oldname=" + _username +
|
||||
log.warning("Unable to resolve new client object [oldname=" + _username +
|
||||
", newname=" + username + ", reason=" + reason + "].", reason);
|
||||
|
||||
// let our listener know we're hosed
|
||||
@@ -308,7 +307,7 @@ public class PresentsClient
|
||||
try {
|
||||
sessionDidEnd();
|
||||
} catch (Exception e) {
|
||||
log.log(Level.WARNING, "Choked in sessionDidEnd " + this + ".", e);
|
||||
log.warning("Choked in sessionDidEnd " + this + ".", e);
|
||||
}
|
||||
|
||||
// release (and destroy) our client object
|
||||
@@ -364,7 +363,7 @@ public class PresentsClient
|
||||
public void resolutionFailed (Name username, Exception reason)
|
||||
{
|
||||
// urk; nothing to do but complain and get the f**k out of dodge
|
||||
log.log(Level.WARNING, "Unable to resolve client [username=" + username + "].", reason);
|
||||
log.warning("Unable to resolve client [username=" + username + "].", reason);
|
||||
|
||||
// end the session now to prevent danglage
|
||||
endSession();
|
||||
@@ -990,7 +989,7 @@ public class PresentsClient
|
||||
{
|
||||
public void dispatch (final PresentsClient client, UpstreamMessage msg)
|
||||
{
|
||||
log.fine("Client requested logoff " + client + ".");
|
||||
log.debug("Client requested logoff " + client + ".");
|
||||
client.safeEndSession();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import com.samskivert.util.AuditLogger;
|
||||
import com.samskivert.util.HashIntMap;
|
||||
@@ -331,8 +330,7 @@ public class PresentsDObjectMgr
|
||||
handleFatalError(unit, e);
|
||||
|
||||
} catch (Throwable t) {
|
||||
log.log(Level.WARNING,
|
||||
"Execution unit failed [unit=" + StringUtil.safeToString(unit) + "].", t);
|
||||
log.warning("Execution unit failed", "unit", unit, t);
|
||||
}
|
||||
|
||||
// compute the elapsed time in microseconds
|
||||
@@ -340,9 +338,8 @@ public class PresentsDObjectMgr
|
||||
|
||||
// report excessively long units
|
||||
if (elapsed > 500000 && !(unit instanceof LongRunnable)) {
|
||||
log.warning("Long dobj unit [u=" + StringUtil.safeToString(unit) +
|
||||
" (" + StringUtil.shortClassName(unit) + ")" +
|
||||
", time=" + (elapsed/1000) + "ms].");
|
||||
log.warning("Long dobj unit " + StringUtil.shortClassName(unit), "unit", unit,
|
||||
"time", (elapsed/1000) + "ms");
|
||||
}
|
||||
|
||||
// periodically sample and record the time spent processing a unit
|
||||
@@ -380,7 +377,7 @@ public class PresentsDObjectMgr
|
||||
// look up the target object
|
||||
DObject target = _objects.get(event.getTargetOid());
|
||||
if (target == null) {
|
||||
log.fine("Compound event target no longer exists [event=" + event + "].");
|
||||
log.debug("Compound event target no longer exists [event=" + event + "].");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -411,7 +408,7 @@ public class PresentsDObjectMgr
|
||||
// look up the target object
|
||||
DObject target = _objects.get(event.getTargetOid());
|
||||
if (target == null) {
|
||||
log.fine("Event target no longer exists [event=" + event + "].");
|
||||
log.debug("Event target no longer exists [event=" + event + "].");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -462,7 +459,7 @@ public class PresentsDObjectMgr
|
||||
handleFatalError(event, e);
|
||||
|
||||
} catch (Throwable t) {
|
||||
log.log(Level.WARNING, "Failure processing event [event=" + event +
|
||||
log.warning("Failure processing event [event=" + event +
|
||||
", target=" + target + "].", t);
|
||||
}
|
||||
|
||||
@@ -481,7 +478,7 @@ public class PresentsDObjectMgr
|
||||
if (_fatalThrottle.throttleOp()) {
|
||||
throw error;
|
||||
}
|
||||
log.log(Level.WARNING, "Fatal error caused by '" + causer + "': " + error, error);
|
||||
log.warning("Fatal error caused by '" + causer + "': " + error, error);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -772,7 +769,7 @@ public class PresentsDObjectMgr
|
||||
try {
|
||||
sub.objectAvailable(obj);
|
||||
} catch (Exception e) {
|
||||
log.log(Level.WARNING, "Subscriber choked during object available " +
|
||||
log.warning("Subscriber choked during object available " +
|
||||
"[obj=" + StringUtil.safeToString(obj) + ", sub=" + sub + "].", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import java.util.Iterator;
|
||||
import com.samskivert.util.Invoker;
|
||||
import com.samskivert.util.StringUtil;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* Extends the generic {@link Invoker} and integrates it a bit more into
|
||||
@@ -172,7 +172,7 @@ public class PresentsInvoker extends Invoker
|
||||
// otherwise end it, and complain if we're ending it
|
||||
// because of passes
|
||||
if (_passCount >= MAX_PASSES) {
|
||||
Log.warning("Shutdown Unit passed 50 times without " +
|
||||
log.warning("Shutdown Unit passed 50 times without " +
|
||||
"finishing, shutting down harshly.");
|
||||
}
|
||||
doShutdown();
|
||||
@@ -185,7 +185,7 @@ public class PresentsInvoker extends Invoker
|
||||
protected boolean checkLoops ()
|
||||
{
|
||||
if (_loopCount > MAX_LOOPS) {
|
||||
Log.warning("Shutdown Unit looped on one thread 10000 times " +
|
||||
log.warning("Shutdown Unit looped on one thread 10000 times " +
|
||||
"without finishing, shutting down harshly.");
|
||||
doShutdown();
|
||||
return true;
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
package com.threerings.presents.server;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.data.ClientObject;
|
||||
import com.threerings.presents.dobj.AccessController;
|
||||
import com.threerings.presents.dobj.DEvent;
|
||||
@@ -31,6 +30,8 @@ import com.threerings.presents.dobj.MessageEvent;
|
||||
import com.threerings.presents.dobj.NamedEvent;
|
||||
import com.threerings.presents.dobj.Subscriber;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* Defines the various object access controllers used by the Presents server.
|
||||
*/
|
||||
@@ -76,7 +77,7 @@ public class PresentsObjectAccess
|
||||
if (sub instanceof PresentsClient) {
|
||||
allowed = ((PresentsClient)sub).getClientObject() == object;
|
||||
if (!allowed) {
|
||||
Log.warning("Refusing ClientObject subscription request " +
|
||||
log.warning("Refusing ClientObject subscription request " +
|
||||
"[obj=" + ((ClientObject)object).who() + ", sub=" + sub + "].");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
package com.threerings.presents.server;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import com.samskivert.util.Interval;
|
||||
import com.samskivert.util.ObserverList;
|
||||
@@ -123,7 +122,7 @@ public class PresentsServer
|
||||
Runnable trun = (Runnable)tmclass.newInstance();
|
||||
trun.run();
|
||||
} catch (Exception e) {
|
||||
log.log(Level.WARNING, "Unable to invoke test module '" + testmod + "'.", e);
|
||||
log.warning("Unable to invoke test module '" + testmod + "'.", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,7 +131,7 @@ public class PresentsServer
|
||||
server.run();
|
||||
|
||||
} catch (Exception e) {
|
||||
log.log(Level.WARNING, "Unable to initialize server.", e);
|
||||
log.warning("Unable to initialize server.", e);
|
||||
System.exit(-1);
|
||||
}
|
||||
}
|
||||
@@ -305,7 +304,7 @@ public class PresentsServer
|
||||
try {
|
||||
rptr.appendReport(report, now, sinceLast, reset);
|
||||
} catch (Throwable t) {
|
||||
log.log(Level.WARNING, "Reporter choked [rptr=" + rptr + "].", t);
|
||||
log.warning("Reporter choked [rptr=" + rptr + "].", t);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
|
||||
package com.threerings.presents.server;
|
||||
|
||||
import java.util.logging.Level;
|
||||
|
||||
import com.samskivert.io.PersistenceException;
|
||||
|
||||
import com.samskivert.util.Invoker;
|
||||
@@ -75,7 +73,7 @@ public class Rejector extends PresentsServer
|
||||
server.init();
|
||||
server.run();
|
||||
} catch (Exception e) {
|
||||
log.log(Level.WARNING, "Unable to initialize server.", e);
|
||||
log.warning("Unable to initialize server.", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ package com.threerings.presents.server;
|
||||
import java.util.HashMap;
|
||||
import com.samskivert.util.ResultListener;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.client.TimeBaseService.GotTimeBaseListener;
|
||||
|
||||
import com.threerings.presents.data.ClientObject;
|
||||
@@ -33,6 +32,8 @@ import com.threerings.presents.data.TimeBaseObject;
|
||||
|
||||
import com.threerings.presents.dobj.RootDObjectManager;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* Provides the server-side of the time base services. The time base services provide a means by
|
||||
* which delta times can be sent over the network which are expanded based on a shared base time
|
||||
|
||||
@@ -27,11 +27,12 @@ import java.nio.channels.SocketChannel;
|
||||
|
||||
import com.samskivert.util.StringUtil;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.net.AuthRequest;
|
||||
import com.threerings.presents.net.AuthResponse;
|
||||
import com.threerings.presents.net.UpstreamMessage;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* The authing connection manages the client connection until
|
||||
* authentication has completed (for better or for worse).
|
||||
@@ -66,7 +67,7 @@ public class AuthingConnection extends Connection
|
||||
_cmgr.getAuthenticator().authenticateConnection(this);
|
||||
|
||||
} catch (ClassCastException cce) {
|
||||
Log.warning("Received non-authreq message during " +
|
||||
log.warning("Received non-authreq message during " +
|
||||
"authentication process [conn=" + this +
|
||||
", msg=" + msg + "].");
|
||||
}
|
||||
|
||||
@@ -44,12 +44,13 @@ import com.threerings.io.ObjectOutputStream;
|
||||
import com.threerings.io.UnreliableObjectInputStream;
|
||||
import com.threerings.io.UnreliableObjectOutputStream;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.net.DownstreamMessage;
|
||||
import com.threerings.presents.net.PingRequest;
|
||||
import com.threerings.presents.net.UpstreamMessage;
|
||||
import com.threerings.presents.util.DatagramSequencer;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* The base connection class implements the net event handler interface and processes raw incoming
|
||||
* network data into a stream of parsed <code>UpstreamMessage</code> objects. It also provides the
|
||||
@@ -166,7 +167,7 @@ public abstract class Connection implements NetEventHandler
|
||||
{
|
||||
// we shouldn't be closed twice
|
||||
if (isClosed()) {
|
||||
Log.warning("Attempted to re-close connection " + this + ".");
|
||||
log.warning("Attempted to re-close connection " + this + ".");
|
||||
Thread.dumpStack();
|
||||
return;
|
||||
}
|
||||
@@ -186,7 +187,7 @@ public abstract class Connection implements NetEventHandler
|
||||
{
|
||||
// if we're already closed, then something is seriously funny
|
||||
if (isClosed()) {
|
||||
Log.warning("Failure reported on closed connection " + this + ".");
|
||||
log.warning("Failure reported on closed connection " + this + ".");
|
||||
Thread.dumpStack();
|
||||
return;
|
||||
}
|
||||
@@ -264,11 +265,11 @@ public abstract class Connection implements NetEventHandler
|
||||
return;
|
||||
}
|
||||
|
||||
Log.debug("Closing channel " + this + ".");
|
||||
log.debug("Closing channel " + this + ".");
|
||||
try {
|
||||
_channel.close();
|
||||
} catch (IOException ioe) {
|
||||
Log.warning("Error closing connection [conn=" + this + ", error=" + ioe + "].");
|
||||
log.warning("Error closing connection [conn=" + this + ", error=" + ioe + "].");
|
||||
}
|
||||
|
||||
// clear out our references to prevent repeat closings
|
||||
@@ -314,7 +315,7 @@ public abstract class Connection implements NetEventHandler
|
||||
close();
|
||||
|
||||
} catch (ClassNotFoundException cnfe) {
|
||||
Log.warning("Error reading message from socket [channel=" +
|
||||
log.warning("Error reading message from socket [channel=" +
|
||||
StringUtil.safeToString(_channel) + ", error=" + cnfe + "].");
|
||||
// deal with the failure
|
||||
String errmsg = "Unable to decode incoming message.";
|
||||
@@ -324,7 +325,7 @@ public abstract class Connection implements NetEventHandler
|
||||
// don't log a warning for the ever-popular "the client dropped the connection" failure
|
||||
String msg = ioe.getMessage();
|
||||
if (msg == null || msg.indexOf("reset by peer") == -1) {
|
||||
Log.warning("Error reading message from socket [channel=" +
|
||||
log.warning("Error reading message from socket [channel=" +
|
||||
StringUtil.safeToString(_channel) + ", error=" + ioe + "].");
|
||||
}
|
||||
// deal with the failure
|
||||
@@ -344,7 +345,7 @@ public abstract class Connection implements NetEventHandler
|
||||
try {
|
||||
_digest = MessageDigest.getInstance("MD5");
|
||||
} catch (NoSuchAlgorithmException nsae) {
|
||||
Log.warning("Missing MD5 algorithm.");
|
||||
log.warning("Missing MD5 algorithm.");
|
||||
return;
|
||||
}
|
||||
ByteBufferInputStream bin = new ByteBufferInputStream(buf);
|
||||
@@ -360,7 +361,7 @@ public abstract class Connection implements NetEventHandler
|
||||
buf.position(4);
|
||||
for (int ii = 0; ii < 8; ii++) {
|
||||
if (hash[ii] != buf.get()) {
|
||||
Log.warning("Datagram failed hash check [connectionId=" + _connectionId +
|
||||
log.warning("Datagram failed hash check [connectionId=" + _connectionId +
|
||||
", source=" + source + "].");
|
||||
return;
|
||||
}
|
||||
@@ -379,10 +380,10 @@ public abstract class Connection implements NetEventHandler
|
||||
_handler.handleMessage(msg);
|
||||
|
||||
} catch (ClassNotFoundException cnfe) {
|
||||
Log.warning("Error reading datagram [error=" + cnfe + "].");
|
||||
log.warning("Error reading datagram [error=" + cnfe + "].");
|
||||
|
||||
} catch (IOException ioe) {
|
||||
Log.warning("Error reading datagram [error=" + ioe + "].");
|
||||
log.warning("Error reading datagram [error=" + ioe + "].");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -396,7 +397,7 @@ public abstract class Connection implements NetEventHandler
|
||||
if (isClosed()) {
|
||||
return true;
|
||||
}
|
||||
Log.info("Disconnecting non-communicative client [conn=" + this +
|
||||
log.info("Disconnecting non-communicative client [conn=" + this +
|
||||
", idle=" + idleMillis + "ms].");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,6 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import com.samskivert.util.*;
|
||||
|
||||
@@ -286,7 +285,7 @@ public class ConnectionManager extends LoopingThread
|
||||
log.info("Server listening on " + isa + ".");
|
||||
|
||||
} catch (IOException ioe) {
|
||||
log.log(Level.WARNING, "Failure listening to socket on port '" +
|
||||
log.warning("Failure listening to socket on port '" +
|
||||
_ports[ii] + "'.", ioe);
|
||||
_failure = ioe;
|
||||
}
|
||||
@@ -339,7 +338,7 @@ public class ConnectionManager extends LoopingThread
|
||||
log.info("Server accepting datagrams on " + isa + ".");
|
||||
|
||||
} catch (IOException ioe) {
|
||||
log.log(Level.WARNING, "Failure opening datagram channel on port '" +
|
||||
log.warning("Failure opening datagram channel on port '" +
|
||||
port + "'.", ioe);
|
||||
}
|
||||
}
|
||||
@@ -459,14 +458,14 @@ public class ConnectionManager extends LoopingThread
|
||||
conn.getAuthRequest(), conn.getAuthResponse());
|
||||
|
||||
} catch (IOException ioe) {
|
||||
log.log(Level.WARNING, "Failure upgrading authing connection to running.", ioe);
|
||||
log.warning("Failure upgrading authing connection to running.", ioe);
|
||||
}
|
||||
}
|
||||
|
||||
Set<SelectionKey> ready = null;
|
||||
try {
|
||||
// check for incoming network events
|
||||
// log.fine("Selecting from " + StringUtil.toString(_selector.keys()) + " (" +
|
||||
// log.debug("Selecting from " + StringUtil.toString(_selector.keys()) + " (" +
|
||||
// SELECT_LOOP_TIME + ").");
|
||||
int ecount = _selector.select(SELECT_LOOP_TIME);
|
||||
ready = _selector.selectedKeys();
|
||||
@@ -482,7 +481,7 @@ public class ConnectionManager extends LoopingThread
|
||||
} catch (IOException ioe) {
|
||||
if ("Invalid argument".equals(ioe.getMessage())) {
|
||||
// what is this, anyway?
|
||||
log.log(Level.WARNING, "Failure select()ing.", ioe);
|
||||
log.warning("Failure select()ing.", ioe);
|
||||
} else {
|
||||
log.warning("Failure select()ing [ioe=" + ioe + "].");
|
||||
}
|
||||
@@ -492,7 +491,7 @@ public class ConnectionManager extends LoopingThread
|
||||
// this block of code deals with a bug in the _selector that we observed on 2005-05-02,
|
||||
// instead of looping indefinitely after things go pear-shaped, shut us down in an
|
||||
// orderly fashion
|
||||
log.log(Level.WARNING, "Failure select()ing.", re);
|
||||
log.warning("Failure select()ing.", re);
|
||||
if (_runtimeExceptionCount++ >= 20) {
|
||||
log.warning("Too many errors, bailing.");
|
||||
shutdown();
|
||||
@@ -532,7 +531,7 @@ public class ConnectionManager extends LoopingThread
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.log(Level.WARNING, "Error processing network data: " + handler + ".", e);
|
||||
log.warning("Error processing network data: " + handler + ".", e);
|
||||
|
||||
// if you freak out here, you go straight in the can
|
||||
if (handler != null && handler instanceof Connection) {
|
||||
@@ -681,7 +680,7 @@ public class ConnectionManager extends LoopingThread
|
||||
try {
|
||||
return _datagramChannel.send(_databuf, target) > 0;
|
||||
} catch (IOException ioe) {
|
||||
log.log(Level.WARNING, "Failed to send datagram.", ioe);
|
||||
log.warning("Failed to send datagram.", ioe);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -699,7 +698,7 @@ public class ConnectionManager extends LoopingThread
|
||||
protected void handleIterateFailure (Exception e)
|
||||
{
|
||||
// log the exception
|
||||
log.log(Level.WARNING, "ConnectionManager.iterate() uncaught exception.", e);
|
||||
log.warning("ConnectionManager.iterate() uncaught exception.", e);
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
@@ -712,7 +711,7 @@ public class ConnectionManager extends LoopingThread
|
||||
try {
|
||||
_ssocket.socket().close();
|
||||
} catch (IOException ioe) {
|
||||
log.log(Level.WARNING, "Failed to close listening socket.", ioe);
|
||||
log.warning("Failed to close listening socket.", ioe);
|
||||
}
|
||||
|
||||
// and the datagram socket, if any
|
||||
@@ -752,7 +751,7 @@ public class ConnectionManager extends LoopingThread
|
||||
return;
|
||||
}
|
||||
|
||||
// log.fine("Accepted connection " + channel + ".");
|
||||
// log.debug("Accepted connection " + channel + ".");
|
||||
|
||||
// create a new authing connection object to manage the authentication of this client
|
||||
// connection and register it with our selection set
|
||||
@@ -767,7 +766,7 @@ public class ConnectionManager extends LoopingThread
|
||||
|
||||
} catch (IOException ioe) {
|
||||
// no need to complain this happens in the normal course of events
|
||||
// log.log(Level.WARNING, "Failure accepting new connection.", ioe);
|
||||
// log.warning("Failure accepting new connection.", ioe);
|
||||
}
|
||||
|
||||
// make sure we don't leak a socket if something went awry
|
||||
@@ -792,7 +791,7 @@ public class ConnectionManager extends LoopingThread
|
||||
try {
|
||||
source = (InetSocketAddress)listener.receive(_databuf);
|
||||
} catch (IOException ioe) {
|
||||
log.log(Level.WARNING, "Failure receiving datagram.", ioe);
|
||||
log.warning("Failure receiving datagram.", ioe);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -873,7 +872,7 @@ public class ConnectionManager extends LoopingThread
|
||||
_outq.append(new Tuple<Connection,byte[]>(conn, data));
|
||||
|
||||
} catch (Exception e) {
|
||||
log.log(Level.WARNING, "Failure flattening message [conn=" + conn +
|
||||
log.warning("Failure flattening message [conn=" + conn +
|
||||
", msg=" + msg + "].", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import java.util.HashMap;
|
||||
import com.samskivert.util.MethodFinder;
|
||||
import com.samskivert.util.StringUtil;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* Class related utility functions.
|
||||
@@ -80,11 +80,11 @@ public class ClassUtil
|
||||
|
||||
} catch (NoSuchMethodException nsme) {
|
||||
// nothing to do here but fall through and return null
|
||||
Log.info("No such method [name=" + name + ", tclass=" + tclass.getName() +
|
||||
log.info("No such method [name=" + name + ", tclass=" + tclass.getName() +
|
||||
", args=" + StringUtil.toString(args) + ", error=" + nsme + "].");
|
||||
|
||||
} catch (SecurityException se) {
|
||||
Log.warning("Unable to look up method? [tclass=" + tclass.getName() +
|
||||
log.warning("Unable to look up method? [tclass=" + tclass.getName() +
|
||||
", mname=" + name + "].");
|
||||
}
|
||||
|
||||
|
||||
@@ -23,11 +23,12 @@ package com.threerings.presents.util;
|
||||
|
||||
import com.samskivert.util.ResultListener;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.client.InvocationService;
|
||||
import com.threerings.presents.data.InvocationCodes;
|
||||
import com.threerings.presents.server.InvocationException;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* Adapts the response from a {@link ResultListener} to a {@link ConfirmListener} wherein the
|
||||
* result is ignored. If the failure is an instance fo {@link InvocationException} the message will
|
||||
@@ -56,7 +57,7 @@ public class IgnoreConfirmAdapter<T> implements ResultListener<T>
|
||||
if (cause instanceof InvocationException) {
|
||||
_listener.requestFailed(cause.getMessage());
|
||||
} else {
|
||||
Log.logStackTrace(cause);
|
||||
log.warning(cause);
|
||||
_listener.requestFailed(InvocationCodes.INTERNAL_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
|
||||
package com.threerings.presents.util;
|
||||
|
||||
import java.util.logging.Level;
|
||||
|
||||
import com.samskivert.util.Invoker;
|
||||
|
||||
import com.threerings.presents.client.InvocationService;
|
||||
@@ -73,7 +71,7 @@ public abstract class PersistingUnit extends Invoker.Unit
|
||||
if (error instanceof InvocationException) {
|
||||
_listener.requestFailed(error.getMessage());
|
||||
} else {
|
||||
log.log(Level.WARNING, getFailureMessage(), error);
|
||||
log.warning(getFailureMessage(), error);
|
||||
_listener.requestFailed(InvocationCodes.INTERNAL_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,11 +23,12 @@ package com.threerings.presents.util;
|
||||
|
||||
import com.samskivert.util.ResultListener;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.client.InvocationService;
|
||||
import com.threerings.presents.data.InvocationCodes;
|
||||
import com.threerings.presents.server.InvocationException;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* Adapts the response from a {@link ResultListener} to an InvocationService.ResultListener if the
|
||||
* failure is an instance of {@link InvocationException} the message will be passed on to the
|
||||
@@ -55,7 +56,7 @@ public class ResultAdapter<T> implements ResultListener<T>
|
||||
if (cause instanceof InvocationException) {
|
||||
_listener.requestFailed(cause.getMessage());
|
||||
} else {
|
||||
Log.logStackTrace(cause);
|
||||
log.warning(cause);
|
||||
_listener.requestFailed(InvocationCodes.INTERNAL_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,12 +23,13 @@ package com.threerings.presents.util;
|
||||
|
||||
import com.samskivert.util.StringUtil;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.dobj.DObject;
|
||||
import com.threerings.presents.dobj.DObjectManager;
|
||||
import com.threerings.presents.dobj.ObjectAccessException;
|
||||
import com.threerings.presents.dobj.Subscriber;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* A class that safely handles the asynchronous subscription to a
|
||||
* distributed object when it is not know if the subscription will
|
||||
@@ -73,7 +74,7 @@ public class SafeSubscriber<T extends DObject>
|
||||
public void subscribe (DObjectManager omgr)
|
||||
{
|
||||
if (_active) {
|
||||
Log.warning("Active safesub asked to resubscribe " + this + ".");
|
||||
log.warning("Active safesub asked to resubscribe " + this + ".");
|
||||
Thread.dumpStack();
|
||||
return;
|
||||
}
|
||||
@@ -84,7 +85,7 @@ public class SafeSubscriber<T extends DObject>
|
||||
// make sure we dont have an object reference (which should be
|
||||
// logically impossible)
|
||||
if (_object != null) {
|
||||
Log.warning("Incroyable! A safesub has an object and was " +
|
||||
log.warning("Incroyable! A safesub has an object and was " +
|
||||
"non-active!? " + this + ".");
|
||||
Thread.dumpStack();
|
||||
// make do in the face of insanity
|
||||
@@ -122,7 +123,7 @@ public class SafeSubscriber<T extends DObject>
|
||||
if (_object == null && !_pending) {
|
||||
return;
|
||||
}
|
||||
Log.warning("Inactive safesub asked to unsubscribe " + this + ".");
|
||||
log.warning("Inactive safesub asked to unsubscribe " + this + ".");
|
||||
Thread.dumpStack();
|
||||
}
|
||||
|
||||
@@ -132,7 +133,7 @@ public class SafeSubscriber<T extends DObject>
|
||||
if (_pending) {
|
||||
// make sure we don't have an object reference
|
||||
if (_object != null) {
|
||||
Log.warning("Incroyable! A safesub has an object and is " +
|
||||
log.warning("Incroyable! A safesub has an object and is " +
|
||||
"pending!? " + this + ".");
|
||||
Thread.dumpStack();
|
||||
} else {
|
||||
@@ -144,7 +145,7 @@ public class SafeSubscriber<T extends DObject>
|
||||
|
||||
// make sure we have our object
|
||||
if (_object == null) {
|
||||
Log.warning("Zut alors! A safesub _was_ active and not " +
|
||||
log.warning("Zut alors! A safesub _was_ active and not " +
|
||||
"pending yet has no object!? " + this + ".");
|
||||
Thread.dumpStack();
|
||||
// nothing to do since we're apparently already unsubscribed
|
||||
@@ -161,13 +162,13 @@ public class SafeSubscriber<T extends DObject>
|
||||
{
|
||||
// make sure life is not too cruel
|
||||
if (_object != null) {
|
||||
Log.warning("Madre de dios! Our object came available but " +
|
||||
log.warning("Madre de dios! Our object came available but " +
|
||||
"we've already got one!? " + this);
|
||||
// go ahead and pitch the old one, God knows what's going on
|
||||
_object = null;
|
||||
}
|
||||
if (!_pending) {
|
||||
Log.warning("J.C. on a pogo stick! Our object came available " +
|
||||
log.warning("J.C. on a pogo stick! Our object came available " +
|
||||
"but we're not pending!? " + this);
|
||||
// go with our badselves, it's the only way
|
||||
}
|
||||
@@ -197,7 +198,7 @@ public class SafeSubscriber<T extends DObject>
|
||||
{
|
||||
// do the right thing with our pending state
|
||||
if (!_pending) {
|
||||
Log.warning("Criminy creole! Our subscribe failed but we're " +
|
||||
log.warning("Criminy creole! Our subscribe failed but we're " +
|
||||
"not pending!? " + this);
|
||||
// go with our badselves, it's the only way
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class MessageManager
|
||||
|
||||
// use the default locale
|
||||
_locale = Locale.getDefault();
|
||||
log.fine("Using locale: " + _locale + ".");
|
||||
log.debug("Using locale: " + _locale + ".");
|
||||
|
||||
// make sure the prefix ends with a dot
|
||||
if (!_prefix.endsWith(".")) {
|
||||
|
||||
@@ -22,13 +22,14 @@
|
||||
package com.threerings.bureau.client;
|
||||
|
||||
import com.samskivert.util.OneLineLogFormatter;
|
||||
import com.threerings.bureau.Log;
|
||||
import com.samskivert.util.Queue;
|
||||
import com.samskivert.util.StringUtil;
|
||||
import com.threerings.bureau.client.BureauDirector;
|
||||
import com.threerings.bureau.data.AgentObject;
|
||||
import com.samskivert.util.RunQueue;
|
||||
|
||||
import static com.threerings.bureau.Log.log;
|
||||
|
||||
/**
|
||||
* Extends bureau client minimally and provides a static main function to create a client and
|
||||
* connect to a server given by system properties.
|
||||
@@ -91,12 +92,12 @@ public class TestClient extends BureauClient
|
||||
{
|
||||
public void start ()
|
||||
{
|
||||
Log.info("Starting agent " + StringUtil.toString(_agentObj));
|
||||
log.info("Starting agent " + StringUtil.toString(_agentObj));
|
||||
}
|
||||
|
||||
public void stop ()
|
||||
{
|
||||
Log.info("Stopping agent " + StringUtil.toString(_agentObj));
|
||||
log.info("Stopping agent " + StringUtil.toString(_agentObj));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,12 +21,15 @@
|
||||
|
||||
package com.threerings.bureau.server;
|
||||
|
||||
import com.samskivert.util.OneLineLogFormatter;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.threerings.bureau.data.AgentObject;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import com.threerings.bureau.data.AgentObject;
|
||||
|
||||
import static com.threerings.bureau.Log.log;
|
||||
|
||||
/**
|
||||
* Uses a TestServer to pound on the BureauRegistry. Sends random sequences of
|
||||
* startAgent and destroyAgent. Most aspects of the randomness are configurable using system
|
||||
@@ -43,11 +46,11 @@ public class RegistryTester
|
||||
{
|
||||
String val = System.getProperty(name);
|
||||
if (val == null) {
|
||||
TestServer.log.info("Property " + name + " is " + defaultVal);
|
||||
log.info("Property " + name + " is " + defaultVal);
|
||||
return defaultVal;
|
||||
}
|
||||
int ival = Integer.parseInt(val);
|
||||
TestServer.log.info("Property " + name + " is " + ival);
|
||||
log.info("Property " + name + " is " + ival);
|
||||
return ival;
|
||||
}
|
||||
|
||||
@@ -56,9 +59,6 @@ public class RegistryTester
|
||||
*/
|
||||
public static void main (String[] args)
|
||||
{
|
||||
// make log pretty
|
||||
OneLineLogFormatter.configureDefaultHandler();
|
||||
|
||||
TestServer server = new TestServer();
|
||||
RegistryTester tester = new RegistryTester(server);
|
||||
|
||||
@@ -68,8 +68,7 @@ public class RegistryTester
|
||||
server.run();
|
||||
|
||||
} catch (Exception e) {
|
||||
TestServer.log.warning("Unable to initialize server.");
|
||||
TestServer.logStackTrace(e);
|
||||
log.warning("Unable to initialize server.", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +94,7 @@ public class RegistryTester
|
||||
// TODO: this is not called on Ctrl-C, need a way to shut down gracefully
|
||||
TestServer.registerShutdowner(new TestServer.Shutdowner() {
|
||||
public void shutdown () {
|
||||
TestServer.log.info("Shutting down tests");
|
||||
log.info("Shutting down tests");
|
||||
_stop = true;
|
||||
}
|
||||
});
|
||||
@@ -110,9 +109,9 @@ public class RegistryTester
|
||||
|
||||
Thread thread = new Thread("Registry test thread") {
|
||||
public void run () {
|
||||
TestServer.log.info(getName() + " started");
|
||||
log.info(getName() + " started");
|
||||
runTestThread();
|
||||
TestServer.log.info(getName() + " stopped");
|
||||
log.info(getName() + " stopped");
|
||||
}
|
||||
};
|
||||
thread.start();
|
||||
@@ -139,17 +138,17 @@ public class RegistryTester
|
||||
_rng1 = new Random(seed);
|
||||
_rng2 = new Random(seed);
|
||||
|
||||
TestServer.log.info("Running tests, seed is " + seed);
|
||||
log.info("Running tests, seed is " + seed);
|
||||
|
||||
// runnable that generates N requests to create or destroy agents
|
||||
Runnable createOrDestroyAgents = new Runnable() {
|
||||
public void run () {
|
||||
int ops = 1 + _rng1.nextInt(_maxOps);
|
||||
TestServer.log.info("Starting " + ops + " agent requests");
|
||||
log.info("Starting " + ops + " agent requests");
|
||||
for (int i = 0; i < ops; ++i) {
|
||||
randomlyCreateOrDestroyAgent();
|
||||
}
|
||||
TestServer.log.info("Finished " + ops + " agent requests");
|
||||
log.info("Finished " + ops + " agent requests");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -188,13 +187,13 @@ public class RegistryTester
|
||||
if (size >= _maxAgents ||
|
||||
(size != 0 && _rng1.nextInt(100) >= _createChance)) {
|
||||
AgentObject toRemove = _agents.remove(_rng1.nextInt(size));
|
||||
TestServer.log.info("Removing agent " + toRemove.getOid());
|
||||
log.info("Removing agent " + toRemove.getOid());
|
||||
TestServer.breg.destroyAgent(toRemove);
|
||||
}
|
||||
else {
|
||||
AgentObject added = create(_rng1.nextInt(_numBureaus) + 1);
|
||||
_agents.add(added);
|
||||
TestServer.log.info("Added agent " + added.getOid());
|
||||
log.info("Added agent " + added.getOid());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,36 +22,24 @@
|
||||
package com.threerings.bureau.server;
|
||||
|
||||
import com.threerings.presents.server.PresentsServer;
|
||||
import com.samskivert.util.OneLineLogFormatter;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import static com.threerings.bureau.Log.log;
|
||||
|
||||
/**
|
||||
* Extends a presents server to include a bureau registry.
|
||||
*/
|
||||
public class TestServer extends PresentsServer
|
||||
{
|
||||
/** We dispatch our log messages through this logger. */
|
||||
public static Logger log = Logger.getLogger(TestServer.class.getName());
|
||||
|
||||
/**
|
||||
* The bureau registry for the server. Will be null until <code>init</code> is called.
|
||||
*/
|
||||
public static BureauRegistry breg;
|
||||
|
||||
public static void logStackTrace (Throwable t)
|
||||
{
|
||||
log.log(Level.WARNING, t.getMessage(), t);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new server and runs it.
|
||||
*/
|
||||
public static void main (String[] args)
|
||||
{
|
||||
// make log pretty
|
||||
OneLineLogFormatter.configureDefaultHandler();
|
||||
|
||||
final TestServer server = new TestServer();
|
||||
try {
|
||||
server.init();
|
||||
@@ -59,8 +47,7 @@ public class TestServer extends PresentsServer
|
||||
server.run();
|
||||
|
||||
} catch (Exception e) {
|
||||
log.warning("Unable to initialize server.");
|
||||
logStackTrace(e);
|
||||
log.warning("Unable to initialize server.", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import com.threerings.util.Name;
|
||||
import com.threerings.presents.client.Client;
|
||||
import com.threerings.presents.net.UsernamePasswordCreds;
|
||||
|
||||
import com.threerings.crowd.Log;
|
||||
import static com.threerings.crowd.Log.log;
|
||||
|
||||
/**
|
||||
* The main point of entry for the Jabber client application. It creates
|
||||
@@ -62,7 +62,7 @@ public class JabberApp
|
||||
Client client = _client.getContext().getClient();
|
||||
|
||||
// pass them on to the client
|
||||
Log.info("Using [server=" + server + "].");
|
||||
log.info("Using [server=" + server + "].");
|
||||
client.setServer(server, Client.DEFAULT_SERVER_PORTS);
|
||||
|
||||
// configure the client with some credentials and logon
|
||||
@@ -96,8 +96,7 @@ public class JabberApp
|
||||
// initialize the app
|
||||
app.init();
|
||||
} catch (IOException ioe) {
|
||||
Log.warning("Error initializing application.");
|
||||
Log.logStackTrace(ioe);
|
||||
log.warning("Error initializing application.", ioe);
|
||||
}
|
||||
|
||||
// and run it
|
||||
|
||||
@@ -32,10 +32,11 @@ import com.threerings.presents.client.*;
|
||||
import com.threerings.presents.dobj.DObjectManager;
|
||||
import com.threerings.presents.net.*;
|
||||
|
||||
import com.threerings.crowd.Log;
|
||||
import com.threerings.crowd.chat.client.ChatDirector;
|
||||
import com.threerings.crowd.util.CrowdContext;
|
||||
|
||||
import static com.threerings.crowd.Log.log;
|
||||
|
||||
public class TestClient
|
||||
implements RunQueue, ClientObserver
|
||||
{
|
||||
@@ -89,7 +90,7 @@ public class TestClient
|
||||
|
||||
public void clientDidLogon (Client client)
|
||||
{
|
||||
Log.info("Client did logon [client=" + client + "].");
|
||||
log.info("Client did logon [client=" + client + "].");
|
||||
|
||||
// request to move to a place
|
||||
_ctx.getLocationDirector().moveTo(15);
|
||||
@@ -97,30 +98,30 @@ public class TestClient
|
||||
|
||||
public void clientObjectDidChange (Client client)
|
||||
{
|
||||
Log.info("Client object did change [client=" + client + "].");
|
||||
log.info("Client object did change [client=" + client + "].");
|
||||
}
|
||||
|
||||
public void clientFailedToLogon (Client client, Exception cause)
|
||||
{
|
||||
Log.info("Client failed to logon [client=" + client +
|
||||
log.info("Client failed to logon [client=" + client +
|
||||
", cause=" + cause + "].");
|
||||
}
|
||||
|
||||
public void clientConnectionFailed (Client client, Exception cause)
|
||||
{
|
||||
Log.info("Client connection failed [client=" + client +
|
||||
log.info("Client connection failed [client=" + client +
|
||||
", cause=" + cause + "].");
|
||||
}
|
||||
|
||||
public boolean clientWillLogoff (Client client)
|
||||
{
|
||||
Log.info("Client will logoff [client=" + client + "].");
|
||||
log.info("Client will logoff [client=" + client + "].");
|
||||
return true;
|
||||
}
|
||||
|
||||
public void clientDidLogoff (Client client)
|
||||
{
|
||||
Log.info("Client did logoff [client=" + client + "].");
|
||||
log.info("Client did logoff [client=" + client + "].");
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,10 +3,11 @@
|
||||
|
||||
package com.threerings.crowd.server;
|
||||
|
||||
import com.threerings.crowd.Log;
|
||||
import com.threerings.crowd.data.JabberConfig;
|
||||
import com.threerings.crowd.data.PlaceObject;
|
||||
|
||||
import static com.threerings.crowd.Log.log;
|
||||
|
||||
/**
|
||||
* A basic server that creates a single room and sticks everyone in it
|
||||
* where they can chat with one another.
|
||||
@@ -30,8 +31,7 @@ public class JabberServer extends CrowdServer
|
||||
server.init();
|
||||
server.run();
|
||||
} catch (Exception e) {
|
||||
Log.warning("Unable to initialize server.");
|
||||
Log.logStackTrace(e);
|
||||
log.warning("Unable to initialize server.", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,11 +28,12 @@ import com.samskivert.util.RunQueue;
|
||||
|
||||
import com.threerings.util.Name;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.data.TestObject;
|
||||
import com.threerings.presents.dobj.*;
|
||||
import com.threerings.presents.net.*;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* A standalone test client.
|
||||
*/
|
||||
@@ -74,7 +75,7 @@ public class TestClient
|
||||
|
||||
public void clientDidLogon (Client client)
|
||||
{
|
||||
Log.info("Client did logon [client=" + client + "].");
|
||||
log.info("Client did logon [client=" + client + "].");
|
||||
|
||||
// register ourselves as a test notification receiver
|
||||
client.getInvocationDirector().registerReceiver(new TestDecoder(this));
|
||||
@@ -89,10 +90,10 @@ public class TestClient
|
||||
three.add(5);
|
||||
service.test(client, "one", 2, three, new TestService.TestFuncListener() {
|
||||
public void testSucceeded (String one, int two) {
|
||||
Log.info("Got test response [one=" + one + ", two=" + two + "].");
|
||||
log.info("Got test response [one=" + one + ", two=" + two + "].");
|
||||
}
|
||||
public void requestFailed (String reason) {
|
||||
Log.info("Urk! Request failed [reason=" + reason + "].");
|
||||
log.info("Urk! Request failed [reason=" + reason + "].");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -102,25 +103,25 @@ public class TestClient
|
||||
|
||||
public void clientObjectDidChange (Client client)
|
||||
{
|
||||
Log.info("Client object did change [client=" + client + "].");
|
||||
log.info("Client object did change [client=" + client + "].");
|
||||
}
|
||||
|
||||
public void clientDidLogoff (Client client)
|
||||
{
|
||||
Log.info("Client did logoff [client=" + client + "].");
|
||||
log.info("Client did logoff [client=" + client + "].");
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void objectAvailable (TestObject object)
|
||||
{
|
||||
object.addListener(this);
|
||||
Log.info("Object available: " + object);
|
||||
log.info("Object available: " + object);
|
||||
object.setBar("lawl!");
|
||||
}
|
||||
|
||||
public void requestFailed (int oid, ObjectAccessException cause)
|
||||
{
|
||||
Log.info("Object unavailable [oid=" + oid +
|
||||
log.info("Object unavailable [oid=" + oid +
|
||||
", reason=" + cause + "].");
|
||||
// nothing to do, so might as well logoff
|
||||
_client.logoff(true);
|
||||
@@ -128,7 +129,7 @@ public class TestClient
|
||||
|
||||
public void eventReceived (DEvent event)
|
||||
{
|
||||
Log.info("Got event [event=" + event + "].");
|
||||
log.info("Got event [event=" + event + "].");
|
||||
|
||||
// request that we log off
|
||||
_client.logoff(true);
|
||||
@@ -144,13 +145,13 @@ public class TestClient
|
||||
// documentation inherited from interface
|
||||
public void requestFailed (String reason)
|
||||
{
|
||||
Log.info("Urk! Request failed [reason=" + reason + "].");
|
||||
log.info("Urk! Request failed [reason=" + reason + "].");
|
||||
}
|
||||
|
||||
// documentation inherited from interface
|
||||
public void receivedTest (int one, String two)
|
||||
{
|
||||
Log.info("Received test notification [one=" + one +
|
||||
log.info("Received test notification [one=" + one +
|
||||
", two=" + two + "].");
|
||||
}
|
||||
|
||||
|
||||
@@ -24,10 +24,11 @@ package com.threerings.presents.server;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.data.TestObject;
|
||||
import com.threerings.presents.dobj.*;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* Tests that the dobjmgr will not allow a destroyed object to be added to
|
||||
* an oid list.
|
||||
@@ -51,7 +52,7 @@ public class DestroyedRefTest extends TestCase
|
||||
|
||||
// when we get the attribute change, we can exit
|
||||
if (event instanceof ObjectDestroyedEvent) {
|
||||
Log.info("The upcoming object added event should be rejected.");
|
||||
log.info("The upcoming object added event should be rejected.");
|
||||
|
||||
} else if (event instanceof ObjectAddedEvent &&
|
||||
toid == _objtwo.getOid()) {
|
||||
@@ -78,7 +79,7 @@ public class DestroyedRefTest extends TestCase
|
||||
// add object one to object two twice in a row to make sure repeated
|
||||
// adds don't result in the object being listed twice
|
||||
_objtwo.addToList(_objone.getOid());
|
||||
Log.info("The following addToList() should be ignored.");
|
||||
log.info("The following addToList() should be ignored.");
|
||||
_objtwo.addToList(_objone.getOid());
|
||||
|
||||
// now that we have both objects, try to set up the reference. first
|
||||
|
||||
@@ -7,10 +7,11 @@ import java.util.ArrayList;
|
||||
|
||||
import com.samskivert.util.StringUtil;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.client.TestService;
|
||||
import com.threerings.presents.data.ClientObject;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* Implements the server side of the TestProvider interface.
|
||||
*/
|
||||
@@ -22,7 +23,7 @@ public class TestManager
|
||||
TestService.TestOidListener listener)
|
||||
throws InvocationException
|
||||
{
|
||||
Log.info("Handling get test oid [src=" + caller + "].");
|
||||
log.info("Handling get test oid [src=" + caller + "].");
|
||||
|
||||
// issue a test notification just for kicks
|
||||
TestSender.sendTest(caller, 1, "two");
|
||||
@@ -35,7 +36,7 @@ public class TestManager
|
||||
ArrayList<Integer> three, TestService.TestFuncListener listener)
|
||||
throws InvocationException
|
||||
{
|
||||
Log.info("Test request [one=" + one + ", two=" + two +
|
||||
log.info("Test request [one=" + one + ", two=" + two +
|
||||
", three=" + StringUtil.toString(three) + "].");
|
||||
|
||||
// and issue a response to this invocation request
|
||||
|
||||
@@ -21,10 +21,11 @@
|
||||
|
||||
package com.threerings.presents.server;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.data.TestObject;
|
||||
import com.threerings.presents.dobj.*;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
public class TestServer extends PresentsServer
|
||||
{
|
||||
public static TestObject testobj;
|
||||
@@ -52,8 +53,7 @@ public class TestServer extends PresentsServer
|
||||
server.init();
|
||||
server.run();
|
||||
} catch (Exception e) {
|
||||
Log.warning("Unable to initialize server.");
|
||||
Log.logStackTrace(e);
|
||||
log.warning("Unable to initialize server.", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user