1 package org.jacorb.test.orb.etf.wiop; 2 3 22 23 import org.omg.ETF.*; 24 25 29 public class WIOPConnection extends _ConnectionLocalBase 30 { 31 private int tag = 0; 32 private Connection delegate = null; 33 34 public WIOPConnection (Connection delegate, int tag) 35 { 36 this.delegate = delegate; 37 this.tag = tag; 38 } 39 40 public void write (boolean is_first, 41 boolean is_last, 42 byte[] data, 43 int offset, 44 int length, 45 long time_out) 46 { 47 WIOPFactories.transportInUse = true; 48 delegate.write (is_first, is_last, data, offset, length, time_out); 49 } 50 51 public void read (BufferHolder data, 52 int offset, 53 int min_length, 54 int max_length, 55 long time_out) 56 { 57 WIOPFactories.transportInUse = true; 58 delegate.read (data, offset, min_length, max_length, time_out); 59 } 60 61 public void flush() 62 { 63 delegate.flush(); 64 } 65 66 public void connect(Profile server_profile, long time_out) 67 { 68 if (server_profile instanceof WIOPProfile) 69 { 70 delegate.connect (((WIOPProfile)server_profile).getDelegate(), 71 time_out); 72 } 73 else 74 { 75 throw new org.omg.CORBA.BAD_PARAM 76 ( "attempt to connect an WIOP connection " 77 + "to a non-WIOP profile: " + server_profile.getClass()); 78 } 79 } 80 81 public void close() 82 { 83 delegate.close(); 84 } 85 86 public boolean is_connected() 87 { 88 return delegate.is_connected(); 89 } 90 91 public Profile get_server_profile() 92 { 93 return new WIOPProfile (delegate.get_server_profile(), 94 this.tag); 95 } 96 97 public boolean is_data_available() 98 { 99 return delegate.is_data_available(); 100 } 101 102 public boolean wait_next_data(long time_out) 103 { 104 return delegate.wait_next_data (time_out); 105 } 106 107 public boolean supports_callback() 108 { 109 return delegate.supports_callback(); 110 } 111 112 public boolean use_handle_time_out() 113 { 114 return delegate.use_handle_time_out(); 115 } 116 117 } 118 | Popular Tags |