Changeset 7817 for trunk/legacy/jvmlink
- Timestamp:
- 11/24/11 15:58:03 (8 years ago)
- Location:
- trunk/legacy/jvmlink/src/main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/legacy/jvmlink/src/main/c++/JVMLinkClient.cpp
r7813 r7817 54 54 //TODO: clear memory at appropriate points. 55 55 56 JVMException::JVMException(const std::string& aMessage) throw() 57 { 58 mMessage = aMessage; 59 } 60 61 JVMException::~JVMException() throw() 62 { 63 } 64 65 const char* JVMException::what() const throw() 66 { 67 return mMessage.c_str(); 68 } 69 70 56 71 JVMLinkClient::JVMLinkClient(void) 57 72 { … … 64 79 // -- Public API methods -- 65 80 66 void JVMLinkClient::startJava( int arg_port, const std::string& classpath) {81 void JVMLinkClient::startJava(unsigned short arg_port, const std::string& classpath) { 67 82 port = arg_port == 0 ? DEFAULT_PORT : arg_port; 68 83 std::stringstream tmpportstr; … … 235 250 sendInt(EXEC_CMD); 236 251 sendMessage(command); 252 int status = readInt(); 253 if (status != 0) { 254 std::string vMessage = *readString(); 255 JVMException vJVMException(vMessage); 256 throw vJVMException; 257 } 237 258 } 238 259 -
trunk/legacy/jvmlink/src/main/c++/JVMLinkClient.h
r7813 r7817 42 42 //#define debug(msg) std::cout << "JVMLinkClient: " << msg << std::endl 43 43 44 class JVMException : public std::exception 45 { 46 public: 47 JVMException(const std::string& aMessage) throw (); 48 virtual ~JVMException() throw (); 49 50 virtual const char* what() const throw(); 51 52 private: 53 std::string mMessage; 54 }; 55 56 44 57 class JVMLinkClient 45 58 { 46 59 private: 47 int port;60 unsigned short port; 48 61 #ifdef _WIN32 49 62 SOCKET conn; … … 68 81 69 82 JVMLinkClient(); 70 void startJava( int, const std::string&);83 void startJava(unsigned short, const std::string&); 71 84 void shutJava(); 72 85 ConnectionCode establishConnection(); -
trunk/legacy/jvmlink/src/main/java/loci/jvmlink/ConnThread.java
r7816 r7817 685 685 String cmd = readString(); 686 686 debug("exec: " + cmd); 687 r.exec(cmd); 687 try { 688 r.exec(cmd); 689 writeInt(0); 690 out.flush(); 691 } catch (ReflectException exc) { 692 writeInt(1); 693 out.flush(); 694 writeString(exc.getMessage()); 695 out.flush(); 696 697 throw exc; 698 } 688 699 } 689 700
Note: See TracChangeset
for help on using the changeset viewer.