Commit Graph

6763 Commits

Author SHA1 Message Date
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
Ray Greenwell 0f5bc2e813 Added a test for an array of an interface that is Streamable.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6562 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-30 03:47:28 +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
Michael Bayne d4b2999c91 Initialize our constructor separately from our marshallers, so that sneaky
classes that rely on the marshallers never being initialized don't break.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6560 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-30 01:17:39 +00:00
Michael Bayne 54c8226ea2 As Andrzej points out, this injected member should be transient. But oddly, the
original source code did not list it as such:

-        protected Name _user;
-        @Inject ChatHistory _chatHistory;
-    }

I wonder whether it worked...


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6559 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-30 00:53:02 +00:00
Michael Bayne 8f5af330c6 Let's do this delayed marshaller initialization slightly differently, so that
only CustomClassStreamer needs to know about it.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6558 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-30 00:45:38 +00:00
Andrzej Kapolka d0bc9da2b5 Calling createObject requires initialization, else we get an NPE.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6557 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-30 00:38:27 +00:00
Michael Bayne c55279a211 Converted some static inner classes into anonymous inner classes, yielding
improvement in locality of code and reduction in LOC.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6556 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-30 00:32:47 +00:00
Michael Bayne b759128425 With a magestic legacy as long and historied as Presents, nothing is ever easy.
We need to support legacy closures that have multiple constructors, one of
which will be a zero-argument constructor. All of the existing static inner
classes that extend NodeAction/NodeRequest will be such legacy classes. Whee!


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6555 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-30 00:14:22 +00:00
Ray Greenwell 73ef57ecc9 Guava: there's a class for that.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6554 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-30 00:01:48 +00:00
Michael Bayne 87c36ebf67 Improvements in comments.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6553 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-29 23:56:36 +00:00
Michael Bayne 3291089b8c Jumped the gun there a little. We need to be sure not to filter out the
synthetic val$local fields that get inserted, only the this$outer field. And we
need to pass "zero" values for val$ fields to the synthesized constructor.

This means that closures cannot have more than one constructor, but since
they're anonymous inner classes, they necessarily have only one constructor, so
we should be fine.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6552 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-29 23:55:11 +00:00
Michael Bayne 10bea22f14 Made our node action and request into streamable closures, and removed the
warning about having to extend them with static inner classes.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6551 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-29 23:30:23 +00:00
Michael Bayne 064fbe425a Added support for "streamable closures". The idea with these are that the
streaming mechanism will quietly gloss over the funny little outer class
reference stuffed into your closure as long as you promise not to use it
(because it's going to be null on the other side of the wire).

This will allow us to write:

_peermgr.invokeNodeAction(new NodeAction() {
    ...
});

which we presently have a big fat warning against, since it didn't work until
about 30 seconds from now.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6550 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-29 23:28:26 +00:00
Michael Bayne 7c07bfcedc register() already puts our mapping in the _handlers table.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6549 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-29 20:02:00 +00:00
Andrzej Kapolka 6dc165f911 Fixed misplaced parenthesis.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6548 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-23 02:12:36 +00:00
Charlie Groves 34f0f9ab8d Unused imports
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6547 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-23 01:46:55 +00:00
Andrzej Kapolka 94c89e390c Include the longest elapsed time in the profile (not too useful if you profile
from the beginning, but useful if you clear the profiles in order to record
over a brief interval).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6546 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-23 01:40:08 +00:00
Andrzej Kapolka a1013e66bf Provide a means of setting the unit profile sampling frequency.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6543 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-22 22:36:34 +00:00
Andrzej Kapolka e9bbdd2c4b Use the getIntervalClassName method to identify intervals that have been
cancelled.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6542 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-22 22:24:34 +00:00
Charlie Groves 74b598fc02 Add a main to PolicyServer that binds on the master port by default
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6541 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-22 07:09:43 +00:00
Mike Thomas c4a53bbbaa Explicitly handle the other cases of the enum in the switch so it's clear we mean to do nothing.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6540 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-18 21:41:42 +00:00
Andrzej Kapolka 30b04ce54e Revert relationship bits on consultation with MDB.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6539 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-17 23:10:52 +00:00
Mark Johnson a7c4b2a949 - Allow you to optionally reload the global messages bundle when changing your locale
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6538 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-17 01:33:53 +00:00
Andrzej Kapolka fccd605b9f The very beginnings of support for different peer topologies: instead of
having every node connect to every other, we want to support having (for
example) nodes connect to a "super-peer" that distributes updates to its
children.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6537 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-17 00:54:24 +00:00
Andrzej Kapolka 03e58a28e1 We register as a client observer when we start up; we need to remove ourselves
when we shut down.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6536 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-15 23:48:36 +00:00
Michael Bayne a1398a7d65 We should probably have a gencheck on the CPP files as well.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6535 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-15 18:21:55 +00:00
Michael Bayne a3c0b0bbdd Put our headers on the CPP files as well. This also fixes a problem where the
headers on the associated Java files were being stripped.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6534 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-15 18:20:17 +00:00
Michael Bayne 217927de2b A variety of javadoc fixes.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6533 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-15 18:17:09 +00:00
Michael Bayne 0a15a1e09a Avoid generating {@link Outer.Inner}, as Javadoc does not support such links.
Bug 4464323 was filed 10 years ago, bringing this to Sun's attention, and has
been acknowledged as a known bug. Apparently this has not annoyed anyone on the
Java team enough to merit fixing. Sigh.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6532 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-15 17:50:09 +00:00
Michael Bayne de7254ac5b These need to reference built.classpath as there is no longer a
compile.classpath.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6531 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-15 17:42:30 +00:00
Andrzej Kapolka b205f60d1c Use the hostname stored in the Client rather than the IP address in case we're
using a proxy, in which case we'll send the non-proxy hostname in the
bootstrap data.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6530 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-10 23:18:22 +00:00
Ray Greenwell 4acf173bf3 Clarify.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6529 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-09 04:10:29 +00:00
Ray Greenwell fb39890cbd Refine and elaborate this warning message.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6528 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-08 22:36:39 +00:00
Ray Greenwell 5a3f7bbdc7 Tidy this up by making it recursive.
Deeply multidimensional arrays are rare.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6527 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-08 22:30:19 +00:00
Ray Greenwell dd43d89028 A few extra lines of code to support a fourth enum policy: name only.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6526 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-08 18:30:50 +00:00
Andrzej Kapolka b4b409caa3 Provide an option to show all command aliases in the usage text and only
show the first alias in the big list.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6525 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-08 04:57:43 +00:00
Ray Greenwell 08f6dbefa9 Comments.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6524 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-08 01:08:33 +00:00
Ray Greenwell 55f031304c Let's rename those enum policy constants based on how they work,
not whether they're old or new.
OLD -> NAME_WITH_BYTE_ENUM
NEW -> ORDINAL
NEW_WITH_BYTE_ENUM -> ORDINAL_WITH_BYTE_ENUM


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6523 542714f4-19e9-0310-aa3c-eee0fc999fb1
2011-03-08 01:01:06 +00:00