User: ejort
Date: 02/03/05 10:41:47
Modified: src/main/org/jboss/ejb EntityContainer.java
StatefulSessionContainer.java
Log:
Add support for create<METHOD>
Revision Changes Path
1.71 +15 -6 jboss/src/main/org/jboss/ejb/EntityContainer.java
Index: EntityContainer.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/EntityContainer.java,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- EntityContainer.java 28 Feb 2002 19:39:07 -0000 1.70
+++ EntityContainer.java 5 Mar 2002 18:41:45 -0000 1.71
@@ -61,7 +61,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Daniel OConnor</a>
* @author <a href="[EMAIL PROTECTED]">Bill Burke</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Andreas Schaefer</a>
-* @version $Revision: 1.70 $
+* @version $Revision: 1.71 $
*
* <p><b>Revisions:</b>
*
@@ -754,14 +754,18 @@
String append )
throws DeploymentException
{
+ // Adrian Brock: This should go away when we don't support EJB1x
+ boolean isEJB1x = metaData.getApplicationMetaData().isEJB1x();
+
for (int i = 0; i < m.length; i++)
{
+ String methodName = m[i].getName();
try
{
try // Try home method
{
- String methodName = "ejbHome" +
Character.toUpperCase(m[i].getName().charAt(0)) + m[i].getName().substring(1);
- map.put(m[i], beanClass.getMethod(methodName,
m[i].getParameterTypes()));
+ String ejbHomeMethodName = "ejbHome" +
methodName.substring(0,1).toUpperCase() + methodName.substring(1);
+ map.put(m[i], beanClass.getMethod(ejbHomeMethodName,
m[i].getParameterTypes()));
continue;
} catch (NoSuchMethodException e)
@@ -770,12 +774,17 @@
}
// Implemented by container (in both cases)
- if (m[i].getName().startsWith("find"))
+ if (methodName.startsWith("find"))
{
map.put(m[i], this.getClass().getMethod(finderName, new Class[] {
Invocation.class }));
- }else
+ }
+ else if (isEJB1x == false && methodName.startsWith("create"))
+ {
+ map.put(m[i], this.getClass().getMethod("createHome", new Class[] {
Invocation.class }));
+ }
+ else
{
- map.put(m[i], this.getClass().getMethod(m[i].getName()+append, new
Class[] { Invocation.class }));
+ map.put(m[i], this.getClass().getMethod(methodName+append, new
Class[] { Invocation.class }));
}
} catch (NoSuchMethodException e)
{
1.44 +21 -9 jboss/src/main/org/jboss/ejb/StatefulSessionContainer.java
Index: StatefulSessionContainer.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/StatefulSessionContainer.java,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- StatefulSessionContainer.java 15 Feb 2002 00:17:28 -0000 1.43
+++ StatefulSessionContainer.java 5 Mar 2002 18:41:45 -0000 1.44
@@ -32,7 +32,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Daniel OConnor</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Scott Stark</a>
-* @version $Revision: 1.43 $
+* @version $Revision: 1.44 $
*
* <p><b>Revisions</b>
* <p><b>20010704</b>
@@ -513,11 +513,15 @@
protected void setupHomeMapping()
throws NoSuchMethodException
{
+ // Adrian Brock: This should go away when we don't support EJB1x
+ boolean isEJB1x = metaData.getApplicationMetaData().isEJB1x();
+
+ boolean infoEnabled = log.isInfoEnabled();
+
Map map = new HashMap();
if (homeInterface != null)
{
- boolean infoEnabled = log.isInfoEnabled();
Method[] m = homeInterface.getMethods();
for (int i = 0; i < m.length; i++)
@@ -525,9 +529,14 @@
try
{
// Implemented by container
- map.put(m[i], getClass().getMethod(m[i].getName()+"Home", new Class[]
- { Invocation.class }));
- } catch (NoSuchMethodException e)
+ if (isEJB1x == false && m[i].getName().startsWith("create"))
+ map.put(m[i], getClass().getMethod("createHome", new Class[]
+ { Invocation.class }));
+ else
+ map.put(m[i], getClass().getMethod(m[i].getName()+"Home", new
Class[]
+ { Invocation.class }));
+ }
+ catch (NoSuchMethodException e)
{
if (infoEnabled)
log.info(m[i].getName() + " in bean has not been mapped");
@@ -537,17 +546,20 @@
if (localHomeInterface != null)
{
- boolean infoEnabled = log.isInfoEnabled();
-
Method[] m = localHomeInterface.getMethods();
for (int i = 0; i < m.length; i++)
{
try
{
// Implemented by container
- map.put(m[i], getClass().getMethod(m[i].getName()+"LocalHome", new
Class[]
+ if (isEJB1x == false && m[i].getName().startsWith("create"))
+ map.put(m[i], getClass().getMethod("createLocalHome", new Class[]
+ { Invocation.class }));
+ else
+ map.put(m[i], getClass().getMethod(m[i].getName()+"LocalHome",
new Class[]
{ Invocation.class }));
- } catch (NoSuchMethodException e)
+ }
+ catch (NoSuchMethodException e)
{
if (infoEnabled)
log.info(m[i].getName() + " in bean has not been mapped");
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development