734 CopierManager cm = lorb.getCopierManager() ;
735 ObjectCopier copier = cm.getDefaultObjectCopierFactory().make() ;
736 return copier.copy( obj ) ;
737 }
738 } catch (ReflectiveCopyException exc) {
739 RemoteException rexc = new RemoteException() ;
740 rexc.initCause( exc ) ;
741 throw rexc ;
742 }
743 } else {
744 org.omg.CORBA_2_3.portable.OutputStream out =
745 (org.omg.CORBA_2_3.portable.OutputStream)orb.create_output_stream();
746 out.write_value((Serializable)obj);
747 org.omg.CORBA_2_3.portable.InputStream in =
748 (org.omg.CORBA_2_3.portable.InputStream)out.create_input_stream();
749 return in.read_value();
750 }
751 }
752 }
753
754 class KeepAlive extends sun.misc.ManagedLocalsThread
755 {
756 boolean quit = false;
757
758 public KeepAlive ()
759 {
760 setDaemon(false);
761 }
762
763 public synchronized void run ()
764 {
765 while (!quit) {
766 try {
767 wait();
768 } catch (InterruptedException e) {}
769 }
770 }
771
772 public synchronized void quit ()
773 {
774 quit = true;
775 notifyAll();
776 }
777 }
|
734 CopierManager cm = lorb.getCopierManager() ;
735 ObjectCopier copier = cm.getDefaultObjectCopierFactory().make() ;
736 return copier.copy( obj ) ;
737 }
738 } catch (ReflectiveCopyException exc) {
739 RemoteException rexc = new RemoteException() ;
740 rexc.initCause( exc ) ;
741 throw rexc ;
742 }
743 } else {
744 org.omg.CORBA_2_3.portable.OutputStream out =
745 (org.omg.CORBA_2_3.portable.OutputStream)orb.create_output_stream();
746 out.write_value((Serializable)obj);
747 org.omg.CORBA_2_3.portable.InputStream in =
748 (org.omg.CORBA_2_3.portable.InputStream)out.create_input_stream();
749 return in.read_value();
750 }
751 }
752 }
753
754 class KeepAlive extends Thread
755 {
756 boolean quit = false;
757
758 public KeepAlive ()
759 {
760 super(null, null, "Servant-KeepAlive-Thread", 0, false);
761 setDaemon(false);
762 }
763
764 public synchronized void run ()
765 {
766 while (!quit) {
767 try {
768 wait();
769 } catch (InterruptedException e) {}
770 }
771 }
772
773 public synchronized void quit ()
774 {
775 quit = true;
776 notifyAll();
777 }
778 }
|