[Design of EJB 3.0] - ClientContainer injection
by alex.loubyansky@jboss.com
Looks very confusing to me. This is what I see:
this is what happens in the ctor of ClientContainer: first it calls processMetaData() which populates the list of injectors and then inject() is called on each injector:
...
| processMetadata(null);
|
| for(Injector injector : injectors)
| {
| log.debug("injector: " + injector);
| injector.inject((Object) null);
| }
| ...
How can anything be injected into null? (except static)
processMetaData does the following:
handlers.add(new ClientEJBHandler<RemoteEnvironment>());
| handlers.add(new DependsHandler<RemoteEnvironment>());
| handlers.add(new JndiInjectHandler<RemoteEnvironment>());
| handlers.add(new PersistenceUnitHandler<RemoteEnvironment>());
| handlers.add(new ClientResourceHandler<RemoteEnvironment>(this.mainClass));
| handlers.add(new WebServiceRefHandler<RemoteEnvironment>());
|
| for (InjectionHandler<RemoteEnvironment> handler : handlers)
| handler.loadXml(xml, this);
|
In loadXml(), a handler adds itself to the ClientContainer's list of handlers (so, later it gets inject call, see above). But this is true only for the handlers that are in the jbossas/trunk, i.e. ClientEJBHandler and ClientResourceHandle. Other handlers (in the ejb3 project) add injectors to ClientContainer's encInjections which I don't see being used after that.
Map<String, Map<AccessibleObject, Injector>> getEncInjections()
Further, the following handlers in their loadXml() call ClientContainer.getEncInjectors() which is
public Map<String, EncInjector> getEncInjectors()
| {
| throw new IllegalStateException("ENC setup happens on the server");
| }
- JndiInjectHandler
- PersistenceUnitHandler
So, these are not going to work.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4158831#4158831
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4158831
16 years, 3 months
[Design of EJB 3.0] - Re: Unit Tests for Unbinding References from JNDI in EJB3 Pr
by ALRubinger
Some notes regarding Jaikiran's patch now attached to EJBTHREE-1420:
* Overall, the test looks good and follows the proper setup. :)
* Needs LGPL Headers and Copyright info (these should be in the Eclipse templates I'd send along)
* Tests must check not only the default local and remote bind values, but also those of the interface-specific bindings
* Already provided are SLSB and SFSB EJBs in the "common" test package; we can use these and do away with the ones specific to the "jndiregistrar" test package.
* The tests are checking for hardcoded JNDI bind values. Instead, should be checking against the same values used by Proxy; these are obtained from metadata:
JBossSessionBeanMetaData md = statelessSessionContainer.getMetaData();
| md.getLocalHomeJndiName(); // Local Home Binding
| md.getHomeJndiName(); // Remote Home Binding
| md.determineJndiName(); // Default Business Remote Binding
| md.determineLocalJndiName(); // Default Business Local Binding
| BusinessRemotesMetaData businessRemotes = md.getBusinessRemotes();
| for(String businessRemoteInterfaceName : businessRemotes)
| {
| md.determineResolvedJndiName(businessRemoteInterfaceName); // Interface-specific business remote JNDI Binding
| }
| BusinessLocalsMetaData businessLocals = md.getBusinessLocals();
| for(String businessLocalInterfaceName: businessLocals)
| {
| md.determineResolvedJndiName(businessLocalInterfaceName); // Interface-specific business local JNDI Binding
| }
The important thing is that the test setup looks great. :)
S,
ALR
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4158786#4158786
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4158786
16 years, 3 months