User: starksm
Date: 02/03/03 10:23:08
Modified: src/main/org/jboss/ejb EnterpriseContext.java
InstancePool.java
MessageDrivenEnterpriseContext.java
StatelessSessionEnterpriseContext.java
Log:
Undo the ejbCreate related changes as this was just a brain fart due
to not reading the spec correctly in response to a bug report.
Revision Changes Path
1.45 +1 -7 jboss/src/main/org/jboss/ejb/EnterpriseContext.java
Index: EnterpriseContext.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/EnterpriseContext.java,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- EnterpriseContext.java 3 Mar 2002 17:20:05 -0000 1.44
+++ EnterpriseContext.java 3 Mar 2002 18:23:07 -0000 1.45
@@ -47,7 +47,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Sebastien Alborini</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Juha Lindfors</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Ole Husgaard</a>
- * @version $Revision: 1.44 $
+ * @version $Revision: 1.45 $
*
* Revisions:
* 2001/06/29: marcf
@@ -99,16 +99,10 @@
public EnterpriseContext(Object instance, Container con)
{
- this(instance, con, null);
- }
- public EnterpriseContext(Object instance, Container con,
- Principal callerPrincipal)
- {
this.instance = instance;
this.con = con;
- this.principal = callerPrincipal;
}
-
+
// Public --------------------------------------------------------
public Object getInstance()
1.12 +6 -14 jboss/src/main/org/jboss/ejb/InstancePool.java
Index: InstancePool.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/InstancePool.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- InstancePool.java 3 Mar 2002 17:20:05 -0000 1.11
+++ InstancePool.java 3 Mar 2002 18:23:07 -0000 1.12
@@ -6,7 +6,6 @@
*/
package org.jboss.ejb;
-import java.security.Principal;
import org.jboss.monitor.StatisticsProvider;
@@ -14,7 +13,7 @@
* Defines the model for a EnterpriseContext instance pool.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Rickard �berg</a>
- * @version $Revision: 1.11 $
+ * @version $Revision: 1.12 $
*
* <p><b>Revisions:</b>
* <p><b>20010718 andreas schaefer:</b>
@@ -31,33 +30,25 @@
extends ContainerPlugin, StatisticsProvider
{
/**
- * Add an instance in the Pool.
- * Is used by the TimedInstancePoolFeeder thread to create instances ready for
use by
- * the interceptor.
- * Since this can result in an ejbCreate invocation on a bean instance,
- * the caller principal must be associated with the EnterpriseContext
- * before calling ejbCreate in order for ctx.getCallerPrincipal() to
- * work.
+ * Add an instance in the Pool.
+ * Is used by the TimedInstancePoolFeeder thread to create instances ready for
use by
+ * the interceptor.
*
* @exception Exception when an Instance can not be instantiated
*/
- public void add(Principal callerPrincipal)
+ public void add()
throws Exception;
/**
* Get an instance without identity.
*
* <p>Can be used by finders and create-methods, or stateless beans
- * Since this can result in an ejbCreate invocation on a bean instance,
- * the caller principal must be associated with the EnterpriseContext
- * before calling ejbCreate in order for ctx.getCallerPrincipal() to
- * work.
*
* @return Context/w instance
*
* @throws Exception RemoteException
*/
- EnterpriseContext get(Principal callerPrincipal) throws Exception;
+ EnterpriseContext get() throws Exception;
/**
* Return an anonymous instance after invocation.
@@ -90,3 +81,4 @@
public int getMaxSize();
}
+
1.14 +7 -8 jboss/src/main/org/jboss/ejb/MessageDrivenEnterpriseContext.java
Index: MessageDrivenEnterpriseContext.java
===================================================================
RCS file:
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/MessageDrivenEnterpriseContext.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- MessageDrivenEnterpriseContext.java 3 Mar 2002 17:20:05 -0000 1.13
+++ MessageDrivenEnterpriseContext.java 3 Mar 2002 18:23:07 -0000 1.14
@@ -8,9 +8,11 @@
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
-import java.rmi.RemoteException;
+
import java.security.Principal;
+import java.rmi.RemoteException;
+
import javax.ejb.EJBContext;
import javax.ejb.EJBHome;
import javax.ejb.EJBObject;
@@ -29,7 +31,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Antman</a>.
* @author <a href="mailto:[EMAIL PROTECTED]">Rickard �berg</a>
* @author <a href="[EMAIL PROTECTED]">Sebastien Alborini</a>
- * @version $Revision: 1.13 $
+ * @version $Revision: 1.14 $
*/
public class MessageDrivenEnterpriseContext
extends EnterpriseContext
@@ -49,7 +51,7 @@
{
super(instance, con);
ctx = new MessageDrivenContextImpl();
-
+
((MessageDrivenBean)instance).setMessageDrivenContext(ctx);
try
@@ -57,8 +59,7 @@
Method ejbCreate = instance.getClass().getMethod("ejbCreate",
new Class[0]);
ejbCreate.invoke(instance, new Object[0]);
- }
- catch (InvocationTargetException e)
+ } catch (InvocationTargetException e)
{
Throwable ex = e.getTargetException();
if (ex instanceof EJBException)
@@ -80,15 +81,13 @@
// Here we have some problems. If we are to use the Stateless stuff,
// should we inherit from StatelessSessionEnterpriseContext or what?
- public void setEJBObject(EJBObject eo)
- {
+ public void setEJBObject(EJBObject eo) {
throw new Error("Not applicatable for MessageDrivenContext");
//NOOP
//ejbObject = eo;
}
- public EJBObject getEJBObject()
- {
+ public EJBObject getEJBObject() {
throw new Error("Not applicatable for MessageDrivenContext");
//return ejbObject;
}
1.16 +3 -5
jboss/src/main/org/jboss/ejb/StatelessSessionEnterpriseContext.java
Index: StatelessSessionEnterpriseContext.java
===================================================================
RCS file:
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/StatelessSessionEnterpriseContext.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- StatelessSessionEnterpriseContext.java 3 Mar 2002 17:20:05 -0000 1.15
+++ StatelessSessionEnterpriseContext.java 3 Mar 2002 18:23:07 -0000 1.16
@@ -9,7 +9,6 @@
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
import java.rmi.RemoteException;
-import java.security.Principal;
import javax.ejb.EJBContext;
import javax.ejb.EJBLocalObject;
import javax.ejb.EJBObject;
@@ -22,7 +21,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Rickard �berg</a>
* @author <a href="[EMAIL PROTECTED]">Sebastien Alborini</a>
- * @version $Revision: 1.15 $
+ * @version $Revision: 1.16 $
*/
public class StatelessSessionEnterpriseContext
extends EnterpriseContext
@@ -39,11 +38,10 @@
// Constructors --------------------------------------------------
- public StatelessSessionEnterpriseContext(Object instance, Container con,
- Principal callerPrincipal)
+ public StatelessSessionEnterpriseContext(Object instance, Container con)
throws Exception
{
- super(instance, con, callerPrincipal);
+ super(instance, con);
ctx = new SessionContextImpl();
((SessionBean)instance).setSessionContext(ctx);
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development