User: docodan
Date: 01/06/03 14:19:52
Modified: src/main/org/jboss/ejb ContainerFactory.java
EntityContainer.java StatefulSessionContainer.java
StatelessSessionContainer.java
Log:
Checking for case where there is no remote container invoker.
Revision Changes Path
1.71 +7 -4 jboss/src/main/org/jboss/ejb/ContainerFactory.java
Index: ContainerFactory.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/ContainerFactory.java,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- ContainerFactory.java 2001/05/31 05:38:50 1.70
+++ ContainerFactory.java 2001/06/03 21:19:52 1.71
@@ -82,7 +82,7 @@
* @author Peter Antman ([EMAIL PROTECTED])
* @author Scott Stark([EMAIL PROTECTED])
*
-* @version $Revision: 1.70 $
+* @version $Revision: 1.71 $
*/
public class ContainerFactory
extends org.jboss.util.ServiceMBeanSupport
@@ -627,7 +627,8 @@
StatelessSessionContainer container = new StatelessSessionContainer();
int transType = ((SessionMetaData)bean).isContainerManagedTx() ?
ContainerInterceptors.CMT : ContainerInterceptors.BMT;
initializeContainer( container, conf, bean, transType, cl, localCl );
- container.setContainerInvoker( createContainerInvoker( conf, cl ) );
+ if (bean.getHome() != null)
+ container.setContainerInvoker( createContainerInvoker( conf, cl ) );
container.setInstancePool( createInstancePool( conf, cl ) );
//AS Test the exposure of the Container through a MBean
@@ -646,7 +647,8 @@
StatefulSessionContainer container = new StatefulSessionContainer();
int transType = ((SessionMetaData)bean).isContainerManagedTx() ?
ContainerInterceptors.CMT : ContainerInterceptors.BMT;
initializeContainer( container, conf, bean, transType, cl, localCl );
- container.setContainerInvoker( createContainerInvoker( conf, cl ) );
+ if (bean.getHome() != null)
+ container.setContainerInvoker( createContainerInvoker( conf, cl ) );
container.setInstanceCache( createInstanceCache( conf,
m_beanCacheJMSMonitoring, cl ) );
// No real instance pool, use the shadow class
container.setInstancePool( new StatefulSessionInstancePool() );
@@ -669,7 +671,8 @@
EntityContainer container = new EntityContainer();
int transType = ContainerInterceptors.CMT;
initializeContainer( container, conf, bean, transType, cl, localCl );
- container.setContainerInvoker( createContainerInvoker( conf, cl ) );
+ if (bean.getHome() != null)
+ container.setContainerInvoker( createContainerInvoker( conf, cl ) );
container.setInstanceCache( createInstanceCache( conf,
m_beanCacheJMSMonitoring, cl ) );
container.setInstancePool( createInstancePool( conf, cl ) );
1.38 +10 -4 jboss/src/main/org/jboss/ejb/EntityContainer.java
Index: EntityContainer.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/EntityContainer.java,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- EntityContainer.java 2001/06/03 18:48:12 1.37
+++ EntityContainer.java 2001/06/03 21:19:52 1.38
@@ -37,7 +37,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Sebastien Alborini</a>
* @author Daniel OConnor ([EMAIL PROTECTED])
-* @version $Revision: 1.37 $
+* @version $Revision: 1.38 $
*/
public class EntityContainer
extends Container
@@ -193,7 +193,8 @@
instancePool.init();
// Init container invoker
- containerInvoker.init();
+ if (containerInvoker != null)
+ containerInvoker.init();
// Init instance cache
instanceCache.init();
@@ -225,7 +226,8 @@
super.start();
// Start container invoker
- containerInvoker.start();
+ if (containerInvoker != null)
+ containerInvoker.start();
// Start instance cache
instanceCache.start();
@@ -258,6 +260,7 @@
super.stop();
// Stop container invoker
+ if (containerInvoker != null)
containerInvoker.stop();
// Stop instance cache
@@ -291,7 +294,8 @@
super.destroy();
// Destroy container invoker
- containerInvoker.destroy();
+ if (containerInvoker != null)
+ containerInvoker.destroy();
// Destroy instance cache
instanceCache.destroy();
@@ -360,6 +364,8 @@
public EJBHome getEJBHome(MethodInvocation mi)
throws java.rmi.RemoteException
{
+ if (containerInvoker == null)
+ throw new java.lang.IllegalStateException();
return containerInvoker.getEJBHome();
}
1.24 +17 -6 jboss/src/main/org/jboss/ejb/StatefulSessionContainer.java
Index: StatefulSessionContainer.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/StatefulSessionContainer.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- StatefulSessionContainer.java 2001/06/03 18:48:12 1.23
+++ StatefulSessionContainer.java 2001/06/03 21:19:52 1.24
@@ -33,7 +33,7 @@
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
* @author Daniel OConnor ([EMAIL PROTECTED])
- * @version $Revision: 1.23 $
+ * @version $Revision: 1.24 $
*/
public class StatefulSessionContainer
extends Container
@@ -179,7 +179,8 @@
setupHomeMapping();
// Init container invoker
- containerInvoker.init();
+ if (containerInvoker != null)
+ containerInvoker.init();
// Init instance cache
instanceCache.init();
@@ -214,7 +215,8 @@
super.start();
// Start container invoker
- containerInvoker.start();
+ if (containerInvoker != null)
+ containerInvoker.start();
// Start instance cache
instanceCache.start();
@@ -248,7 +250,8 @@
super.stop();
// Stop container invoker
- containerInvoker.stop();
+ if (containerInvoker != null)
+ containerInvoker.stop();
// Stop instance cache
instanceCache.stop();
@@ -284,7 +287,8 @@
super.destroy();
// Destroy container invoker
- containerInvoker.destroy();
+ if (containerInvoker != null)
+ containerInvoker.destroy();
// Destroy instance cache
instanceCache.destroy();
@@ -360,7 +364,8 @@
public EJBHome getEJBHome(MethodInvocation mi)
throws java.rmi.RemoteException
{
-
+ if (containerInvoker == null)
+ throw new java.lang.IllegalStateException();
return containerInvoker.getEJBHome();
}
@@ -386,6 +391,9 @@
throws java.rmi.RemoteException {
// All we need is an EJBObject for this Id, the first argument is the Id
+ if (containerInvoker == null)
+ throw new java.lang.IllegalStateException();
+
return containerInvoker.getStatefulSessionEJBObject(mi.getArguments()[0]);
}
@@ -405,6 +413,9 @@
public EJBMetaData getEJBMetaDataHome(MethodInvocation mi)
throws java.rmi.RemoteException
{
+ if (containerInvoker == null)
+ throw new java.lang.IllegalStateException();
+
return getContainerInvoker().getEJBMetaData();
}
1.18 +15 -5 jboss/src/main/org/jboss/ejb/StatelessSessionContainer.java
Index: StatelessSessionContainer.java
===================================================================
RCS file:
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/StatelessSessionContainer.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- StatelessSessionContainer.java 2001/06/03 18:48:12 1.17
+++ StatelessSessionContainer.java 2001/06/03 21:19:52 1.18
@@ -30,7 +30,7 @@
* @author Rickard �berg ([EMAIL PROTECTED])
* @author <a href="[EMAIL PROTECTED]">Marc Fleury</a>
* @author Daniel OConnor ([EMAIL PROTECTED])
-* @version $Revision: 1.17 $
+* @version $Revision: 1.18 $
*/
public class StatelessSessionContainer
extends Container
@@ -152,7 +152,8 @@
instancePool.init();
// Init container invoker
- containerInvoker.init();
+ if (containerInvoker != null)
+ containerInvoker.init();
// Initialize the interceptor by calling the chain
Interceptor in = interceptor;
@@ -178,7 +179,8 @@
super.start();
// Start container invoker
- containerInvoker.start();
+ if (containerInvoker != null)
+ containerInvoker.start();
// Start the instance pool
instancePool.start();
@@ -205,7 +207,8 @@
super.stop();
// Stop container invoker
- containerInvoker.stop();
+ if (containerInvoker != null)
+ containerInvoker.stop();
// Stop the instance pool
instancePool.stop();
@@ -232,7 +235,8 @@
super.destroy();
// Destroy container invoker
- containerInvoker.destroy();
+ if (containerInvoker != null)
+ containerInvoker.destroy();
// Destroy the pool
instancePool.destroy();
@@ -297,6 +301,9 @@
public EJBHome getEJBHome(MethodInvocation mi)
throws java.rmi.RemoteException
{
+ if (containerInvoker == null)
+ throw new java.lang.IllegalStateException();
+
return containerInvoker.getEJBHome();
}
@@ -310,6 +317,9 @@
public EJBObject createHome()
throws java.rmi.RemoteException, CreateException
{
+ if (containerInvoker == null)
+ throw new java.lang.IllegalStateException();
+
Object obj = containerInvoker.getStatelessSessionEJBObject();
return (EJBObject)obj;
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development