aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes EJB Programming Restrictions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB Programming Restrictions" Watch "EJB Programming Restrictions" New topic
Author

EJB Programming Restrictions

R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5370
Hi
I was going through this page.
Here it states, in short, that an enterprise bean 'must' not access and try to modify the followings
classloader, security policy, JVM, threads, IO, AWT, native library etc.
I would like to know that we should avoid doing these OR we cant do these?
I dont have any app server right now to test myself so any help will be appreciated.
Thanks in advance


"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
At least some of these can be done regardless of the explicit restriction. The point is that the appserver does not guarantee that your application will work as expected if you break the restrictions. You'll have to test whether a particular spec-breach causes your particular appserver and application to misbehave.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8898

R.K.singh,
http://java.sun.com/blueprints/qanda/ejb_tier/restrictions.html

Chris,
Is your JMX article done?
[ September 08, 2003: Message edited by: Pradeep Bhat ]

Groovy
R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5370
Originally posted by Pradeep Bhat:
R.K.singh,
http://java.sun.com/blueprints/qanda/ejb_tier/restrictions.html
Chris,
Is your JMX article done?
[ September 08, 2003: Message edited by: Pradeep Bhat ]

Thanks to all ..
I think as Lasse point out that some of them can be implemented but cant be gauranteed to run on every container. But some like "Nonfinal static class fields are disallowed in EJBs ", I think compiler will give error if I use static non-final field. And some like accessing IO can be done with no gaurantee of running everywhere.
Pradeep your link seems good .. thanks . .
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8898

But some like "Nonfinal static class fields are disallowed in EJBs ", I think compiler will give error if I use static non-final field.

The complier wont complain. Some containers do not complian even during runtime. Devlating from the retsrictions will make your bean harder to port.
The EJB specification states:
"Some Containers may allow the Deployer to grant more, or fewer, permissions to the enterprise bean instances than 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."

[ September 08, 2003: Message edited by: Pradeep Bhat ]
R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5370
Originally posted by Pradeep Bhat:

The complier wont complain. Some containers do not complian even during runtime.

It means all the restrictions has to be taken care by programmer manually
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8898

Not always true.
For example Oracle 9ias complains when there is an attempt to access native code from the EJB.
QUOTE]Originally posted by R K Singh:

It means all the restrictions has to be taken care by programmer manually
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB Programming Restrictions
 
Similar Threads
Can I write the three different steps in different countries?
again doubt in generic
Stack Overflow
Alfred Neumann
Java mail