/** * Export a Remote Object on all available protocols * @param Remote object to export * @exception RemoteException exporting remote object problem */ public void exportObject(Remote obj) throws RemoteException { if (TraceCarol.isDebugRmiCarol()) { TraceCarol.debugRmiCarol("MultiPRODelegate.exportObject(" +simpleClass(obj.getClass().getName()) +" obj)"); } try { if (!init) { initProtocols(); } for (Enumeration e = activesProtocols.elements(); e.hasMoreElements() ;) { ((PortableRemoteObjectDelegate)e.nextElement()).exportObject(obj); } if (TraceCarol.isDebugExportCarol()) { TraceCarol.debugExportCarol("Export object "+obj.getClass().getName()); addObject(obj.getClass().getName()); } } catch (Exception ex) { String msg = "MultiPRODelegate.exportObject(Remote obj) fail"; TraceCarol.error(msg,ex); throw new RemoteException(msg); } }
/** * Method for unexport object on all available protocols * @param Remote obj object to unexport * @exception NoSuchObjectException if the object is not currently exported */ public void unexportObject(Remote obj) throws NoSuchObjectException { if (TraceCarol.isDebugRmiCarol()) { TraceCarol.debugRmiCarol("MultiPRODelegate.unexportObject(" +simpleClass(obj.getClass().getName()) +" obj)"); } try { if (!init) { initProtocols(); } for (Enumeration e = activesProtocols.elements(); e.hasMoreElements() ;) { ((PortableRemoteObjectDelegate)e.nextElement()).unexportObject(obj); } if (TraceCarol.isDebugExportCarol()) { TraceCarol.debugExportCarol("Unexport object "+obj.getClass().getName()); TraceCarol.debugExportCarol("UnExported objects list:\n"+getUnexportedObjects()); removeObject(obj.getClass().getName()); } } catch (Exception ex) { String msg = "MultiPRODelegate.unexportObject(Remote obj) fail"; TraceCarol.error(msg,ex); throw new NoSuchObjectException(msg); } }