User: docodan
Date: 01/06/04 14:42:28
Modified: src/main/org/jboss/ejb EnterpriseContext.java
Log:
Implemented getEJBLocalHome
Revision Changes Path
1.29 +29 -2 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.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- EnterpriseContext.java 2001/06/04 17:22:24 1.28
+++ EnterpriseContext.java 2001/06/04 21:42:27 1.29
@@ -41,7 +41,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Sebastien Alborini</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Juha Lindfors</a>
- * @version $Revision: 1.28 $
+ * @version $Revision: 1.29 $
*/
public abstract class EnterpriseContext
{
@@ -208,14 +208,20 @@
{
if (con instanceof EntityContainer)
{
+ if (((EntityContainer)con).getContainerInvoker()==null)
+ throw new IllegalStateException( "No remote home defined." );
return ((EntityContainer)con).getContainerInvoker().getEJBHome();
}
else if (con instanceof StatelessSessionContainer)
{
+ if (((StatelessSessionContainer)con).getContainerInvoker()==null)
+ throw new IllegalStateException( "No remote home defined." );
return
((StatelessSessionContainer)con).getContainerInvoker().getEJBHome();
}
else if (con instanceof StatefulSessionContainer)
{
+ if (((StatefulSessionContainer)con).getContainerInvoker()==null)
+ throw new IllegalStateException( "No remote home defined." );
return
((StatefulSessionContainer)con).getContainerInvoker().getEJBHome();
}
{
@@ -226,7 +232,28 @@
public EJBLocalHome getEJBLocalHome()
{
- throw new EJBException("Not implemented yet");
+ if (con instanceof EntityContainer)
+ {
+ if (((EntityContainer)con).getLocalHomeClass()==null)
+ throw new IllegalStateException( "No local home defined." );
+ return
((EntityContainer)con).getLocalContainerInvoker().getEJBLocalHome();
+ }
+ else if (con instanceof StatelessSessionContainer)
+ {
+ if (((StatelessSessionContainer)con).getLocalHomeClass()==null)
+ throw new IllegalStateException( "No local home defined." );
+ return
((StatelessSessionContainer)con).getLocalContainerInvoker().getEJBLocalHome();
+ }
+ else if (con instanceof StatefulSessionContainer)
+ {
+ if (((StatefulSessionContainer)con).getLocalHomeClass()==null)
+ throw new IllegalStateException( "No local home defined." );
+ return
((StatefulSessionContainer)con).getLocalContainerInvoker().getEJBLocalHome();
+ }
+ {
+ // Should never get here
+ throw new EJBException("No EJBLocalHome available (BUG!)");
+ }
}
/**
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development