Commit Graph

4029 Commits

Author SHA1 Message Date
Jamie Doornbos 147e849cbb adding missing license header
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5049 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-08 19:07:30 +00:00
Jamie Doornbos 98bb871e6d Fixed code generation for existing msoy services
* Created concept of a pattern for transforming imports rather than have some
  methods assume a suffix is provided and others assume a prefix
* Leave full array types in import set initially so that they can be dealt with 
  differently by different code exporters
* Added more primitive types and array types for action script marshallers, 
  including conversion to TypedArray
* Add listener marshaller mungings for action script marshallers' imports
* Added handling for array imports for action script services


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5048 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-08 19:06:32 +00:00
Jamie Doornbos 430b23a5bb regenerated services, notice actionscript stuff has the most changes
(I just noticed marshallers are importing themselves but the flash compiler 
doesn't seem to mind, so committing now)



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5043 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-06 22:54:58 +00:00
Jamie Doornbos 2ecda5b89a Forgot to check the receivers, needed to do the standard removeGlobals call
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5042 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-06 22:48:36 +00:00
Jamie Doornbos 61b1f23303 Narya.abc work - refactored GenServiceTask import mechanism in order to generate
clean action script files with no unnecessary imports
* New class ImportSet to facilitate the operations being performed manually
  throughout the code. Also removes the need for rawimports
* Threaded ImportSet through all places where imports and rawimports were used
  and removed magic parameters to control import generation
* Added an ImportSet instance to ServiceListener, this was key to the action 
  script fixes
* Moved all the import tweaking and munging logic into the generate* methods
  and made specific to code being generated (removed overreaching stuff
  from ServiceMethod, this was part of the problem)
* Removed blanket imports from tmpl files
* Removed unused methods
* Fixed tabs from last commit
* Quick and dirty script to check for unused imports


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5041 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-06 22:44:36 +00:00
Par Winzell 5924aac198 Running genreceiver and genservice with Jamie's spiffed-up generators.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5037 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-06 16:59:04 +00:00
Jamie Doornbos bf501313f1 Narya.abc work - get rid of unused imports in generated service targets:
* ServiceMethod import options:
  - Made argument type imports ignore first N args (0 for old behavior)
  - Made marshaller listener imports optional
* Added InvocationTask._verbose and several dumps of current imports to help 
  track down future superfluous imports
* Made the import of ServiceListener method arguments' types optional
* Wrapped up most of processService code into protected inner class 
  ServiceDescription and made configurable:
  - Optional import of the types of the first arguments of the service methods
  - Optinoal import of the types of listener method arguments
* Changed generate methods to take the service class and construct their own
  local ServiceDescription configured for their target
* Removed global import of service class and do it explicitly where required
  (via method addServiceImport)
* Made some imports conditional
  - InvocationResponseEvent for mashallers only if service has some listeners
  - InvocationException for providers only if service has some methods with 
    listener arguments
* Removed unused variables and imports


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5036 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-05 22:53:31 +00:00
Jamie Doornbos 3d65f679e8 Fixed I/O in BureauRegistry and removed synchronization
* Keep an Invoker member
* Added internal Launcher class to run ProcessBuilder.start on the invoker 
  thread because it is blocking
* Removed synchronized from methods, all ooo-servers are single threaded, 
  hurray!


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5033 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-30 18:27:45 +00:00
Jamie Doornbos e74035a05c Bureaucracy smoke test and resulting bug fixes
* Added RegistryTester smoke test which randomly creates and destroys agents 
  in batches
* Fixed bug where correct agent id was never making it to client
* Implemented Bureau.toString (+refactored summarize method)
* Fixed nasty bug due to my assumption that SafeSubscriber =~ Subscriber, they 
  are in fact completely different


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5032 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-30 17:55:40 +00:00
Jamie Doornbos 490b5b9764 Bureaucracy: Fixed my TODO about using google's Maps and Sets utils
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5031 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-29 19:02:13 +00:00
Jamie Doornbos f41233c5ac Bureaucracy review updates and hello world test
* Fleshed out client-side Agent class, made abstract
* Delegate the creation of the bureau director to subclasses of BureauClient
* Moved BureauDirector's BureauReceiver and Subscriber implementations to 
  anonymous classes that delegate to protected methods.
* Use SafeSubscriber
* Added new service method for notiyfing the server when the creation of an
  agent fails so that the registry is not perpetually waiting
* Made BureauCredentials more conformant
* Made BureauRegistry respond properly to client logging off
* Got rid of superfluous uses of safeToString
* Changed Launcher to CommandGenerator and now use ProcessBuilder and 
  copyMergedOutput
* Changed bureau process parameters to server name and port instead of URL


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5030 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-29 18:34:51 +00:00
Charlie Groves 938d7f5994 Share a single MethodFinder between all instances of a subclass of PlaceManager as they can be large enough constitute the bulk of a PlaceManager
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5029 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-29 18:07:04 +00:00
Jamie Doornbos 74dac11f97 Bureaucracy
* Fixed signature of Receiver methods
* Implemented create/destroy mechanism and bootstrap request in BureauDirector
* Added BureauContext class to expose bureau information on top of usual 
  presents stuff
* Added BureauContext implementation in BureauClient
* Added code to kick off the director when the client logs on
* Added credentials for a bureau logon, which is just a token passed to 
  command line launcher
* Added concept of bureau types to distinguish between executable and command 
  line arguments; includes interface BureauRegistry.Launcher
* Implemented backend for the registry


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5027 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-28 18:34:57 +00:00
Jamie Doornbos b10cc3643d Removed @Override on interface methods.
the deployment build must be using stricter options (need to find them so I can replicate these issues locally in the future)

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5026 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-25 20:39:51 +00:00
Jamie Doornbos e7374452cd Skeleton for bureau/agent architecture (https://wiki.earth.threerings.net/display/whirled/The+Bureacracy)
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5025 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-25 20:22:21 +00:00
Michael Bayne 249c4bb42d Nixed some now redundant casts.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5021 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-23 20:00:09 +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
Ray Greenwell bf55267dac Let's handle the common case first here too.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5014 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-23 17:35:09 +00:00
Andrzej Kapolka 630d74a5eb Added static methods as in EnumSet, folded in updateSize since it
was only called in one place.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5012 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-23 03:36:35 +00:00
Andrzej Kapolka 86e09be9c6 Added a StreamableEnumSet class (not actually derived from
EnumSet, because Java's implementation of that is private).  The 
performance could conceivably be improved; Java uses two 
implementations, one using a single long to store the element 
flags (for enumerated types with 64 or fewer constants) and one 
using an array of longs (for types with more than 64).  This uses 
an array of bytes.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5011 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-23 02:47:14 +00:00
Michael Bayne 4328cc7875 Yohoho needs to replace the auth response data on the fly. Allow it.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5010 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-22 21:23:37 +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 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
Charlie Groves 1c4cfe501f Delay notifying the client about the under ass rug yanking until we're in finishResolved in case UserChangeListener.changeReported performs a long operation off the omgr thread and allows the client to respond before _clobj has actually been switched
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4997 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-11 21:04:48 +00:00
Charlie Groves b65487f318 Cut the number of times a service class needs to be specified to two
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4993 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-10 01:18:32 +00:00
Michael Bayne b690315196 It's a glorious new year.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4989 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-05 22:46:04 +00:00
Michael Bayne 4c5fc71417 Annotations for documenting methods and classes as "distributed object event
dispatch thread only", "blocking thread only" or "callable from any thread."

As the comment says, some day we'll look into enforcing these annotations with
some bytecode rewriting.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4988 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-04-05 22:06:59 +00:00
Michael Bayne 7853f2fb94 Log the _username instead of the _clobj which might go away.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4985 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-03-29 17:53:56 +00:00
Charlie Groves c7126f07d5 The transition needs to happen in ConfigRegistry so it can reserialize the object in its new format, otherwise we're just writing the same String back out to the db
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4982 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-03-27 21:18:26 +00:00
Charlie Groves c50e78030c * Allow subclasses of ConfigRepository to create the ObjectInputStream used to
read in serialized config values.  
*  Use a transitioning flag in DatabaseConfigRegistry to indicate that it
   should immediately write out config values after reading them in.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4981 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-03-27 01:51:15 +00:00
Dave Hoover 4d77995e06 Store off a reference to the interval that generates our server reports so that subclasses can play with it if they want.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4979 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-03-24 21:11:30 +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
Mike Thomas 6e0bd68148 Roll back the interrupt() yet again - 1) it didn't fix the problem we were trying to fix and 2) it was causing problems with logoff.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4968 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-03-10 17:20:03 +00:00
Mike Thomas 1076052701 Remove the temporary debug logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4967 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-03-08 01:34:42 +00:00
Mike Thomas b097e46637 Need a default constructor visible to our descendants.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4965 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-03-08 00:35:07 +00:00
Mike Thomas 4fabfcf0f3 Resort to adding some temporary logging printouts to BlockingCommunicator to figure out what's keeping the reader thread from being shut down.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4964 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-03-07 23:53:19 +00:00
Mike Thomas 0af0ce8469 Re-instate the interrupt() but setup some additional exception handling so we don't spew to the logs unnecessarily due to this.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4962 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-03-07 20:09:13 +00:00
Mike Thomas 69646f624b Roll this back - calling interrupt() in this way caused the other end's writer to get fairly upset.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4961 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-03-06 21:43:08 +00:00
Michael Bayne d153a06aa2 Reinstate the kick in the pants for the reader thread. Previously we relied on
the LogoffRequest being received by the server which resulted in the server
closing its end of the socket which resulted in the reader being woken up to
hear that its socket was closed and then it exited. We'll just have it exit
immediately. It's possible that messages in transit to the reader that would
have been read prior to full shutdown will now be dropped instead of delivered,
but the client has already requested to logoff, so they can't really care about
additional messages coming from the server.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4960 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-03-06 19:14:19 +00:00
Michael Bayne 8a745b30e0 Listen for SIGTERM as well and gracefully shutdown in that case.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4959 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-03-05 23:28:28 +00:00
Mike Thomas e8b5d41fb8 Split out the way we handle the preferred port so we can override that.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4958 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-03-05 19:09:36 +00:00
Dave Hoover 0b068d5189 You know, generifying that correctly is actually a big scary tunnel of dealing with
our generated services & whatnot, so that's a much deeper rabbit hole than I was 
thinking when I just did that one big, so I'm going to leave that well enough alone
for now instead of half-assing it.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4949 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-03-03 22:11:45 +00:00
Dave Hoover 8c5e04aac5 Generify.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4948 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-03-03 22:06:49 +00:00
Ray Greenwell f52f686f19 Use the enhanced for-loop.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4943 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-02-21 02:30:26 +00:00
Charlie Groves 8a7f4c4121 Clarify that SetListeners get all Entry events, not just the ones for a particular set
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4939 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-02-19 23:05:30 +00:00
Charlie Groves 7564f88796 Expose the type on Entry* events to SetListener and SetAdapter
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4938 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-02-19 20:40:09 +00:00
Dave Hoover 4f5d065405 Access this static method in a static way.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4928 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-01-31 21:26:37 +00:00