commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rahul Akolkar <>
Subject Re: [scxml] src element as a pointer to memory content
Date Mon, 06 Jun 2011 23:09:15 GMT
On Mon, Jun 6, 2011 at 5:35 PM, Dario D <> 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?

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 class docs, in particular, the
portion here:,%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.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message