| 266 | } |
| 267 | |
| 268 | jobject constructTransportInst(JNIEnv *jni, |
| 269 | OpenDDS::DCPS::TransportInst_rch inst) |
| 270 | { |
| 271 | jclass instClazz = 0; |
| 272 | if (inst->transport_type_ == "tcp") { |
| 273 | instClazz = findClass(jni, "OpenDDS/DCPS/transport/TcpInst"); |
| 274 | } else if (inst->transport_type_ == "udp") { |
| 275 | instClazz = findClass(jni, "OpenDDS/DCPS/transport/UdpInst"); |
| 276 | } else if (inst->transport_type_ == "multicast") { |
| 277 | instClazz = findClass(jni, "OpenDDS/DCPS/transport/MulticastInst"); |
| 278 | } else if (inst->transport_type_ == "rtps_udp") { |
| 279 | instClazz = findClass(jni, "OpenDDS/DCPS/transport/RtpsUdpInst"); |
| 280 | } else { |
| 281 | throw_java_exception(jni, OpenDDS::DCPS::Transport::UnableToCreate()); |
| 282 | } |
| 283 | jmethodID ctor = jni->GetMethodID(instClazz, "<init>", "(J)V"); |
| 284 | |
| 285 | jobject obj = jni->NewObject(instClazz, ctor, |
| 286 | reinterpret_cast<jlong>(inst._retn())); |
| 287 | jni->DeleteLocalRef(instClazz); |
| 288 | |
| 289 | return obj; |
| 290 | } |
| 291 | |
| 292 | // TheTransportRegistry |
| 293 |
no test coverage detected