All things Jythonic 2005/4

April 2005
MoTuWeThFrSaSu
     1 2 3
4 5 6 7 8 910
11121314151617
18192021222324
252627282930 
Feb
2005
 May
2005

A blog tracking jython developments

XML-Image Syndication

XML-Image Comment Feed

Letterimage Contact me

2005-04-28

Jython, Velocity, Jetty and ... REST

Jason Briggs has put together a great article on REST ( Representational State Transfer ) style application development using Jython and Velocity on Jetty.  His goal is simpler servlet development that is more standards compliant.  You don't need to use Gets and Posts only and he shows you how to do it all with Jython.  He even includes as a resource in the article a jar file combining Velocity and the JythonUperspect customizer to let velocity work with Jython objects. 
 
posted at 22:25:04    #
2005-04-26

PushToTest - Free open-source software test automation solutions - Writing Threaded Applications in Jython

Here is a quick tutorial on writing thread safe jython scripts. The author implements thread safe examples using both Python and Java methods. Here is the article's conclusion

Based on my experience writing threaded applications in Jython, using Java Threads and the Runnable interface is the best practice. The following Jython script implements the best practice for building threaded applications in Jython:

from java.lang import Thread, Runnable
import synchronize

  class myclass( Runnable ):
    def __init__( self, myparam ):
      self.storeit = myparam

    def setMyparam( self, myparam ):
      self.storeit = myparam
    setMyparam=synchronize.make_synchronized( setMyparam )

    def printMyparam( self ):
      print "myclass: myparam =",self.storeit
    printMyparam=synchronize.make_synchronized( printMyparam )

    def run( self ):
      for self.i in range(5):
        self.printMyparam()

  count = 2

  a = myclass()
  a.setMyparam( "frank" )

  t = Thread( a, "MyThread %d" % count )
  t.start()
posted at 22:05:52    #
Creative Commons License
This work is licensed under a Creative Commons License.