Anonymous
Unregistered
|
|
Excellent article! I found it very useful as I am currently looking into different options of loading text files in EJB application (EJB container has a restriction on IO operations, so java.io package should not be used). Loading through the URLs seems the way to go Is there any way of moving resources from one location to another one without using java.io (basically, I need to archive the files after they have been read by EJB application).
Thanks Vlad for writing good articles. I certainly learn new stuff every time I read them.
|
vlad_roubtsov
member
Reged: 06/21/03
Posts: 169
|
|
Thanks for the feedback. Yes, reading static text content from an EJB should be easy if the content is packaged as a classloader resource, whether or not it is further disguised behind a URL.
Regarding storing content from an EJB, things are kind of grim. I think if you adhere to the EJB spec in a very strict manner, your only option is JDBC(that is, store everything in a database).
|
Catalin
stranger
Reged: 08/18/03
Posts: 4
|
|
Hi,
Archiving files and storing them to disk is a tricky job to do for an EJB, inside an EJB container. Just think about clustering, load-balancing, etc.
The way I would do this is writing a stand-alone application for archiving files, and access it from the EJB using RMI, for example. This way it would work even in EJB container clusters (fault tolerance of the stand-alone application would be an issue, but this is another story).
|