[jboss-cvs] JBossAS SVN: r86162 - in projects/ejb3/trunk/nointerface/src: test/java/org/jboss/ejb3/nointerface/test/common and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Mar 20 09:14:32 EDT 2009
Author: jaikiran
Date: 2009-03-20 09:14:32 -0400 (Fri, 20 Mar 2009)
New Revision: 86162
Modified:
projects/ejb3/trunk/nointerface/src/main/java/org/jboss/ejb3/nointerface/invocationhandler/MCAwareNoInterfaceViewInvocationHandler.java
projects/ejb3/trunk/nointerface/src/test/java/org/jboss/ejb3/nointerface/test/common/MockStatefulContainer.java
projects/ejb3/trunk/nointerface/src/test/java/org/jboss/ejb3/nointerface/test/common/MockStatelessContainer.java
Log:
EJBTHREE-1781 Fix the compilation errors (SessionProxy no longer exists)
Modified: projects/ejb3/trunk/nointerface/src/main/java/org/jboss/ejb3/nointerface/invocationhandler/MCAwareNoInterfaceViewInvocationHandler.java
===================================================================
--- projects/ejb3/trunk/nointerface/src/main/java/org/jboss/ejb3/nointerface/invocationhandler/MCAwareNoInterfaceViewInvocationHandler.java 2009-03-20 08:40:29 UTC (rev 86161)
+++ projects/ejb3/trunk/nointerface/src/main/java/org/jboss/ejb3/nointerface/invocationhandler/MCAwareNoInterfaceViewInvocationHandler.java 2009-03-20 13:14:32 UTC (rev 86162)
@@ -24,11 +24,11 @@
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
+import javax.ejb.EJBContainer;
import org.jboss.dependency.spi.ControllerState;
import org.jboss.ejb3.common.lang.SerializableMethod;
import org.jboss.ejb3.proxy.spi.container.InvokableContext;
-import org.jboss.ejb3.proxy.spi.intf.SessionProxy;
import org.jboss.kernel.spi.dependency.KernelControllerContext;
import org.jboss.logging.Logger;
@@ -64,12 +64,10 @@
*/
private KernelControllerContext containerContext;
-
/**
- * The {@link MCAwareNoInterfaceViewInvocationHandler} and the {@link InvokableContext} interact
- * with each other through a {@link SessionProxy}
+ * The target (=sessionId) used to interact with the {@link InvokableContext}
*/
- private SessionProxy sessionProxy;
+ private Object target;
/**
* Constructor
@@ -79,7 +77,7 @@
{
assert containerContext != null : "Container context is null for no-interface view invocation handler";
this.containerContext = containerContext;
- this.sessionProxy = new NoInterfaceViewSessionProxy(target);
+ this.target = target;
}
/**
@@ -93,14 +91,13 @@
*/
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
{
- assert this.sessionProxy != null : "Cannot invoke the container without the " + SessionProxy.class.getName();
// TODO: Some methods like toString() can be handled locally.
// But as of now let's just pass it on to the container.
-
-
+
if (logger.isTraceEnabled())
{
- logger.trace("Pushing the container context to INSTALLED state from its current state = " + this.containerContext.getState().getStateString());
+ logger.trace("Pushing the container context to INSTALLED state from its current state = "
+ + this.containerContext.getState().getStateString());
}
// first push the context corresponding to the container to INSTALLED
this.containerContext.getController().change(this.containerContext, ControllerState.INSTALLED);
@@ -108,7 +105,7 @@
InvokableContext container = (InvokableContext) this.containerContext.getTarget();
// finally pass on the control to the container
SerializableMethod serializableMethod = new SerializableMethod(method);
- return container.invoke(this.sessionProxy, serializableMethod, args);
+ return container.invoke(this.target, serializableMethod, args);
}
/**
@@ -121,55 +118,4 @@
return this.containerContext;
}
-
-
- /**
- *
- * NoInterfaceViewSessionProxy
- *
- * A {@link SessionProxy} implementation for the no-interface view.
- * Used by the {@link MCAwareNoInterfaceViewInvocationHandler} to interact
- * with the {@link InvokableContext}
- *
- * @author Jaikiran Pai
- * @version $Revision: $
- */
- private class NoInterfaceViewSessionProxy implements SessionProxy
- {
-
- /**
- * The target of an invocation on the {@link MCAwareNoInterfaceViewInvocationHandler} - used as a sessionId
- */
- private Object target;
-
- public NoInterfaceViewSessionProxy(Object target)
- {
- this.target = target;
- }
-
- /**
- * @see SessionProxy#getTarget()
- */
- public Object getTarget()
- {
- return this.target;
- }
-
- /**
- * @see SessionProxy#setTarget(Object)
- */
- public void setTarget(Object target)
- {
- this.target = target;
- }
-
- public void removeTarget() throws UnsupportedOperationException
- {
- // Is this enough?
- this.target = null;
-
- }
-
- }
-
}
Modified: projects/ejb3/trunk/nointerface/src/test/java/org/jboss/ejb3/nointerface/test/common/MockStatefulContainer.java
===================================================================
--- projects/ejb3/trunk/nointerface/src/test/java/org/jboss/ejb3/nointerface/test/common/MockStatefulContainer.java 2009-03-20 08:40:29 UTC (rev 86161)
+++ projects/ejb3/trunk/nointerface/src/test/java/org/jboss/ejb3/nointerface/test/common/MockStatefulContainer.java 2009-03-20 13:14:32 UTC (rev 86162)
@@ -31,7 +31,6 @@
import org.jboss.ejb3.common.lang.SerializableMethod;
import org.jboss.ejb3.proxy.spi.container.InvokableContext;
import org.jboss.ejb3.proxy.spi.container.StatefulSessionFactory;
-import org.jboss.ejb3.proxy.spi.intf.SessionProxy;
/**
* MockStatefulContainer
@@ -81,13 +80,13 @@
}
/**
- * @see InvokableContext#invoke(SessionProxy, SerializableMethod, Object[])
+ * @see InvokableContext#invoke(Object, SerializableMethod, Object[])
*/
- public Object invoke(SessionProxy proxy, SerializableMethod method, Object[] args) throws Throwable
+ public Object invoke(Object proxy, SerializableMethod method, Object[] args) throws Throwable
{
- // get the bean instance using the target (=sessionId) from the SessionProxy
- Object target = proxy.getTarget();
- assert target instanceof Long : "Unexcepted target in SessionProxy. Expected a session id of type Long";
+ // get the bean instance using the target (=sessionId)
+ Object target = proxy;
+ assert target instanceof Long : "Unexcepted session. Expected a session id of type Long";
Long sessionid = (Long) target;
Object beanInstance = sessions.get(sessionid);
Method invokedMethod = method.toMethod();
Modified: projects/ejb3/trunk/nointerface/src/test/java/org/jboss/ejb3/nointerface/test/common/MockStatelessContainer.java
===================================================================
--- projects/ejb3/trunk/nointerface/src/test/java/org/jboss/ejb3/nointerface/test/common/MockStatelessContainer.java 2009-03-20 08:40:29 UTC (rev 86161)
+++ projects/ejb3/trunk/nointerface/src/test/java/org/jboss/ejb3/nointerface/test/common/MockStatelessContainer.java 2009-03-20 13:14:32 UTC (rev 86162)
@@ -27,7 +27,6 @@
import org.jboss.aop.joinpoint.InvocationResponse;
import org.jboss.ejb3.common.lang.SerializableMethod;
import org.jboss.ejb3.proxy.spi.container.InvokableContext;
-import org.jboss.ejb3.proxy.spi.intf.SessionProxy;
/**
* MockStatelessContainer
@@ -67,9 +66,9 @@
}
/**
- * @see InvokableContext#invoke(SessionProxy, SerializableMethod, Object[])
+ * @see InvokableContext#invoke(Object, SerializableMethod, Object[])
*/
- public Object invoke(SessionProxy proxy, SerializableMethod method, Object[] args) throws Throwable
+ public Object invoke(Object proxy, SerializableMethod method, Object[] args) throws Throwable
{
// nothing fancy, just pass on the invocation to the bean class instance
Method invokedMethod = method.toMethod();
More information about the jboss-cvs-commits
mailing list