[jboss-dev-forums] [Design of EJB 3.0] - Re: EJBTHREE-1454 Encapsulate Container infomation in TO/VO

ALRubinger do-not-reply at jboss.com
Tue Aug 26 15:23:31 EDT 2008


"jaikiran" wrote : Relying on the getName implementation of the EJBContainer (which just returns this name), results in failure of a couple of tests in the EJB Core.

This is because EJB Containers are registered with the AOP?Remoting Dispatcher by way of their ObjectName.canonicalName.  @see SessionSpecContainer.registerWithAopDispatcher().

I think getName(), in the case of EJB3 Proxy, is vague.  And who's to say that the Container is registered for remoting under its name (as you've shown here).

So rather than overriding getName(), let's add to InvokableContext:

String getDispatcherRegistrationName()

...which may be implemented in SessionSpecContainer:

return this.getObjectName().getCanonicalName();

...and then be called upon by SessionSpecContainer.registerWithAopDispatcher().  Then you'll have it available to you everywhere within EJB3 Proxy.

"jaikiran" wrote : The SessionContainer, is using the deprecated Ejb3Module to create a name for the container. Do you want me to change (and test) the SessionContainer to create the name as follows:
  | 
  | super(JavaEEComponentHelper.createObjectName(deployment,ejbName), ...);
  |   | 
  | 

A note about SessionContainer:

EJB3 Proxy isn't used until SessionSpecContainer (the difference being that SessionSpecContainer adheres to session beans defined by the spec, and SessionContainer can become the basis for things like @Service).

So where appropriate, I've been slowly breaking things out (and centralizing from StatefulContainer/StatelessContainer) into SessionSpecContainer to try and clean things as we go.

So let's break out the logic in SessionContainer where it constructs a container name into a "protected String constructContainerName(String ejbName)", but leave the implementation as used in the SessionContainer ctor intact.  

The end result will be that the container name does not change, but you'll have all information you need from the new getDispatcherRegistrationName().

S,
ALR

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4172691#4172691

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4172691



More information about the jboss-dev-forums mailing list