Commit Graph

238 Commits

Author SHA1 Message Date
Michael Bayne 10df7639b2 Let's test and set _marshallers in the same place, and add a comment explaining
our no synchronization at the cost of possibly doing some trivial extra work.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6633 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-26 23:10:10 +00:00
Mike Thomas 90e395c7bf Instead of syncrhonizing, Ray suggests just setting the shared member variable last. This should also work for our purposes and saves the overhead of the actual synchronization.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6632 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-26 22:43:39 +00:00
Mike Thomas a7334345fd We need to synchronize here. Otherwise, when we could be in the middle of initializing our marshallers, perhaps for another client on the same JVM, and continue on with our streaming thinking our marshallers are ready to go, only to find that they are, in fact, not yet ready to go.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6631 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-26 22:24:45 +00:00
Michael Bayne b4e8609a95 PresentsConnection does not check that its handler is non-null before
processing messages, so let's put a (logging) NOOP handler in place when we
disconnect it from the PresentsSession.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6629 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-20 23:31:49 +00:00
Andrzej Kapolka 69f8f4ef88 Break sendSpeak out into a separate method so that we can override it.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6628 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-20 23:30:12 +00:00
Andrzej Kapolka ca82921db0 Clear the handler reference when we replace the connection. For some reason,
it seems like we're still getting messages from old connections.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6627 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-20 04:56:48 +00:00
Andrzej Kapolka 179bd880c6 I was wondering why the connection ids were all over the place.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6626 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-20 03:20:14 +00:00
Andrzej Kapolka 2a5da18f20 Allow customizing the ServerSocketChannelAcceptor to configure the socket
differently (specifically, we want to enable SO_REUSEADDR in Spiral Knights).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6625 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-12 01:23:53 +00:00
Charlie Groves 7d9366a0d2 Add isEmpty so I don't keep fucking up when I assume DSet is a Collection
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6620 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-09 01:31:23 +00:00
Andrzej Kapolka 018823edf6 I'm having a devil of a time figuring out why there are still subscriptions
lying around when the client reconnects.  Let's try just clearing them out
again on resumption.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6619 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-08 03:30:13 +00:00
Andrzej Kapolka 0765897bcc We're getting datagram PONGs on resumed connections that haven't yet sent
datagram PINGs.  Let's make sure that the connection to which we're sending
the pong is the same one from which we received the ping.  Ping, pong, ping,
pong.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6618 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-08 02:38:49 +00:00
Jamie Doornbos b74952a097 Allow final classes to be streamed too
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6616 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-07 04:42:14 +00:00
Charlie Groves 807111d985 InvocationResponseEvent is no longer used for listeners
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6615 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-07 00:49:13 +00:00
Michael Bayne 300df7a843 Reference the proper packages here.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6614 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-06 21:56:45 +00:00
Andrzej Kapolka e318cd6697 Oops, SimpleStreamableObject handles toString.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6607 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-06 03:02:25 +00:00
Andrzej Kapolka cd63a86bff This got skipped when Tuple<String, Integer> became DObjectAddress, leaving
us with lots of "Requested to clear unknown proxy" warnings in Spiral
Knights.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6606 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-06 02:59:54 +00:00
Jamie Doornbos f3d6712cd2 Fixed some more eol issues. genservice and gendobj work for me now.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6605 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-05 23:33:29 +00:00
Charlie Groves c5a098119f Use the convenience creation methods on ObserverList
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6604 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-05 21:01:02 +00:00
Jamie Doornbos ddb30e640e Allow session observers to hook into the part of the session lifecycle before the session
subclasses start nuking things, but once it is known that it will end.

It always bugged me in msoy that the session subclass has to do this (poorly). Seems patently
observer-ish. This fix has almost no runtime overhead and is backwards compatible. The name
isn't great, but I was leaving room for more methods in there should someone else find it
useful, such as sessionWillStart or even clientObject[Will|Did]Release.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6603 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-05 17:46:29 +00:00
Mike Thomas 1d3b40c4dc Various generics/typesafety bits.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6602 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-05 17:35:59 +00:00
Jamie Doornbos cae3a3f1b9 Support converstion of java enum to com.threerings.util.Enum as part of actionscript streamable conversion.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6600 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-04 21:11:58 +00:00
Jamie Doornbos 7120c9c292 Fixed conflict in generated source merge when using native eol-styles by allowing an optional CR before the LF ($ here did not work for some reason)
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6599 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-04 20:15:48 +00:00
Michael Bayne 8c740b8353 Decided to switch to using setOld{Entry|Value} instead of having two
constructors. Fixed ElementUpdatedEvent along the way.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6590 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-02 23:25:10 +00:00
Michael Bayne 03576f00ee I certainly shouldn't have said that it was illegal! Gah, it's too hot today.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6589 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-02 06:07:48 +00:00
Michael Bayne 871409e060 The zero arg ctor must be public, and I'm making the other ctor public because
it's totally wacky to have the ctor you shouldn't use, be public, and the one
you should, not.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6588 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-02 05:24:35 +00:00
Michael Bayne 17dc26fe52 More hackery preservation.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6587 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-02 04:04:00 +00:00
Michael Bayne 63c967d8d2 We can't allow the primary ctor to be called for EntryUpdated/RemovedEvent
because that will overwrite the hackery we do with _oldEntry. Oh hackery, how
we love you so.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6586 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-02 04:02:12 +00:00
Michael Bayne b85a7d71a5 Fiddlesticks. We can't keep the deprecated constructor in here because that
breaks streaming. Everyone will have to regenerate their services. Sorry! If
only I hadn't hardcoded the insertion of the constructor in the first place,
this would have all been nicely behind an abstraction boundary. It will be once
the services are regenerated.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6584 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-02 01:03:07 +00:00
Michael Bayne 1203c59588 Added a static method for concise condition requirey in invocation services.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6583 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-02 00:48:01 +00:00
Michael Bayne 248795ba57 Handle service methods with forall types.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6582 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-02 00:47:50 +00:00
Michael Bayne fc7706c79d Get the transport specification out of the construction path, since it's not a
streamed property of the event. It turns out to be cleaner to just set it in
the places where we know that we want a specific transport anyway.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6581 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-02 00:01:46 +00:00
Michael Bayne 22330e955b The CompoundEvent needs a zero-arg ctor, as its non-zero-arg ctor does lots of
crazy stuff.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6580 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-01 23:22:10 +00:00
Ray Greenwell 96b7feb7f2 Keerist, that doesn't even compile.
I'll let mdb sort this out.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6579 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-01 23:17:00 +00:00
Ray Greenwell 21105cb8fa Thumper's mom's advice is echoing through my head right now.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6578 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-01 23:14:01 +00:00
Michael Bayne e3d0a81a2c Ray has convinced me that the zero-args constructor is less weird. Though I
think that's probably just because we're used to it.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6577 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-01 22:32:37 +00:00
Michael Bayne eb37356f0c I'm not sure what's worse, a weird extra constructor for use when
unserializing, or a weird alternative code path in the main constructor when
unserializing.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6576 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-01 22:19:06 +00:00
Michael Bayne b986464ee7 Take advantage of our new "one constructor to rule them all" capabilities in
various base classes. This allows us to use final fields in some cases, which
I've done (though our naughty penchant for mutation forced me to roll back a
bunch of other spots where I would have liked to make fields final).

This is going to break a few things in dependents, because said dependents will
have zero argument constructors of their own which will need to be removed.
I'll be tracking those down and cleaning them up as build failures provide me
with infos.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6575 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-01 22:06:42 +00:00
Michael Bayne 61de392df9 If we find our zero args constructor, we're done. Don't let our eyes wander
over to those other luscious constructors.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6574 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-01 22:04:05 +00:00
Michael Bayne 56eeeb128d Allow any Streamable class to use the "we'll call your single non-zero-argument
constructor with zero/null values and then overwrite any fields initialized
with them immediately afterward" approach. If a Streamable has a zero-args
constructor, that is still used, so all the existing Streamable classes will
still function exactly as before. But new classes (or old classes undergoing
scrutiny) can opt to reduce their boilerplate as long as they know they cope
with the zero/null-valued constructor call.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6573 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-04-01 21:34:01 +00:00
Andrzej Kapolka 57d5d4ef0b As with the messages, turn this into a method so that we can override it.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6572 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-31 23:25:07 +00:00
Andrzej Kapolka 301cd0d885 Changed the way that peer messages sent/received are tracked so that we can
customize the tracking in a subclass.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6571 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-31 21:00:57 +00:00
Mike Thomas af239ad733 Remove some @Overrides that were for things that were implementing an interface method, not overriding a base class method - this is a 1.6ism.
Also, add some @Overrides that were missing on things that were overriding a base class method.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6570 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-31 18:28:32 +00:00
Mike Thomas b42af5855f Instead of forcing PeerManager's view of the architecture (that peer stuff shall be accessed via the Main Invoker) on the developer, let's mark the peer invoker uniquely so that it can be run elsewhere. In order to maintain backwards compatibility, this got a little weird in the organization of PresentsModule doing its default binding. If the new binding went in bindInvokers() where it theoretically belongs, anyone who is already overriding bindInvokers() (and not calling super, cuz this is how things work) would not be binding PeerInvoker at all and would be confused.
If we /didn't/ care at all about backwards compatibility, my preferred approach would have been to have the invoker for PeerManager injected in the constructor instead of as a field such that said constructor could be overridden and the invoker be injected with a different annotation.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6569 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-31 18:07:15 +00:00
Ray Greenwell 5d4ed6636b Resulting, from projectx.
RFC. I realize I need to add a lot of examples to the documentation.
The biggest win here is only needing to learn the ins and outs of
this one class, and using it everywhere for your listening/chaining needs.

Please, let me know what you think.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6568 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-31 00:09:14 +00:00
Andrzej Kapolka 194664eea9 Need to copy the value, not the reference, for peerMessagesIn.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6567 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-30 22:26:05 +00:00
Jamie Doornbos c2b21f83fa Just fixing some comments that confused me a little
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6566 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-30 17:52:27 +00:00
Ray Greenwell 7888fa376e No-op tweak.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6565 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-30 04:12:00 +00:00
Ray Greenwell 56155507d8 At some point a blank initializer snuck in here,
wearing the camouflage of being an empty method body.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6564 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-30 03:54:56 +00:00
Ray Greenwell a36030d8a5 Charlie's change violates the new design, which is that we figure out
how we're going to stream a class and then create the right streamer for it.
Using the ClassStreamer for an interface and then not doing any of the 
ClassStreamer stuff means: don't use a ClassStreamer.

I went in here intending to find or create a dummy Streamable streamer that
all interfaces could share...

But, as it turns out, non-final arrays don't need a delegate streamer, so I can
just remove that and interface types will never create a Streamer.
(Interfaces can never be final.)

So: the problem just goes away and everything gets cleaner.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6563 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-30 03:53:17 +00:00
Charlie Groves cacd08b3fd If there's an array of an interface that implements Streamable on a Streamable, we created a Streamer for it. We throw a RuntimeException when we don't find a constructor, so skip our init in creating Streamers for interfaces
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6561 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-30 02:54:47 +00:00