JRemote.java

00001 
00027 package org.objectweb.jonas_ejb.container;
00028 
00029 import java.rmi.NoSuchObjectException;
00030 import java.rmi.RemoteException;
00031 
00032 import javax.ejb.EJBObject;
00033 import javax.rmi.PortableRemoteObject;
00034 
00035 import org.objectweb.util.monolog.api.BasicLevel;
00036 
00042 public abstract class JRemote extends PortableRemoteObject implements EJBObject {
00043 
00044     protected JFactory bf;
00045 
00050     public JRemote(JFactory bf) throws RemoteException {
00051         TraceEjb.interp.log(BasicLevel.DEBUG, "");
00052         this.bf = bf;
00053     }
00054 
00055     // --------------------------------------------------------------------------
00056     // EJBObject implementation
00057     // --------------------------------------------------------------------------
00058 
00059     // --------------------------------------------------------------------------
00060     // Export / UnExport Object
00061     // Due to the fact that this object extends RemoteObject, it is
00062     // automatically
00063     // exported when built. We just need to unexport it when unused, and to re
00064     // export
00065     // it if we reuse it again.
00066     // --------------------------------------------------------------------------
00067 
00072     public boolean exportObject() {
00073         TraceEjb.interp.log(BasicLevel.DEBUG, "");
00074         try {
00075             exportObject(this);
00076         } catch (Exception e) {
00077             TraceEjb.logger.log(BasicLevel.ERROR, "cannot export:" + e);
00078             return false;
00079         }
00080         return true;
00081     }
00082 
00086     public void unexportObject() throws NoSuchObjectException {
00087         TraceEjb.interp.log(BasicLevel.DEBUG, "");
00088         unexportObject(this);
00089     }
00090 
00094     public JFactory getBf() {
00095         return bf;
00096     }
00097 }

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