Commit Graph

48 Commits

Author SHA1 Message Date
Michael Bayne fcedbe90d7 Thread.dumpStack() circumvents whatever logging is configured and writes
directly to stderr. Logging an exception with the associated warning does the
right thing and logs the stack trace via the logging system.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5318 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-08-13 17:35:37 +00:00
Dave Hoover efaea0660c Mark an override
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5276 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-07-30 17:19:58 +00:00
Michael Bayne 725f656197 Fixed a bunch of type safety bits pointed out by the latest version of Eclipse.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5274 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-07-30 12:58:51 +00:00
Michael Bayne ca4c5897fb Tidied up.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5273 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-07-30 09:32:48 +00:00
Tom Conkling 81dc030710 don't lazily create _isStreamableFieldPred
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5272 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-07-30 01:05:23 +00:00
Tom Conkling 7a1ede64af Added a NotStreamable annotation. Streamable objects that have fields annotated with NotStreamable will not have those fields sent over the wire, at least by the default readObject()/writeObject() Streamer methods.
Currently, Streamer will skip fields marked transient for the purposes of the default streaming implementation, but 'transient' is also used by the Java serialization mechanism, and there are instances where a field in a Serializable, Streamable object can't be streamed but should be serialized.

I have a bunch of code to check in related to the game server sending stat updates to the world server, but I'm going to hold off on those changes until I get the go-ahead from the powers that be that this is an acceptable solution to the problem.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5270 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-07-30 00:04:06 +00:00
Michael Bayne 67ce73b61d More style cleanup.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5249 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-07-22 13:39:42 +00:00
Dave Hoover 6b1d65553f And finally, narya gets the imports/overrides/regen love.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5241 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-07-18 23:20:17 +00:00
Michael Bayne 733ec9e5ab Unused import nixage.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5204 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-29 12:38:24 +00:00
Michael Bayne 919112cf88 Switch to new samskivert logging API.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5134 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-27 19:25:38 +00:00
Michael Bayne 0fb090ea52 Let's also make that a warning now that we don't think it's going to happen as
a matter of course on old VMs.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5020 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-23 19:59:07 +00:00
Michael Bayne 9700aa13cd Use a method available since JDK1.1 to determine our innerness and simplify the
logic. If we're inner and we're not static, we have a problem.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5019 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-23 19:58:16 +00:00
Michael Bayne 290d7a9ea1 Freak not out if we fail to determine if our class is local, anonymous or a
non-static member. Pre-1.5 VMs can't do all of these things and Retroweaver
freaks out at runtime when put to the task.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5018 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-23 19:34:22 +00:00
Mike Thomas 4a25cc3f46 If we fail spectacularly in checking localness, let's print out what class is having trouble, since the java libs don't actually do that.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5008 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-21 18:43:30 +00:00
Michael Bayne f017673964 Disallow streaming of non-static inner classes to avoid the inevitable
freakoutery as we try to stream the instance's implicit reference to its
containing class.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5001 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-17 02:48:04 +00:00
Michael Bayne 63db77667a Some type safety, redundant cast removal, and other code hygiene.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4879 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-11-24 19:40:19 +00:00
Michael Bayne 84855f8fe0 Enhanced debuggery, reenabled new streaming bits because now they should really
really work.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4705 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-05-09 01:17:13 +00:00
Michael Bayne ef43b9d41a Re-revamp. I may re-re-revamp later to eliminate the reflection based streaming
altogether as that also solves the "Class.getDeclaredFields() is not required
to return fields in declaration order" problem which has been looming. However,
this should work for now.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4701 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-05-09 00:20:35 +00:00
Michael Bayne 00e24d5ed6 Let's let whoever catches this exception decide if they want a stack trace
logged.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4642 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-03-31 02:38:28 +00:00
Michael Bayne 09f0bee0f3 Yet more header patrol.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4602 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-24 00:39:27 +00:00
Michael Bayne d0d31eb5bf Nixed stray debug line.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4563 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-12 03:40:46 +00:00
Michael Bayne d9089e10d3 Widening, one additional log message added in STREAM_DEBUG mode.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4558 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-12 03:03:51 +00:00
Michael Bayne 54d3bb6496 Missed a spot where getStreamer() was called which motivated further changing
around of the interface (I wanted to automatically call getStreamerClass() for
the caller but that turns out not to be possible when unstreaming so fuck it).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4373 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-09-12 01:09:01 +00:00
Michael Bayne 13bcdf769d Retidied.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4372 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-09-12 00:49:49 +00:00
Michael Bayne 65b14cfdb5 Was using the wrong getDeclaringClass() to get an enum's proper class. Things
are now correct, but unfortunately a little more complicated.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4371 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-09-12 00:47:27 +00:00
Michael Bayne eb3c6ae9cf A particular enum value may actually be a derived class of the declared enum
type, but we don't really want to pollute our class <-> id mapping with a bunch
of extra fiddly enum classes, so we stream all enums as instances of their
declared type and let Enum.valueOf() map back to the custom derived type when
it creates an instance during deserialization.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4370 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-09-12 00:32:06 +00:00
Michael Bayne ac5951eaa1 Finally incorporated Par's Enum streaming support, modified to use the string
value to avoid future compatibility problems if someone saves an object to a
database and then later adds a new enum anywhere but at the end of the list,
thereby changing the ordinals.

If you want maximal network efficiency, don't use enums. For most of what we'll
do with them, it doesn't merit having the future incompatibility hitch of
sending the ordinal.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4369 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-09-12 00:04:14 +00:00
Ray Greenwell c9d262bf64 Just print the exception. If it has a message, that will be printed,
otherwise we'll just get the name. I'm killing StringUtil.getMessage().


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4304 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-08-08 20:06:53 +00:00
Ray Greenwell ca06b47835 Report as useful a message as we can when we have an error.
I was getting an IllegalArgumentException and the message was "null",
so this will at least log the name of the exception.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4263 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-07-12 23:57:14 +00:00
Michael Bayne 33a758dfce The basis of cluster support for Presents servers. All servers in a cluster
make connections to other servers in the cluster and can exchange events (in a
limited fashion).

This is different than Liz's project wherein servers share an oid space and one
can interchangably work with distributed objects from any server. This package
provides a means by which certain services (by default, presence and chat) can
be communicated between servers to allow communication between players
scattered around a bunch of otherwise independent server instances.

This is less general purpose but also less likely to encourage people to write
code that tightly couples multiple servers and then falls over because it
generates gobs of network traffic as events are flung willy nilly behind the
scenes.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4238 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-07-01 00:19:59 +00:00
Michael Bayne 6424adf26d More log fixing. The tools package will move to Nenya.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4215 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-06-23 19:40:55 +00:00
Ray Greenwell bdfecce767 A bit of simplification.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3927 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-03-08 23:21:47 +00:00
Ray Greenwell a0e9f70db3 Cleaned that method up a bit.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3922 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-03-08 01:03:57 +00:00
Ray Greenwell b72ee36b29 While working on Streaming arrays in actionscript I realized that
our streaming system should work with multidimensional arrays: in fact it
kinda already did, if the element type of the outermost array was something
for which we already had a streamer. Thus, int[][] worked, Object[][] worked,
etc. One small method change and now arbitrary multidimensional arrays
will work.

Why bother? Consistency, and the way I'm working on doing even the int[][]
arrays in actionscript supports unlimited dimensions, so why not?


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3921 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-03-08 00:56:23 +00:00
Ray Greenwell 174fa1b9c6 Use PrivilegedExceptionAction to do privileged actions that might throw
an exception.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3856 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-02-15 04:04:24 +00:00
Ray Greenwell 7a64be94f2 Goodbye, NestableIOException.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3788 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-12-20 02:09:18 +00:00
Michael Bayne e438377297 Introspect on our classes in a privileged block so that unsigned code can
call ObjectInputStream.defaultReadObject().


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3662 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-07-25 17:24:25 +00:00
Michael Bayne ac22e65145 Enabled some debug logging when STREAM_DEBUG is activated. Removed custom
String marshaller as a StreamerMarshaller is used for String fields.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3651 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-07-16 01:46:20 +00:00
Michael Bayne afabea71ad Big fat Bernie javadoc cleanup.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3310 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-24 23:08:21 +00:00
Michael Bayne 1f8c4578b7 LGPLed the library. Hello world.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3098 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-08-27 02:12:55 +00:00
Ray Greenwell dec746b983 Use ClassUtil.getFields(clazz)
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3016 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-06-03 15:56:25 +00:00
Michael Bayne ba73cc55df Deal as gracefully as possible if we don't have any data for the final
field or fields of a streamed object. This allows us to add new fields to
the end of a streamable without causing all existing serialized versions
to become unreadable.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2629 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-06-02 17:24:18 +00:00
Michael Bayne 2a554f1569 Added support for object streaming debugging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2395 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-10 17:47:45 +00:00
Michael Bayne 4c39fb3fb8 Log our low-level stack traces when we get them because I've seen at least
one instance of the nested exception failing to log anything useful when
it is reported at a higher level and we're seeing failures in the
low-level streamable decoding code which need debugging.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2087 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-23 00:40:39 +00:00
Michael Bayne f04e98f481 We may be passing Object in directly in which case we have no super class.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2080 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-21 00:44:03 +00:00
Michael Bayne a63d7446dd It turns out that we can make protected and private fields accessible to
the object serialization code which means that we can automatically
serialize said data members. Hooray!


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2075 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-20 23:27:12 +00:00
Michael Bayne cf578a11b5 Log the shit out of everything if we come across an invalid class code in
the object input stream.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2012 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-12-02 22:10:10 +00:00
Michael Bayne 2330afc3cd New object streaming code is born!
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1605 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-07-23 05:42:34 +00:00