I have an application that needs to convert, merge, and extract files of 
different formats.  Because the files already reside on the server (and 
could often be large), and the manipulation tools I use are only on the 
server, I've created a File Manipulation API of Stateless Session Beans 
that reside on the server.

However, looking closer at the EJB specs, it seems that I'm not supposed 
to use any java.io stuff when it comes to Files (they mention it as a 
programming restriction in EJB 1.1+).  The beans work great in JBoss, 
and after tweaking the server security policy file in the J2EE SDK 1.3 
RI, they work there, too.

Is this a complete no-no?  Does anyone else do any File manipulation 
using Stateless Session Beans?  Is the spec being overly protective? 
I've included the relevant pieces from the specs below.  The spec seems 
to assume I'm using Files to store data - when I'm not; I'm just 
manipulating them...

Thanks for any and all input,
David

----------

EJB 1.0 spec:

Section 16.4 Programming restrictions, page 117:

This spec does not mention anything about not manipulating Files, though 
it is precursed with: "NOTE: this is only a partial list of restrictions 
that the enterprise developer must observe."

----------

EJB 1.1 spec:

Chapter 18.1.2 Programming restrictions, page 273 (pdf-file page 277):

        "- An enterprise bean must not use the java.io package to attempt to 
access files and directories in the file system.

The file system API's are not well-suited for business components to 
access data.  Business components should use a resource manager API, 
such as JDBC API, to store data."

Section 18.2.1 Java 2 APIs requirements, Table 10, page 276 (pdf-file 
page 280):

"...the term 'deny' means that the Container should deny the permsission."

(table excerpt)
Permission name / EJB Container policy
java.io.FilePermission / deny

Followed by:
"Some Containers may allow the Deployer to grant more, or fewer, 
permissions to the enterprise bean instances thatn specified in Table 
10.  Support for this is not required by the EJB specification. 
Enterprise beans that rely on more or fewer permissions will not be 
portable across all EJB Containers."

----------

EJB 2.0 spec:

Says same thing as 1.1 spec, though sections/pages obviously have changed.

Section 24.1.2 Programming restrictions, page 492.
Section 24.2.1 Java 2 APIs requirements, Table 19, page 496.



_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to