[Design of EJB 3.0] - Re: javax.ejb.EJB Annotations Outside EJB3 Components
by richard.opalka@jboss.com
Hi EJB3 Folks,
is the construction of the ejb reference right in the following code?
This is request for review ;)
package org.jboss.wsf.container.jboss50.deployment.metadata;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import javax.ejb.EJB;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.ejb3.common.resolvers.plugins.FirstMatchEjbReferenceResolver;
import org.jboss.ejb3.common.resolvers.spi.EjbReference;
import org.jboss.ejb3.common.resolvers.spi.EjbReferenceResolver;
import org.jboss.wsf.common.javax.resolvers.AbstractReferenceResolver;
final class EjbBeanReferenceResolver
extends AbstractReferenceResolver
{
private final DeploymentUnit unit;
private final EjbReferenceResolver delegate = new FirstMatchEjbReferenceResolver();
EjbBeanReferenceResolver(final DeploymentUnit unit)
{
super(EJB.class);
this.unit = unit;
}
@Override
protected String resolveField(final Field field)
{
EJB ejbAnnotation = field.getAnnotation(EJB.class);
EjbReference reference = getEjbReference(ejbAnnotation, field.getType());
return this.delegate.resolveEjb(unit, reference);
}
@Override
protected String resolveMethod(final Method method)
{
EJB ejbAnnotation = method.getAnnotation(EJB.class);
EjbReference reference = getEjbReference(ejbAnnotation, method.getParameterTypes()[0]);
return this.delegate.resolveEjb(unit, reference);
}
private EjbReference getEjbReference(EJB ejbAnnotation, Class<?> type)
{
String beanInterface = ejbAnnotation.beanInterface().getName();
if ("".equals(beanInterface))
{
beanInterface = type.getName();
}
return new EjbReference(ejbAnnotation.beanName(), beanInterface, ejbAnnotation.mappedName());
}
}
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4228320#4228320
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4228320
15 years, 7 months
[Design the new POJO MicroContainer] - MC tools
by alesj
Just yesterday I was thinking of needing nice MC tool(s)
to help me with some migration, optimization.
So, the idea is next (all cmd line tools):
(1) help migrate -service.xml --> -beans.xml
* single file, ant patterns
* warn on non portable elements (perhaps being able to type in the fix/change)
(2) display services dependencies (pojos, mbeans, aliases, deployments, ...) via apiwiz
* at descriptor file level (-beans.xml, -service.xml, jboss-dependency.xml, jboss-classloading.xml)
* at (Bean|Service)MetaData level (hook into Deployers attachments)
* at kernel level (inspect ControllerContexts for DependencyItems)
This would require a new mc-tools projects,
with 2 modules: migration, dependencies
Both tools should come pretty much in-handy with JBoss6.
(1) moving all those mbeans to mc pojos
(2) helping determining how to handle On_Demand mode
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4228226#4228226
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4228226
15 years, 7 months