[jboss-cvs] JBossAS SVN: r82347 - projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Dec 17 12:00:05 EST 2008
Author: petemuir
Date: 2008-12-17 12:00:05 -0500 (Wed, 17 Dec 2008)
New Revision: 82347
Modified:
projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/EjbDiscoveryEnvironment.java
projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/JBossBussinessInterfaceDescriptorAdaptor.java
projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/JBossEJBDescriptorAdaptor.java
projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/JBossSessionBeanDescriptorAdaptor.java
Log:
Fix EJB discovery
Modified: projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/EjbDiscoveryEnvironment.java
===================================================================
--- projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/EjbDiscoveryEnvironment.java 2008-12-17 16:31:59 UTC (rev 82346)
+++ projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/EjbDiscoveryEnvironment.java 2008-12-17 17:00:05 UTC (rev 82347)
@@ -68,30 +68,39 @@
{
// Get the associated DU
DeploymentUnit du = mds.getDeploymentUnit(d.getName());
+ discoverEjbs(du);
- // Ensure it's an EJB3 DU (by looking for the processed metadata)
- if (du.getAttachment(AttachmentNames.PROCESSED_METADATA, JBossMessageDrivenBeanMetaData.class) != null && du.getAttachment(JBossMetaData.class).isEJB3x())
+ }
+ }
+
+ protected void discoverEjbs(DeploymentUnit du)
+ {
+ // Ensure it's an EJB3 DU (by looking for the processed metadata)
+ if (du.getAttachment(AttachmentNames.PROCESSED_METADATA, JBossMetaData.class) != null && du.getAttachment(JBossMetaData.class).isEJB3x())
+ {
+ log.info("EJB metadata for " + du.toString());
+ for (JBossEnterpriseBeanMetaData enterpriseBeanMetaData : du.getAttachment(JBossMetaData.class).getEnterpriseBeans())
{
- log.info("EJB metadata for " + du.toString());
- for (JBossEnterpriseBeanMetaData enterpriseBeanMetaData : du.getAttachment(JBossMetaData.class).getEnterpriseBeans())
+ if (enterpriseBeanMetaData.isSession())
{
- if (enterpriseBeanMetaData.isSession())
- {
- JBossSessionBeanMetaData sessionBeanMetaData = (JBossSessionBeanMetaData) enterpriseBeanMetaData;
- EjbDescriptor<?> ejbDescriptor = new JBossSessionBeanDescriptorAdaptor<Object>(sessionBeanMetaData, du, resolver);
- log.info(ejbDescriptor.toString());
- ejbs.add(ejbDescriptor);
- }
- else if (enterpriseBeanMetaData.isMessageDriven())
- {
- JBossMessageDrivenBeanMetaData messageDrivenBeanMetaData = (JBossMessageDrivenBeanMetaData) enterpriseBeanMetaData;
- EjbDescriptor<?> ejbDescriptor = new JBossMessageDrivenBeanDescriptorAdaptor<Object>(messageDrivenBeanMetaData, du, resolver);
- log.info(ejbDescriptor.toString());
- ejbs.add(ejbDescriptor);
- }
+ JBossSessionBeanMetaData sessionBeanMetaData = (JBossSessionBeanMetaData) enterpriseBeanMetaData;
+ EjbDescriptor<?> ejbDescriptor = new JBossSessionBeanDescriptorAdaptor<Object>(sessionBeanMetaData, du, resolver);
+ log.info(ejbDescriptor.toString());
+ ejbs.add(ejbDescriptor);
}
+ else if (enterpriseBeanMetaData.isMessageDriven())
+ {
+ JBossMessageDrivenBeanMetaData messageDrivenBeanMetaData = (JBossMessageDrivenBeanMetaData) enterpriseBeanMetaData;
+ EjbDescriptor<?> ejbDescriptor = new JBossMessageDrivenBeanDescriptorAdaptor<Object>(messageDrivenBeanMetaData, du, resolver);
+ log.info(ejbDescriptor.toString());
+ ejbs.add(ejbDescriptor);
+ }
}
}
+ for (DeploymentUnit childDu : du.getChildren())
+ {
+ discoverEjbs(childDu);
+ }
}
/**
Modified: projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/JBossBussinessInterfaceDescriptorAdaptor.java
===================================================================
--- projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/JBossBussinessInterfaceDescriptorAdaptor.java 2008-12-17 16:31:59 UTC (rev 82346)
+++ projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/JBossBussinessInterfaceDescriptorAdaptor.java 2008-12-17 17:00:05 UTC (rev 82347)
@@ -39,4 +39,10 @@
return jndiName;
}
+ @Override
+ public String toString()
+ {
+ return getInterface() + " jndi name: " + getJndiName();
+ }
+
}
Modified: projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/JBossEJBDescriptorAdaptor.java
===================================================================
--- projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/JBossEJBDescriptorAdaptor.java 2008-12-17 16:31:59 UTC (rev 82346)
+++ projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/JBossEJBDescriptorAdaptor.java 2008-12-17 17:00:05 UTC (rev 82347)
@@ -57,11 +57,12 @@
{
builder.append(" (Singleton)");
}
- if (isStateful())
+ if (isMessageDriven())
{
builder.append(" (MDB)");
}
- return "; BeanClass: " + getType() + "; Local Business Interfaces: " + getLocalBusinessInterfaces();
+ builder.append("; BeanClass: " + getType() + "; Local Business Interfaces: " + getLocalBusinessInterfaces());
+ return builder.toString();
}
}
\ No newline at end of file
Modified: projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/JBossSessionBeanDescriptorAdaptor.java
===================================================================
--- projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/JBossSessionBeanDescriptorAdaptor.java 2008-12-17 16:31:59 UTC (rev 82346)
+++ projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/JBossSessionBeanDescriptorAdaptor.java 2008-12-17 17:00:05 UTC (rev 82347)
@@ -24,15 +24,21 @@
{
super(sessionBeanMetaData, deploymentUnit, resolver);
this.localBusinessInterfaces = new ArrayList<BusinessInterfaceDescriptor<?>>();
- for (String interfaceName : sessionBeanMetaData.getBusinessLocals())
+ if (sessionBeanMetaData.getBusinessLocals() != null)
{
- this.localBusinessInterfaces.add(new JBossBussinessInterfaceDescriptorAdaptor<Object>(interfaceName, getEjbName(), deploymentUnit, resolver));
+ for (String interfaceName : sessionBeanMetaData.getBusinessLocals())
+ {
+ this.localBusinessInterfaces.add(new JBossBussinessInterfaceDescriptorAdaptor<Object>(interfaceName, getEjbName(), deploymentUnit, resolver));
+ }
}
remoteBusinessInterfaces = new ArrayList<BusinessInterfaceDescriptor<?>>();
- for (String interfaceName : sessionBeanMetaData.getBusinessRemotes())
+ if (sessionBeanMetaData.getBusinessRemotes() != null)
{
- this.remoteBusinessInterfaces.add(new JBossBussinessInterfaceDescriptorAdaptor<Object>(interfaceName, getEjbName(), deploymentUnit, resolver));
+ for (String interfaceName : sessionBeanMetaData.getBusinessRemotes())
+ {
+ this.remoteBusinessInterfaces.add(new JBossBussinessInterfaceDescriptorAdaptor<Object>(interfaceName, getEjbName(), deploymentUnit, resolver));
+ }
}
this.removeMethods = new ArrayList<Method>();
More information about the jboss-cvs-commits
mailing list