Are we still without a mechanism to inject into the Containers?
Containers are installed into MC by way of Ejb3Deployment.registerEJBContainer >
MCKernelAbstraction:
AbstractBeanMetaData bean = new AbstractBeanMetaData(name, service.getClass().getName());
| bean.setConstructor(new AlreadyInstantiated(service));
| MCDependencyPolicy policy = (MCDependencyPolicy) dependencies;
| bean.setDepends(policy.getDependencies());
| bean.setDemands(policy.getDemands());
| bean.setSupplies(policy.getSupplies());
What's missing from this piece is a mechanism to do:
final BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(bean);
| builder.createInject(beanToInject, fieldNameToInjectTo);
I don't really want to add this support to DependencyPolicy as that interface is the
union of the MC and JMX Kernels.
Presently we're manually setting all sorts of stuff into the Containers via
Ejb3JBoss5Deployment, like in the Ejb3Deployer:
deployment.setCacheFactoryRegistry(this.getCacheFactoryRegistry());
| // TODO: if the deployment becomes a proper MC bean, it'll get injected
by MC.
|
deployment.setMessageDestinationReferenceResolver(messageDestinationReferenceResolver);
|
deployment.setPersistenceManagerFactoryRegistry(this.getPersistenceManagerFactoryRegistry());
| // TODO: if the deployment becomes a proper MC bean, it'll get injected
by MC.
|
deployment.setPersistenceUnitDependencyResolver(persistenceUnitDependencyResolver);
| deployment.setPoolFactoryRegistry(this.getPoolFactoryRegistry());
I want to add a new field to the containers to support EJB3 Metrics as a POJO. I guess
for the time being I have to do this manually at the deployer level, ie:
* New Deployer to Create a Metrics POJO, then attach it to the DeploymentUnit
* Ejb3Deployer picks up the attachment and sets it upon the Ejb3JBoss5Deployment.
* Containers get at the Metrics POJO via getDeployment().
Lots of wiring.
S,
ALR
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4233432#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...