Commit Graph

64 Commits

Author SHA1 Message Date
Michael Bayne 5c4ab96880 Styley stylopolis.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5252 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-07-22 14:01:51 +00:00
Michael Bayne c743432676 More style changes.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5248 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-07-22 13:02:13 +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 e41dda3018 Style fixes and import pruning. Beware, CheckStyle is (finally) coming to town.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5240 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-07-18 18:32:59 +00:00
Michael Bayne f043a81ee4 Maps cleanup; inject dependencies into NodeAction instances.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5211 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-29 14:09:54 +00:00
Michael Bayne c2d5b28b39 Make the PeerManager and CrowdPeerManager abstract to ensure that a failure to
bind something to PeerManager.class will result in initialization failure.

A system that uses the peer services needs to extend PeerManager or
CrowdPeerManager with a concrete PeerManager and then
bind(PeerManager.class).to(SomePeerManager.class) to properly satisfy the
dependency.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5171 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-08 20:55:33 +00:00
Michael Bayne 0128f6525a Modify PresentsClient and ClientResolver creation so that we can inject
dependencies into both. Moved the legacy statics into CrowdServer so that at
least Presents can be pure (we should probably eventually move them into
BangServer and PiracyServer and fix everything else). Added some useful manager
references to PlaceManager delegate (_omgr, _invmgr) that handle the majority
of their service needs.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5170 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-08 20:23:49 +00:00
Michael Bayne cfc240fa9c Wait scratch that. I'm apparently feeling schizophrenic.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5167 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-08 15:21:08 +00:00
Michael Bayne f8029e2fff Actually it is handy to have the node record.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5166 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-08 15:20:26 +00:00
Michael Bayne a8e5c3e324 Don't need the record in createPeerNode().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5164 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-08 14:08:58 +00:00
Michael Bayne 8c37ca7bfa Three things:
- Inject the auth Invoker.
- Inject the Authenticator and formalize the chaining authenticator pattern.
- Simplify PeerNode creation and make the PeerAuthenticator a chainer.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5162 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-08 13:04:27 +00:00
Michael Bayne 3aefc93838 Holy fruity beverage Batman! I'm taking the plunge and switching to Guice for
dependency resolution and management. Things are currently in a state of
transition, but the important patterns have been established and I'll aim to
sweep through all of Narya, Nenya and Vilya in the near future and do
everything properly.

Going through the other million-odd lines of code we have scattered across our
various projects that use these libraries is not something I plan to do, so
we'll be maintaining backward compatibility with the old static member method,
though I hope to strive toward eradication of that usage entirely in MSOY while
we still have a fighting chance.

Given that some of our projects will continue to use the static member method
in perpetuity, I'm not going to @Deprecate those fields because that would fill
their logs with so much spam that they'd have to turn off deprecation warnings
which would make life worse for them. So instead we'll settle for the big scary
comment warning people away from the old bits.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5153 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-07 17:44:48 +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 9b9d62558d More unit cleanup.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5109 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-18 11:39:20 +00:00
Michael Bayne 784b087ed0 Stop our peer refresher interval when we are shut down.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5000 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-16 22:22:09 +00:00
Michael Bayne 474ba03a8e Allow clients other than peer clients to be ignored.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4977 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-03-21 00:47:43 +00:00
Michael Bayne 983adf75e5 Nix the wacky arguments thing. Let the caller simply beware.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4885 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-11-28 01:03:49 +00:00
Michael Bayne 69a1d2ec23 Slight change to usage and documentation.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4884 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-11-28 00:47:16 +00:00
Michael Bayne 9e835ff6e9 Added a way to package up an action and data and send it to all appropriate
servers for execution. The class in question must exist on the remote server
but all of our servers are all always running the same code, so this follows.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4882 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-11-28 00:25:23 +00:00
Mark Johnson 1ec7f25ea6 Refreshing the peers seems to often take just over 500ms, so increase the time we wait before logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4833 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-09-28 23:26:42 +00:00
Michael Bayne 400a42930b Return the correct value if we're asked for this node's public hostname or
port.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4829 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-09-20 01:49:56 +00:00
Michael Bayne 52be62ddbf Added a helper method for calling an invocation service method on one or more
remote nodes.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4817 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-17 21:02:44 +00:00
Michael Bayne f90a39207f Created a peer-aware DatabaseConfigRegistry that broadcasts changed runtime
configuration information to other peers so that they all remain in sync.

Also nixed constructor arguments to the peer manager so that it can be created
at server construct time like all other managers and be available for the
twisty maze of inter-registration that takes place during the manager init
process.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4814 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-16 20:53:17 +00:00
Michael Bayne 7fc92f99b1 Be sure not to leave our lock dangling if the wrapped operation fails with an
exception.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4797 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-31 23:33:13 +00:00
Michael Bayne ea501d7083 Automatically register the peer manager as a shutdowner rather than require
that it be shut down manually.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4794 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-31 20:01:52 +00:00
Michael Bayne 3c1c1d1921 We need to restore the remote oid as well before we send the unsubscribe req.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4791 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-27 21:47:50 +00:00
Robert Zubeck 73b7e56563 Fixing a typo that prevented the creation of lock release handlers.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4788 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-27 17:46:10 +00:00
Michael Bayne c2b44deb2d Once we've unproxied an object, we need to remap it into our Client's
distributed object space so that the unsubscribe from the remote server is
properly handled.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4787 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-27 02:38:14 +00:00
Michael Bayne 7a8bb7389a Screw backwards compatibility. We're all about the future.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4786 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-26 20:49:13 +00:00
Robert Zubeck 8275f739c0 Wrapper for peer network operations that need to acquire and release resource locks.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4780 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-23 17:09:08 +00:00
Michael Bayne 9ef330b291 Added applyToNodes().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4778 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-18 22:46:49 +00:00
Michael Bayne 91ffdd810b Name our invokers.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4777 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-18 22:03:17 +00:00
Michael Bayne 6531aa581c Extract client info clearing into a method that can be easily extended.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4775 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-18 21:35:54 +00:00
Michael Bayne 7cf24684a7 Added locateClient().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4771 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-18 06:18:16 +00:00
Michael Bayne 6b67de9fca Looking something up in all the peer node objects is tricky, so let's
encapsulate it into a mechanism that takes care of the trickiness for us.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4770 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-17 22:03:12 +00:00
Michael Bayne f68aa1d6d3 Iterate over a snapshot of the values so that we avoid concurrent modification.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4769 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-17 21:06:09 +00:00
Par Winzell 6c65d51d76 I'm switching PeerRepository over to Depot and it returns Lists, not ArrayLists. I sure wish we could use the List and Map interfaces. It's not like we're suddenly going to surprise the caller by maliciously returning a LinkedList one day, or something.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4768 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-17 20:33:47 +00:00
Michael Bayne 321c3f17e5 Factored PeerNode out of PeerManager as that class was getting complicated and
dangerous with two big inner helper classes. Added the nodeName to NodeObject
and some other handy methods.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4767 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-07-17 01:59:27 +00:00
Michael Bayne 0c448bc92d Update our LAST_UPDATED column every minute while we're alive so that if we
lose connection with a peer for any reason, it will notice that we're still
alive and reconnect.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4732 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-06-13 23:36:25 +00:00
Michael Bayne 2fead8208c Let's not confuse terminology between one server proxying for another server
and the ProxySubscriber mechanism by which the server proxies for the client.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4730 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-06-13 22:41:41 +00:00
Michael Bayne c365afa2fc Rejiggered the way things are handled when using a Client to proxy events from
another server. The PeerManager needs both to rewrite the oid of the events
before dispatching them and to assign an eventId to them so that they will not
be filtered by PresentsClient when deciding whether or not to send them along
to its client. Also fixed compound event dispatch in the process. Now proxy
subscribers will be notified once of a compound event rather than of each
individual internal event.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4729 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-06-13 22:37:53 +00:00
Andrzej Kapolka d3d841e3e5 Some fiddling to handle cases where peers become connected after having
been disconnected (in which case there may be conflicts in lock 
ownership) or are connected asymmetrically (A is subscribed to B, B is 
not yet subscribed to A).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4674 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-04-24 19:47:12 +00:00
Michael Bayne 3b4c331e0b Log when we're calling logoff() for our local peers to see if this is or isn't
happening on the hanging dev server.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4604 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-27 00:46:32 +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 c25024f497 Move some low-level object access control into Presents from Crowd (default all
objects to non-modifiable, restrict client object subscriptions to the client
in question). Modified Peer code to not log a warning when a peer is not online
in an expected way (not listening for connections).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4598 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-23 19:41:30 +00:00
Andrzej Kapolka 2376e86f3f Forward events to proxies. Fixed NPE, changed account names used in
peer sign-on to be the connecting server's node name.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4580 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-15 00:26:52 +00:00
Andrzej Kapolka 32d99abe15 Missed a couple lines.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4578 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-14 22:20:09 +00:00
Andrzej Kapolka 0fa6d2f233 Keep track of node subscribers (and lock action ratifiers) by their
client oids.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4577 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-14 20:35:11 +00:00
Andrzej Kapolka 51fed0676e Use the number of subscribers to determine how many responses to expect.
Take the lock immediately if there are no subscribers.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4576 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-14 02:30:37 +00:00
Michael Bayne ebc99935d5 If we're going to do this, I guess we're going to do it properly. Nixed the
notion of a global group (though we implicitly define one in InvocationCodes)
added a mechanism for directors (which generally handle the client side of
invocation services) to register their interest in bootstrap service groups so
that the whole goddamned complex business can happen magically behind the
scenes.

If you instantiate a director, it will automatically register interest in the
service group it needs and everything will work. If you don't use the director
code, you don't get the services and you can safely exclude all of that code
from your client even though the services are still in use on the server (and
presumably used by some other types of clients).

This is going to break all the builds, which I'll soon fix. Then I'll go write
all this in ActionScript. Yay!


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4552 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-11 01:17:30 +00:00