[jboss-cvs] JBossAS SVN: r63495 - in trunk/ejb3/src: test/org/jboss/ejb3/test/ejbcontext and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Jun 13 09:27:03 EDT 2007
Author: bdecoste
Date: 2007-06-13 09:27:03 -0400 (Wed, 13 Jun 2007)
New Revision: 63495
Added:
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/StatefulLocalOnly.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/StatefulLocalOnlyBean.java
Modified:
trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulContainer.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/unit/EjbContextUnitTestCase.java
Log:
[EJBTHREE-991] SessionContext.getBusinessObject(..) for SFSB with no Remote interface
Modified: trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulContainer.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulContainer.java 2007-06-13 12:44:08 UTC (rev 63494)
+++ trunk/ejb3/src/main/org/jboss/ejb3/stateful/StatefulContainer.java 2007-06-13 13:27:03 UTC (rev 63495)
@@ -862,7 +862,7 @@
Class[] localInterfaces = ProxyFactoryHelper.getLocalInterfaces(this);
if (localInterfaces != null)
{
- for (Class intf : remoteInterfaces)
+ for (Class intf : localInterfaces)
{
if (intf.getName().equals(businessInterface.getName()))
{
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/StatefulLocalOnly.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/StatefulLocalOnly.java (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/StatefulLocalOnly.java 2007-06-13 13:27:03 UTC (rev 63495)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.ejbcontext;
+
+/**
+ *
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+public interface StatefulLocalOnly
+{
+ public Object getBusinessObject() throws Exception;
+}
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/StatefulLocalOnlyBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/StatefulLocalOnlyBean.java (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/StatefulLocalOnlyBean.java 2007-06-13 13:27:03 UTC (rev 63495)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.ejbcontext;
+
+import javax.annotation.Resource;
+import javax.ejb.Local;
+import javax.ejb.SessionContext;
+import javax.ejb.Stateful;
+
+
+import org.jboss.annotation.ejb.LocalBinding;
+import org.jboss.logging.Logger;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+ at Stateful(name="StatefulLocalOnly")
+ at Local(StatefulLocalOnly.class)
+ at LocalBinding(jndiBinding="StatefulLocalOnly")
+public class StatefulLocalOnlyBean
+ implements StatefulLocalOnly
+{
+ private static final Logger log = Logger.getLogger(StatefulLocalOnlyBean.class);
+
+ @Resource
+ SessionContext sessionContext;
+
+ public Object getBusinessObject() throws Exception
+ {
+ return sessionContext.getBusinessObject(org.jboss.ejb3.test.ejbcontext.StatefulLocalOnly.class);
+ }
+}
Modified: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/unit/EjbContextUnitTestCase.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/unit/EjbContextUnitTestCase.java 2007-06-13 12:44:08 UTC (rev 63494)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbcontext/unit/EjbContextUnitTestCase.java 2007-06-13 13:27:03 UTC (rev 63495)
@@ -192,6 +192,13 @@
}
}
+ public void testLocalOnlyGetBusinessObject() throws Exception
+ {
+ StatefulRemote sfsb = (StatefulRemote)getInitialContext().lookup("StatefulRemote");
+ Object o = sfsb.testLocalOnlyGetBusinessObject();
+ assertNotNull(o);
+ }
+
public static Test suite() throws Exception
{
return getDeploySetup(EjbContextUnitTestCase.class, "ejbcontext.jar");
More information about the jboss-cvs-commits
mailing list