-
1. Re: Accessing EJB's with custom annotations.
alesj Feb 19, 2009 5:42 AM (in response to bryan.kearney)I think this relates to your question:
- http://exitcondition.alrubinger.com/2008/12/20/doing-two-models-at-the-same-time/ -
2. Re: Accessing EJB's with custom annotations.
bryan.kearney Feb 19, 2009 4:14 PM (in response to bryan.kearney)I have seen it.. but does this work for EJB's as well? I ask becuase I have an EJB which looks like this:
@Command(commandName = "PingBackend")
@AuditType(AuditLogType.PING_BACKEND)
@Stateless
public class PingBackendCommand extends VdcCommandBase {
....
I then created an Annotation Resolver:
public class CommandAnnotationPlugin extends ClassAnnotationPlugin{
private Log log = LogFactory.getLog(CommandAnnotationPlugin.class);
public CommandAnnotationPlugin() {
this(Command.class) ;
log.debug("************************************************************");
}
protected CommandAnnotationPlugin(Class annotation) {
super(annotation);
// TODO Auto-generated constructor stub
}
protected List<? extends MetaDataVisitorNode> internalApplyAnnotation(ClassInfo info, Command annotation, BeanMetaData beanMetaData) throws Throwable
{
log.debug("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%");
log.debug("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%");
I see the Stars at creation, but never the Percents. I added another bean which implements the same code to register a custom builder
BeanAnnotationAdapter beanAnnotationAdapter = BeanAnnotationAdapterFactory.getInstance().getBeanAnnotationAdapter();
//String beanAnnotationAdapterBindName = MC_NAMESPACE_EJB3 + "BeanAnnotationAdapter";
String beanAnnotationAdapterBindName = "CommandBeanAnnotationAdapter" ;
BeanMetaDataBuilder bmdb = BeanMetaDataBuilder.createBuilder(beanAnnotationAdapterBindName, beanAnnotationAdapter.getClass().getName()) ;
bmdb.addMethodInstallCallback("addAnnotationPlugin");
bmdb.addMethodUninstallCallback("removeAnnotationPlugin");
No matter if I put it in the ear, or in the deployer, I it seems like it never matches up the annotation. Is there somehting else I need to do?
-- bk -
3. Re: Accessing EJB's with custom annotations.
alrubinger Feb 20, 2009 1:24 AM (in response to bryan.kearney)Ah, you're tackling this from the other end.
ejb3-mc integration as described in the blog post is how I enabled @EJB injection into MC Beans.
Here you're trying for custom annotation support on EJBs. As EJB bean impl classes are not installed as MC beans, the annotation plugin is not getting called.
To complete the equation we'd need to revisit the EJB injection framework to leverage MC a bit more to do both this example, and stuff like @Inject MC beans into EJBs.
S,
ALR -
4. Re: Accessing EJB's with custom annotations.
bryan.kearney Feb 20, 2009 8:22 AM (in response to bryan.kearney)Well.. at least i dont feel too bad about not being able to follow the blog. So.. how does the jbossws stuff accomplish this? This seems like something in the deployers/jbossws.deployer is intercepting the EJB deployment and adding endpoints into a web application. It seems like all the bits to do it are "there".
-- bk