[jboss-dev-forums] [EJB3 Development] - Re: EJBTHREE-2198 EJB resource providers for switchboard and the dependency issues
jaikiran pai
do-not-reply at jboss.com
Wed Nov 24 06:30:55 EST 2010
jaikiran pai [http://community.jboss.org/people/jaikiran] created the discussion
"Re: EJBTHREE-2198 EJB resource providers for switchboard and the dependency issues"
To view the discussion, visit: http://community.jboss.org/message/572729#572729
--------------------------------------------------------------
> Ales Justin wrote:
>
>
> How do I get a hold of this EJBContainer?
> Afais, this is a MC bean under the JBossEnterpriseBeanMetaData::getContainerName?
That's correct.
> Ales Justin wrote:
>
> > 2) for @Singleton container it in done in SingletonBeanJNDIBinderDeployer in jboss-ejb3-singleton project
> > 3) for no-interface views it's done in EJB3NoInterfaceViewDeployer in jboss-ejb3-nointerface project
> OK, this two are obviously MC beans. :-)
>
> For all 3 "jndi" binders:
> a) Which is the code that does the custom JBoss jndi binding?
>
>
>
For no-interface jndi binding, it's the org.jboss.ejb3.nointerface.impl.jndi.NoInterfaceViewJNDIBinderFacade (MC bean) which does this binding.
For singletons it's the org.jboss.ejb3.singleton.deployer.JNDIBinderImpl
> Ales Justin wrote:
>
>
> b) Can it be already used from external bean/resource or does it need to be extracted / refactored?
>
> I can determine (b) myself, once I can identify the jndi binding code. ;-)
It's not exposed yet and is internal impl details right now. Extracting/refactoring probably would require more work. I guess the easy way would be to use some specific MC bean name syntax for those binders and let the resource provider assume that syntax. For example:
LegacyMCBeanNameSupplier (or whatever we call that):
Set<String> getBinderDepencies(DeploymentUnit unit, JBossEnterpriseBeanMetaData metadata)
{
Set<String> dependencies = new HashSet<String>();
// for singleton
if (metadata.isSession() && metadata.issingleton())
{
// add the binder, responsible for singleton view bindings, to the dependencies
// The MC bean name is assumed to be of the following syntax:
// jboss-ejb3-singleton-jndi-binder:appName=blah,module=blah,bean=beanName
dependencies.add("jboss-ejb3-singleton-jndi-binder:appName=myapp,module=myapp,bean=blahblah");
}
// for nointerface view
if (metadata.exposesNoInterfaceView)
{
// add the binder, responsible for no-interface view bindings, to the dependencies
// The MC bean name is assumed to be of the following syntax:
// jboss-ejb3-nointerface-jndi-binder:appName=blah,module=blah,bean=beanName
dependencies.add("jboss-ejb3-nointerface-jndi-binder:appName=myapp,module=myapp,bean=blahblah");
}
// for SLSB and SFSB
if (metadata.isslsb || metadata.isSfsb)
{
// add legacy container MC bean as dependency
dependencies.add(metadata.getJBossMetadata().getContainerName());
}
return dependencies;
}
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/572729#572729]
Start a new discussion in EJB3 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2030]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20101124/51f14afd/attachment.html
More information about the jboss-dev-forums
mailing list