You cannot assume that the class live outside the container.

The loaded non-ejb class  will be loaded by the container classloader or the
system classloader (if the container classloader cannot find it). So any loaded
class will reside in the same 'namespace' as any other class loaded by the same
classloader.

You will break the purpose of the spec if you do that. It is also possible that
a container class loader will prevent you for doing this with the use of a
security manager (Weblogic does not prevent anything) to be sure that the bean
behave correctly.

If you create thread and/or use r/w static field by using a class that is loaded
from your bean, you can break the ejb spec (in fact, the ejb spec does currently
not address this issue). I am sure that this issue will be addressed in a future
upgrade of the spec.

You can simulate the use of static field with a bean managed entity bean that
does not persist.

If you want to use thread, it will be better to create an external java apps
that you  can access with RMI or to use app server specific feature to do it.

czarina chiu wrote:

> Hi:
>
> I was reading the programming restrictions on the EJB spec.  There are
> restrictions on using read/write static fields and the use of threads and
> synchronization primitives.
>
> I would like to know if these restrictions applies to server-side classes
> that a EJB uses.  Since these classes do not live in the container, my guess
> is they can do whatever they want?
>
> Thanks,
>
> Czarina
>
> --------------------------------------------------------------------
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

--
-----
Emmanuel Pirsch
Sun Certified Java Programmer
Unite for Java! - http://www.javalobby.org/
---
"The intuitive mind is a sacred gift and the rational mind is a faithful
servant. We have created a society that honors the servant and has forgotten the
gift."
 - Albert Einstein.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to