Commit Graph

25 Commits

Author SHA1 Message Date
Michael Bayne afad7dd444 Added support for streaming List and ArrayList natively. A List will be
unmarshalled into an ArrayList on the receiver. Along the way, I improved
support for generic types as arguments to invocation services (which required
one unfortunate "sweeping" warning suppression, but since this is in generated
code, I think we can be sure it won't be doing anything untoward).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4375 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-09-19 00:31:50 +00:00
Andrzej Kapolka 9607d33093 Suppress warnings in generated code.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4330 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-08-17 23:39:21 +00:00
Michael Bayne 8afd0316ec I decided to go hog wild and clean up all the type use in Presents which
required some serious bending and folding of the generic type system, but for
the most part we managed to avoid any mutilating. The gendobj task now
generates properly typed "addToXXX" and "updateXXX" DSet methods based on the
parameterized type of the DSet. This might cause unrecompiled code to break,
but I don't think there are many cases in the base toolkit where people call
DSet adders or updaters. We'll see and I'll add backwards compatibility
versions for cases where we need them to support GG games (everything else we
can just recompile).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4245 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-07-05 00:55:05 +00:00
Michael Bayne 9e0eac5944 Handle non-Joonix file paths properly.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4197 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-06-17 05:07:26 +00:00
Ray Greenwell 79c6427c21 StringBuffer -> StringBuilder.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4191 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-06-13 22:42:20 +00:00
Michael Bayne 07ee188d82 Properly handle parameterized DSet fields in DObject declarations. Other
parameterized types will be easy to add, but I've not yet had occasion to use
them. We're all about "just in time" support.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4165 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-05-31 04:16:04 +00:00
Ray Greenwell 26c928fc45 Use the valueOf factory methods pretty much everywhere.
These are the preferred way to get instances of Boolean, Byte,
Short, Character, Integer, Long, Float, and Double object.
It's always made sense for Boolean objects, and with 1.5 these factory
methods were blessed as the proper way to get instances unless one
absolutely needed a distinct object.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4145 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-05-24 01:24:24 +00:00
Ray Greenwell 869641562d Removed unneeded line.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4139 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-05-23 21:34:40 +00:00
Michael Bayne 5a2583470c Brought code in line with changes to Samskivert. I have not started to
genericize Narya data structures, nor make the existing code type safe. That's
going to be an extremely large project.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4007 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-04-10 08:59:30 +00:00
Michael Bayne 18418122ea More fixy fixy with the commas.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3916 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-03-06 22:10:05 +00:00
Michael Bayne 1effaf4ad9 No comma if we have no args.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3915 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-03-06 22:01:31 +00:00
Michael Bayne 17fdaa7c0d Rewrote the InvocationReceiver generation process in Java as an Ant task. I had
previously redone the InvocationService and DObject generation tools but not
the InvocationReceiver tool.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3913 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-03-06 21:50:23 +00:00
Ray Greenwell 4cb18bd5ab Wrote code to help automatically detect bugs.
Have invocation marshallers track whether someone ever ended up responding
to the client: if they get garbage collected without ever doing so
(and they're not the base class InvocationMarshaller, which can only report
errors), log an informative error message.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3792 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-12-21 02:10:38 +00:00
Michael Bayne 596d2a4708 blank() -> isBlank().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3749 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-11-09 04:00:16 +00:00
Michael Bayne e52758ef2c Allow the specification of legacy services for which provider interfaces should
not be generated. Cleaned up the generated provider interface formatting a bit.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3715 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-09-27 23:05:40 +00:00
Michael Bayne 2d9dffc7ec Automatically generate the provider interface when generating the FooMarshaller
and FooDispatcher. This means we will no longer be able to make FooProvider a
class that directly handles FooService methods, but the savings in confusion
for first time users of the framework will more than make up for the minor
inconvenience.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3714 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-09-27 22:27:04 +00:00
Ray Greenwell 8446cf4f78 We can't clone null.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3299 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-08 22:02:27 +00:00
Michael Bayne e5acc3e45f More DObject fun! We need to keep a careful separation for container
objects (DSet, arrays) in a DEvent (which should not change as a result of
other events being applied) and those in the object itself (which do
change and evolve as events are applied to the object).

This is important both because the DEvent is passed on to another thread
for delivery to remote clients, thus changes to the values in the event
could take place before they were serialized and sent over the network,
and because compound events are applied to an object before they are sent
to the other thread for delivery and thus, for example, setting a DSet and
then adding a few entries to it in a compound event would result in the
DEvent copy of the DSet becoming corrupted.

Two problems remain (note, neither of these are new, the one issue
introduced when I rewrote the DObject stuff is fixed by these checkins):

1. Object subscription requests are supposed to deliver a snapshot of the
   object at the point in the event stream at which the subscription
   request was processed, but presently we pass only a reference to the
   object off to the networking thread which means that before the object
   is serialized and sent to clients, subsequent events could be applied
   to it and then those events would be sent to the client as well
   resulting in funny business (probably nothing more than duplicate DSet
   entry warnings, but imagination and Chapter 17 tell us that worse
   things could happen).

2. The use of Streamable instances could result in badness. If a field in
   a Streamable is modified and the whole Streamable set() back into the
   object to broadcast the update, then further changes were made to the
   Streamable before the attribute change event was serialized and sent
   over the network, the second modifications would be reflected in the
   event triggered by the first modifications.

The first problem may be solvable (albeit inefficiently) by serializing
the DObject on the event dispatcher thread and sending that serialized
copy off to the network thread for delivery to the client. It would be
much less efficient as we would be unable to make use of the client's
already "primed" ObjectOutputStream which may have already mapped many of
the classes in the object to two byte codes, but object subscription is
fairly uncommon compared to delivery of events, so inefficiency might not
be a big problem in this case.

The second problem might be solved by requiring that all Streamable
implementations implement clone() and then cloning any Streamable
attribute just as we do an array or DSet during an attribute, array
element or DSet entry change. This would be a more significant performance
hit as well as require a review of all of our Streamable classes (to
determine if they need a custom clone() implementation), and it has up to
now not actually manifested as a problem.

In any case I'm not going to tackle either of these remedies at the moment
because I'm on vacation, dammit.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3294 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-05 06:24:11 +00:00
Michael Bayne 1d976ceaf8 Merry Christmas to the server CPUs. It occurred to me that we could
accomplish our "previous value" support in the distributed object system
without using reflection and could also avoid using reflection in the case
where we have already applied the event on the server (which is generally
the case on the server).

Rather than hacking up the gendobj script, I took this opportunity also to
rewrite the DObject generation script as an Ant task and in doing so,
implemented another recent idea which is that we can just augment the
FooObject.java file instead of having a separate .dobj and .java file.

You'd think it was spring there's so much cleaning going on.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3284 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-12-28 03:48:07 +00:00
Michael Bayne 421ed5126e Got a little too excited about using 1.5 features and some slipped into
Narya. I added directives to the compile line to prevent that from
happening again.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3247 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-11-27 17:34:55 +00:00
Michael Bayne c43689b104 Make sure invocation listeners are only added to the list once.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3245 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-11-26 23:19:29 +00:00
Michael Bayne 40b2a587c3 Load the InvocationListener class using the same classloader we use to
load the project's service classes so that they are comparable. Also sort
everything to avoid pointless changes in regenerated source files when
Java decides to arbitrarily return the methods in a different order.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3242 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-11-26 23:13:28 +00:00
Michael Bayne e889f5e9fe Complain if we don't have a classpathref set. Fixed regex as EOL is
apparently not a non-word character.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3241 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-11-26 22:48:48 +00:00
Michael Bayne 2850a15acd Factored out the code that will be shared between GenServiceTask and
GenReceiverTask (not yet implemented). Modified the task so that it can
load the service classes via a classpath declared inside ant, avoiding the
need to put project classes in Ant's classpath.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3240 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-11-26 22:39:09 +00:00
Michael Bayne a0d343ff04 Rewrote the code that generates InvocationService marshalling and
dispatching classes in Java to eliminate annoying dependency on the output
format of JDK 1.4.1's javap.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3238 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-11-25 04:46:19 +00:00