• Post Reply Bookmark Topic Watch Topic
  • New Topic

Defining a class in a package  RSS feed

 
Treimin Clark
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From Maikali Zaikin's notes:

Maikalai Zaikin wrote:The enterprise bean must not attempt to define a class in a package. This function is reserved for the EJB container. Allowing the enterprise bean to perform this function would create a security hole


What is this?
Couldn't we define a package statement for a bean?



Is this illegal?


 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is taken straight from the spec : 21.1.2 Programming Restrictions.
I think this point has something to do with java.lang.ClassLoader's defineClass and definePackage methods.
 
Raf Szczypiorski
Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. What you did is perfectly valid. I think the rule you quote has sth to do with dynamic class loading and the ClassLoader.defineClass() method.
 
Treimin Clark
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to Christophe,

Raf Szczypiorski wrote:Hi. What you did is perfectly valid. I think the rule you quote has sth to do with dynamic class loading and the ClassLoader.defineClass() method.

What is "dynamic class loading"? Did you mean java reflection?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!