From: Paul G. <pau...@so...> - 2001-07-20 08:02:20
|
I am currently have a side project that will do something like this. It = is a module that implements a telnet daemon that runs as a java thread. = When someone connects, it starts a jython interpreter and uses this as=20 the shell for user interaction. Thus, if this is embedded in a running=20 server, you can connect using an ordinary telnet client and manipulate=20 object running in the same VM. This is still work in progress, but some = of the sticky points so far: - Implementing telnet: I tried to find a java telnet daemon that I=20 could adapt or borrow code from. There does not seem to be any yet. Also= =20 getting complete and understandable documentation for the telnet protoco= l=20 is not that easy (every time I use a new telnet client, it starts trying= =20 to negotiate some other connection parameter that i cannot find in any=20 documentation). - There has to be a way to get references to the other objects that=20 you want to manipulate. This can be as simple as placing references to=20 all of the objects that you want to manipulate into a hashtable that is = statically initialized or available through a singleton. It just need to= =20 be done in advance, otherwise the jython interpreter winds up more or=20 less isolated from the rest of the application. - If I try to run multiple instances of jython interpreters in=20 different threads, bad things start to happen. It is not really critical= =20 that I handle multiple connections simultaneously, but I would not expec= t=20 this to be a problem. :-( AFAIK it is also possible to remotely connect to a running VM using the = Java debugging API (if the VM was started with debugging options on), so= =20 if you go this route, you do not need to provide your own interpreter in= =20 that VM, but jython might be helpful in making a simple client. The idea of the project above is to do more high level interaction, like= =20 reconfiguration, at runtime. -Paul > I am experimenting with Jython at the moment. I am impressed. > I was wondering if any jython-guru's have used it to debug Java code. > I guess you could run the Jython interpretor in a seperate thread to t= he > program you're trying to debug. You could then stop the thread from=20 jython > and inspect the state of its attributes and test calling some of the > methods. > This would be very handy for experimenting with swing gui's. > Has anybody experimented with some of the Java debugger api's? It may = even > be possible to set break points on particular methods. > Any Ideas would be appreciated. > Thanks, > Greg. |