User: fleury
Date: 00/06/04 16:19:01
Modified: src/main/org/jboss/ejb Container.java EntityContainer.java
StatefulSessionContainer.java
Log:
Digging out the Alien bug, I put the debug traces (I need to work from home tonight)
I will remove them as soon as it is done.
Note: the MethodInvocation code is fixed now there is something in the container as
well... (wrong number of arguments) something tells me that the lookup is the same and
still very screwed up ... we need to change the container ways of looking the methods
up.
It will speed it up (precalculate and dont use a static map) as well as (hopefully)
make it work
Revision Changes Path
1.13 +9 -7 jboss/src/main/org/jboss/ejb/Container.java
Index: Container.java
===================================================================
RCS file: /products/cvs/ejboss/jboss/src/main/org/jboss/ejb/Container.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Container.java 2000/06/02 05:56:37 1.12
+++ Container.java 2000/06/04 23:19:00 1.13
@@ -63,7 +63,7 @@
* @see ContainerFactory
* @author Rickard �berg ([EMAIL PROTECTED])
* @author <a href="[EMAIL PROTECTED]">Marc Fleury</a>
- * @version $Revision: 1.12 $
+ * @version $Revision: 1.13 $
*/
public abstract class Container
{
@@ -385,8 +385,10 @@
Iterator enum = getMetaData().getEjbReferences();
while(enum.hasNext())
{
+
jBossEjbReference ref = (jBossEjbReference)enum.next();
-
+ System.out.println("Binding an EJBReference "+ref);
+
Name n = ctx.getNameParser("").parse(ref.getLink());
if (!ref.getJndiName().equals(""))
@@ -528,13 +530,13 @@
}
public static class EjbReferenceFactory
- implements ObjectFactory
+ implements ObjectFactory
{
public Object getObjectInstance(Object ref,
- Name name,
- Context nameCtx,
- Hashtable environment)
- throws Exception
+ Name
name,
+
Context nameCtx,
+
Hashtable environment)
+ throws
Exception
{
Object con = ((Reference)ref).get(0).getContent();
if (con instanceof EntityContainer)
1.8 +23 -4 jboss/src/main/org/jboss/ejb/EntityContainer.java
Index: EntityContainer.java
===================================================================
RCS file: /products/cvs/ejboss/jboss/src/main/org/jboss/ejb/EntityContainer.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- EntityContainer.java 2000/06/01 23:23:26 1.7
+++ EntityContainer.java 2000/06/04 23:19:00 1.8
@@ -33,7 +33,7 @@
* @see EntityEnterpriseContext
* @author Rickard �berg ([EMAIL PROTECTED])
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
*/
public class EntityContainer
extends Container
@@ -255,6 +255,8 @@
public EJBObject createHome(Method m, Object[] args, EntityEnterpriseContext ctx)
throws java.rmi.RemoteException, CreateException
{
+ System.out.println("In creating Home
"+m.getDeclaringClass()+m.getName()+m.getParameterTypes().length);
+
getPersistenceManager().createEntity(m, args, ctx);
return ctx.getEJBObject();
}
@@ -288,6 +290,7 @@
Method[] m = homeInterface.getMethods();
for (int i = 0; i < m.length; i++)
{
+ System.out.println("THE NEW METHOD IS
"+m[i].getName()+m[i].getParameterTypes().length);
try
{
// Implemented by container
@@ -356,15 +359,24 @@
public Object invokeHome(Method method, Object[] args, EnterpriseContext ctx)
throws Exception
{
+
+ //Debug
+ System.out.println("InvokingHome "+method.getName());
+ //Debug
+
Method m = (Method)homeMapping.get(method);
// Invoke and handle exceptions
- try
+ try
{
return m.invoke(EntityContainer.this, new Object[] { method, args,
ctx});
} catch (InvocationTargetException e)
{
- Throwable ex = e.getTargetException();
+ //Debug
+ e.printStackTrace();
+ System.out.println("Home Exception seen "+e.getMessage());
+ //Debug
+ Throwable ex = e.getTargetException();
if (ex instanceof Exception)
throw (Exception)ex;
else
@@ -377,6 +389,10 @@
{
// Get method
Method m = (Method)beanMapping.get(method);
+
+ //Debug
+ System.out.println("InvokingBean "+method.getName());
+ //Debug
// Select instance to invoke (container or bean)
if (m.getDeclaringClass().equals(EntityContainer.class))
@@ -387,7 +403,10 @@
return m.invoke(EntityContainer.this, new Object[] { method, args,
ctx });
} catch (InvocationTargetException e)
{
- Throwable ex = e.getTargetException();
+ //Debug
+ System.out.println("Bean Exception seen "+e.getMessage());
+ //Debug
+ Throwable ex = e.getTargetException();
if (ex instanceof Exception)
throw (Exception)ex;
else
1.9 +7 -2 jboss/src/main/org/jboss/ejb/StatefulSessionContainer.java
Index: StatefulSessionContainer.java
===================================================================
RCS file:
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/StatefulSessionContainer.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- StatefulSessionContainer.java 2000/06/01 23:48:23 1.8
+++ StatefulSessionContainer.java 2000/06/04 23:19:00 1.9
@@ -31,7 +31,7 @@
*
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
- * @version $Revision: 1.8 $
+ * @version $Revision: 1.9 $
*/
public class StatefulSessionContainer
extends Container
@@ -246,7 +246,12 @@
public EJBObject createHome(Method m, Object[] args,
StatefulSessionEnterpriseContext ctx)
throws java.rmi.RemoteException, CreateException
{
- getPersistenceManager().createSession(m, args, ctx);
+
+ System.out.println("The context is "+ctx);
+
+ System.out.println("In creating Home
"+m.getDeclaringClass()+m.getName()+m.getParameterTypes().length);
+
+ getPersistenceManager().createSession(m, args, ctx);
return ctx.getEJBObject();
}