JSessionHome.java

00001 
00026 package org.objectweb.jonas_ejb.container;
00027 
00028 import java.rmi.Remote;
00029 import java.rmi.RemoteException;
00030 import java.util.List;
00031 
00032 import javax.ejb.RemoveException;
00033 
00034 import org.objectweb.jonas_ejb.deployment.api.SessionDesc;
00035 import org.objectweb.jonas_ejb.lib.EJBInvocation;
00036 
00037 import org.objectweb.util.monolog.api.BasicLevel;
00038 
00045 public abstract class JSessionHome extends JHome implements Remote {
00046 
00052     public JSessionHome(SessionDesc dd, JSessionFactory bf) throws RemoteException {
00053         super(dd, bf);
00054         TraceEjb.interp.log(BasicLevel.DEBUG, "");
00055     }
00056 
00057     public RequestCtx preInvoke(int txa) throws RemoteException {
00058         // The connection List depends on the instance, so it must be
00059         // set to null in case of Home method (create).
00060         // only for stateful
00061         bf.getTransactionManager().pushThreadLocalRMEventList(null);
00062         return super.preInvoke(txa);
00063     }
00064 
00065     public void postInvoke(RequestCtx rctx) throws RemoteException {
00066         super.postInvoke(rctx);
00067         // save the connection List for future methods on the bean.
00068         // only for stateful
00069         List newList = bf.getTransactionManager().popThreadLocalRMEventList();
00070             JSessionContext ctx = (JSessionContext) rctx.ejbContext;
00071             if (ctx != null) {
00072             ctx.setConnectionList(newList);
00073             }
00074     }
00075 
00076     // ---------------------------------------------------------------
00077     // EJBHome implementation
00078     // remove(Handle) method is in the generated part.
00079     // other methods are in JHome (identical for Sessions and Entities)
00080     // ---------------------------------------------------------------
00081 
00087     public void remove(java.lang.Object pk) throws RemoteException, RemoveException {
00088         throw new RemoveException("remove by PK Cannot be called in a session bean");
00089     }
00090 
00091     // ---------------------------------------------------------------
00092     // other public methods, for internal use.
00093     // ---------------------------------------------------------------
00094 
00100     public abstract JSessionRemote createRemoteObject() throws RemoteException;
00101 
00102 }

Generated on Tue Feb 15 15:05:42 2005 for JOnAS by  doxygen 1.3.9.1