> If you modifify the RepositoryPersistor accordingly, please post your
> changes to the list, I will integrate your solution into the OJB codebase!

Well, such changes would have a lot of implications.  If the
RepositoryPersistor class were modified to handle any URL, you may want
to change its API to accept more general keys rather than just
filenames.  For example it has a public method "readFromFile(String)"
which should be changed to "readFromURL(String)".  Also you'd have to
decide how to handle relative filenames and URL's, since strictly
speaking a URL string should not be a relative reference.  You'd have to
add API to handle that or implement a clearly defined and documented
search path.

Similarly, you might want to enhance PBKey in a similar fashion so
PBKey's can be identified by URL strings rather than absolute or
relative filenames.  It currently has the method "readRepositoryFile()"
for example.

I don't mean to make this more complicated than it has to be but based
on my experience playing with class loaders and URL's in Java Web Start,
these types of issues get complex fairly quickly.

Randy

Thomas Mahler wrote:
> 
> Hi Randy,
> 
> I see no problems in loading a repository from an URL.
> If you modifify the RepositoryPersistor accordingly, please post your
> changes to the list, I will integrate your solution into the OJB codebase!
> 
> cheers,
> Thomas
> 
> Randy C Tidd wrote:
> > Hello,
> >
> > I'm working on an OJB application that will run as a Java Web Start
> > application, and for a few reasons it is more convenient for me to
> > obtain OJB resource files via http from a web server instead of from the
> > local file system.
> >
> > The typical API provided by PBKey and PersistenceBrokerFactory accepts a
> > String that must be an absolute or relative filename such as
> > "resources/ojb/repository.xml".  This is used by the RepositoryPersistor
> > to find the XML file with help from the ClassLoader.  However I'd like
> > to be able to pass in a URL instead, for example
> > "http://www.foo.com/myapp/resources/ojb/repository.xml";.
> >
> > The way that these API's are written it seems like the assumption is
> > that these resources will always be read from a file.  For example the
> > RepositoryPersistor does this to create the URL that it passes to the
> > SAXParser:
> >
> >     url = new File(repositoryFileName).toURL();
> >
> > Has anyone else found a need to obtain these resources by http or
> > another protocol?  Can any OJB developers comment on whether or not this
> > would be a good idea?
> >
> > Thanks in advance for any info,
> >
> > Randy
> >
> >
> > --
> > To unsubscribe, e-mail:   <mailto:ojb-user-unsubscribe@;jakarta.apache.org>
> > For additional commands, e-mail: <mailto:ojb-user-help@;jakarta.apache.org>
> >
> >
> >
> >
> 
> --
> To unsubscribe, e-mail:   <mailto:ojb-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail: <mailto:ojb-user-help@;jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:ojb-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:ojb-user-help@;jakarta.apache.org>

Reply via email to