commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rahul Akolkar <rahul.akol...@gmail.com>
Subject Re: [scxml] src element as a pointer to memory content
Date Tue, 07 Jun 2011 05:15:25 GMT
On Tue, Jun 7, 2011 at 12:44 AM, Dario D <darac1111@gmail.com> wrote:
> Thank you Rahul. In fact we were investigating the possibility of having our
> own protocol handlers, but we noticed that the resolve() method of
> PathResolver returned a string, not an URL. What did you have in mind?
>
<snip/>

ISTR that the String value is simply treated as a URL spec by the
parser so it'd be effectively the same. Suggest doing a little test of
your own to verify.

-Rahul


> 2011/6/7 Rahul Akolkar <rahul.akolkar@gmail.com>
>
>> On Mon, Jun 6, 2011 at 5:35 PM, Dario D <darac1111@gmail.com> wrote:
>> > Hello,
>> >
>> > Would it be possible to have a PathResolver implementation which treats
>> the
>> > "src" element as a pointer to a database entry where content is stored,
>> or
>> > an in-memory object? Of course, I could make a PathResolver
>> implementation
>> > which will parse the value of "src" make a query to the database,
>> download
>> > the content to a file, and then return file path as the result of the
>> > resolvePath() method. However, I would like to skip the step of making a
>> > file on the disk just for the purpose of loading the "src" content.
>> Ideally,
>> > this PathResolver implementation would be able to read content directly
>> from
>> > a memory object (perhaps a cache of some sort), without the need of
>> creating
>> > a file. I'm planning to use SCXML in a high-throughtput environment and I
>> > feel that writing files on the disk and then reading them back will slow
>> the
>> > process down a bit.
>> >
>> > One of the requirements for the application is to be able to split SCXML
>> > files into many reusable modules, thus the need to use the "src" element.
>> >
>> > Any thoughts?
>> <snip/>
>>
>> Requirement is reasonable, my suggestion would be to investigate using
>> your own scheme for the resolved URLs and providing a custom stream
>> protocol handler that reads from memory or cache as desired. For more
>> on how to do this, see the java.net.URL class docs, in particular, the
>> portion here:
>>
>>
>> http://download.oracle.com/javase/1.4.2/docs/api/java/net/URL.html#URL(java.lang.String,%20java.lang.String,%20int,%20java.lang.String)
>>
>> Separately, you should be aware that the src attribute has been
>> removed from the SCXML spec in favor of standard techniques like
>> XInclude, though Commons SCXML will continue to support it till the
>> next major release.
>>
>> -Rahul
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message