Hi,

Looks good. A few things though; static variables violate the EJB spec and 
are thus not portable across different vendors EJB implementations. Thus I 
believe that the Initialization class will only work in certain EJB 
containers. Quite a few vendors are starting to implement isolation via a 
number of hacks or solid engineering. (Some of it looks sweeet!!!)

I suspect that the big name containers will actually be moving to the Isolate 
API in Q1->Q2 2003 which will mean that static variables will be guarenteed 
not to work - even for non-cluster, non-distributed completly in-JVM local 
EJBs.

Thus I would suggest that you seriously consider using JNDI to store the 
ComponentManager in. I am not aware about how different vendors tools support 
this and unfortunately I think that it is different for each vendor. Most of 
them do however provide some mechanism to do it.

As about how to integrate it into the EJB system .. not sure. I guess I would 
do it like something like the following...

public interface AvalonEJBFrame
{
  Logger getLogger();
  Configuration getConfiguration(); //or Parameters
  ServiceManager getServiceManager(); //or ComponentManager
}

public abstract class AbstractAvalonEJB
{
  private AvalonEJBFrame _frame;

  protected void initialize()
  {
     Context c = new InitialContext();
     _frame = 
  (AvalonEJBFrame)c.get( "java:.insert proper namespace here" + getName() );
  }

  protected void dispose()
  {
     _frame = null;
  }

  protected Logger getLogger() { return _frame.getLogger(); }
  protected Configuration getConfiguration() 
     { return _frame.getConfiguration(); }
  protected ServiceManager getServiceManager()
     { return _frame.getServiceManager(); }
}

And then have each different EJB type call initialize/dispose where it is 
most appropriate for that bean. (ie ejbCreate or whatever).

Note however that I dont use the ECM and all my EJB efforts to date have been 
toy applications so I could be completely wrong. 

Anyways what do you think of that ?

-- 
Cheers,

Pete

"Invincibility is in oneself, vulnerability in the opponent." -- Sun Tzu 

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to