Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB Programming Restrictions

 
R K Singh
Ranch Hand
Posts: 5384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
R K Singh
Ranch Hand
Posts: 5384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic