[jboss-cvs] JBossAS SVN: r82430 - 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
Thu Dec 18 18:34:56 EST 2008
Author: petemuir
Date: 2008-12-18 18:34:55 -0500 (Thu, 18 Dec 2008)
New Revision: 82430
Added:
projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/JBossMethodDescriptor.java
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/JBossMessageDrivenBeanDescriptorAdaptor.java
projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/JBossSessionBeanDescriptorAdaptor.java
Log:
updates
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-18 21:59:45 UTC (rev 82429)
+++ projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/JBossEJBDescriptorAdaptor.java 2008-12-18 23:34:55 UTC (rev 82430)
@@ -65,4 +65,24 @@
return builder.toString();
}
+ @Override
+ public boolean equals(Object other)
+ {
+ if (other instanceof EjbDescriptor)
+ {
+ EjbDescriptor<T> that = (EjbDescriptor<T>) other;
+ return this.getEjbName().equals(that.getEjbName());
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return getEjbName().hashCode();
+ }
+
}
\ No newline at end of file
Modified: projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/JBossMessageDrivenBeanDescriptorAdaptor.java
===================================================================
--- projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/JBossMessageDrivenBeanDescriptorAdaptor.java 2008-12-18 21:59:45 UTC (rev 82429)
+++ projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/JBossMessageDrivenBeanDescriptorAdaptor.java 2008-12-18 23:34:55 UTC (rev 82430)
@@ -1,11 +1,10 @@
package org.jboss.webbeans.integration.jbossas.ejb3;
-import java.lang.reflect.Method;
-
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.ejb3.common.resolvers.spi.EjbReferenceResolver;
import org.jboss.metadata.ejb.jboss.JBossMessageDrivenBeanMetaData;
import org.jboss.webbeans.bootstrap.spi.BusinessInterfaceDescriptor;
+import org.jboss.webbeans.bootstrap.spi.MethodDescriptor;
public class JBossMessageDrivenBeanDescriptorAdaptor<T> extends JBossEJBDescriptorAdaptor<T>
{
@@ -29,7 +28,7 @@
return null;
}
- public Iterable<Method> getRemoveMethods()
+ public Iterable<MethodDescriptor> getRemoveMethods()
{
// Not relevant for MDBs
return null;
Added: projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/JBossMethodDescriptor.java
===================================================================
--- projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/JBossMethodDescriptor.java (rev 0)
+++ projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/JBossMethodDescriptor.java 2008-12-18 23:34:55 UTC (rev 82430)
@@ -0,0 +1,51 @@
+package org.jboss.webbeans.integration.jbossas.ejb3;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.metadata.ejb.spec.NamedMethodMetaData;
+import org.jboss.webbeans.bootstrap.spi.MethodDescriptor;
+
+public class JBossMethodDescriptor implements MethodDescriptor
+{
+
+ private Class<?> declaringClass;
+ private String methodName;
+ private Class<?>[] methodParameterTypes;
+
+ public JBossMethodDescriptor(Class<?> declaringClass, NamedMethodMetaData namedMethodMetaData, DeploymentUnit deploymentUnit)
+ {
+ this.declaringClass = declaringClass;
+ this.methodName = namedMethodMetaData.getMethodName();
+ this.methodParameterTypes = new Class<?>[namedMethodMetaData.getMethodParams().size()];
+ for (int i = 0; i < methodParameterTypes.length; i++)
+ {
+ try
+ {
+ this.methodParameterTypes[i] = deploymentUnit.getClassLoader().loadClass(namedMethodMetaData.getMethodParams().get(0));
+ }
+ catch (ClassCastException e)
+ {
+ throw new IllegalStateException("Error loading remove method parameter type", e);
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new IllegalStateException("Cannot load remove method parameter type", e);
+ }
+ }
+ }
+
+ public Class<?> getDeclaringClass()
+ {
+ return declaringClass;
+ }
+
+ public String getMethodName()
+ {
+ return methodName;
+ }
+
+ public Class<?>[] getMethodParameterTypes()
+ {
+ return methodParameterTypes;
+ }
+
+}
Property changes on: projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/JBossMethodDescriptor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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-18 21:59:45 UTC (rev 82429)
+++ projects/webbeans-ri-int/trunk/jbossas/src/main/java/org/jboss/webbeans/integration/jbossas/ejb3/JBossSessionBeanDescriptorAdaptor.java 2008-12-18 23:34:55 UTC (rev 82430)
@@ -1,21 +1,22 @@
package org.jboss.webbeans.integration.jbossas.ejb3;
-import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.ejb3.common.resolvers.spi.EjbReferenceResolver;
import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
+import org.jboss.metadata.ejb.spec.RemoveMethodMetaData;
import org.jboss.webbeans.bootstrap.spi.BusinessInterfaceDescriptor;
import org.jboss.webbeans.bootstrap.spi.EjbDescriptor;
+import org.jboss.webbeans.bootstrap.spi.MethodDescriptor;
public class JBossSessionBeanDescriptorAdaptor<T> extends JBossEJBDescriptorAdaptor<T> implements EjbDescriptor<T>
{
private final List<BusinessInterfaceDescriptor<?>> localBusinessInterfaces;
private final List<BusinessInterfaceDescriptor<?>> remoteBusinessInterfaces;
- private final List<Method> removeMethods;
+ private final List<MethodDescriptor> removeMethods;
private final boolean stateful;
private final boolean stateless;
private final boolean singleton;
@@ -41,11 +42,16 @@
}
}
- this.removeMethods = new ArrayList<Method>();
- // TODO populate remove methods
+ this.removeMethods = new ArrayList<MethodDescriptor>();
+
+ if (sessionBeanMetaData.getRemoveMethods() != null)
+ {
+ for (RemoveMethodMetaData removeMethodMetaData : sessionBeanMetaData.getRemoveMethods())
+ {
+ removeMethods.add(new JBossMethodDescriptor(getType(), removeMethodMetaData.getBeanMethod(), deploymentUnit));
+ }
+ }
-
-
this.stateful = sessionBeanMetaData.isStateful();
this.stateless = sessionBeanMetaData.isStateless();
this.singleton = false;
@@ -61,7 +67,7 @@
return remoteBusinessInterfaces;
}
- public Iterable<Method> getRemoveMethods()
+ public Iterable<MethodDescriptor> getRemoveMethods()
{
return removeMethods;
}
More information about the jboss-cvs-commits
mailing list