The Joy of Streams [was Re: Implementation of take (multiple) in Jini starter kit]

"John McClain - Sun Microsystems, Inc." <[email protected]>
Newsgroups gmane.comp.java.sun.javaspaces
Message-ID <[email protected]>
Gregg Wonderly wrote:
> John McClain - Sun Microsystems, Inc. wrote:
>> Gregg Wonderly wrote:
>>> John McClain - Sun Microsystems, Inc. wrote:
>>>
>>>> Having said all that, for me the main motivation for the phrase "an
>>>> implementation may chose to take fewer entries from the space than the
>>>> maximum available or the maximum allowed by maxEntries" was so the
>>>> space
>>>> could protect itself from have to load all the entries into memory
>>>> so it
>>>> could ship them back to the client...
>>>
>>> John, given the use of a smart proxy, and a streaming connection from
>>> the server to the client, it would be possible for the server to load
>>> a small  number at a time, and then write those batches through the
>>> stream to the client, where the client iterator could make these
>>> small groups look like one batch could it not?
>>
>> Yes (though I am guessing you have to be careful about how you mark the
>> entries as removed...), but I didn't want to require such an
>> implementation since it would make using most (any?) off the shelf RPC
>> implementation imposable (maybe only difficult, you could always do
>> multiple RPC calls under the covers I suppose).
>>
>> Having said that it might be really nice to have an RPC implementation
>> that did give you access to the streams.....
>
> I don't know if you've looked at it, but my remote InputStream (see
> http://logman.dev.java.net) was intended to make this easier.  In the smart
> proxy travels an InetSocketAddress to get back to the server with, and a
> Uuid to identify the user/context.  When the smart proxy deserializes,
> it creates a socket connection to the server which it can then both
> write down and read from. It really makes it possible to do a lot
> more interesting  things than just using RPC calls.

I haven't looked at logman, but I think holowaa is doing something
similar.  The potential advantage of integrating it with the RPC system
is you get to leverage whatever security, muxing, configuration,
internetworking tricks, security, connection management, security, etc.
the RPC system is doing.

Having said that, smart proxies certainly make this sort of thing
straight forward even you don't have help from the RPC and that is a
very nice thing indeed. This may actually move one to the point where
you want a simpler RPC system figuring it is easy enough to insert smart
proxies where necessary (put another way, how have RMI looked if it was
done after Jini?)

[Indeed one though we have had is developing a static rpc system that
  didn't do dynamic classloading but only worked with a fixed set of
  classes - you would run some tool over you the classes you want to pass
  back and forth to generate a customized serialization format and
  stubs/skels (this has the potential to be a lot faster - though
  optimization is always a dangerous game...) You would use RMI to
  establish your intimal smart proxy, but the smart proxy would use the
  simpler RPC system underneath.]

On the "security, ..., security, ..., security, ..." front, it might not
be that bad to use the JERI transport layer impls in the context of
something like logman or holowaa and get secure streams that fit in with
the Jini security model (actually, I suppose at that point you might get
muxing, connection reuse, and internetworking tricks too). Gives
configuration an extra moving part (need to get both an Exporter and a
JERI server endpoint), but can be done without any additional help from
JERI.

-
BTW, if you want to reply to this message, please direct your reply
to the list, thanks

John McClain                                    [email protected]
Sun Microsystems, Inc.
Burlington, MA

And it is that way today. We are tricked by hope into starting
companies, beginning books, immigrating to this country and investing
in telecom networks. The challenges turn out to be tougher than we
imagined. Our excessive optimism is exposed. New skills are demanded.
But nothing important was ever begun in a prudential frame of mind.

         - David Brooks

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff JAVASPACES-USERS".  For general help, send email to
[email protected] and include in the body of the message "help".

To view past JAVASPACES-USERS postings, please see:
http://archives.java.sun.com/archives/javaspaces-users.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.