[concurrency-interest] Executors, Work Manager, JEE

Brian Goetz brian at quiotix.com
Thu Feb 1 12:02:22 EST 2007

The JEE philosophy is that it has to be in control of all resource 
management, in order to make good global resource allocation decisions.

In the real world, however, sometimes this is too theoretical a goal. 
Different containers have different degrees of tolerance for breaking 
these rules.  Some (e.g., JBoss) let "anything go"; others (e.g., 
WebSphere) may install security managers that won't even let you create 
a thread.

Assuming that your security manager and class loader don't fight with 
you, this is one of those purity-vs-practicality decisions you need to 
make for yourself.  Bear in mind that going down this route makes your 
app no longer JEE compliant, and therefore not portable across 
containers (do you care?), as well as potentially compromises overall 
performance (maybe, maybe not) because of resource management issues.

I've written applications that have both EE and SE components; I use an 
EE container to manage the EE components, and run the SE components 
in-process.  JBoss makes this easy, as you just write an MBean to invoke 
your service start method, which can do anything it wants.  In those 
cases, I found the flexibility outweighed the loss of conformance; in 
other cases, it gets complicated and you may be better off segregating 
code employing the SE approach from your EE container.  Your mileage may 

EE is a tool, not a religion.  Use it appropriately, and it gives you 
leverage.  Use it inappropriately, and you risk hurting yourself.

Ryan LeCompte wrote:
> Hello,
> I'd like to know how "safe" it is to use the new Java concurrency 
> utilities within a JEE container, also taking into account the Work 
> Manager API designed/implemented by IBM/BEA. Traditionally it has been 
> discouraged to spawn your own threads within the JEE container, because 
> the container can't manage those threads, etc. Does the same of thinking 
> hold true if I utilize the new Java concurrency utilities for thread 
> pools, etc? What are my options if my JEE container doesn't support the 
> Work Manager specification (which, if I recall, hasn't even been finally 
> approved as a standard part of JEE).
> Thanks,
> Ryan
> ------------------------------------------------------------------------
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at altair.cs.oswego.edu
> http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest

More information about the Concurrency-interest mailing list