As per advised by Jim, I created a pull request in the bitbucket as following:

    * https://bitbucket.org/jython/jython/pull-request/33/adding-bytecode-notification-mechanism-to/diff

I tried my best to reflect Jim's advice/feedback. (thanks Jim!)
Please let me know what you guys think :)

Thanks,

-Jiwon



On Mon, Apr 28, 2014 at 1:46 AM, Jiwon Seo <jiwon@stanford.edu> wrote:
Thank you very much for your advice!

Here is an updated patch. I added modules/bcn.java (ByteCodeNotification) to add test code in Python.

Thanks,

-Jiwon


On Thu, Apr 24, 2014 at 4:58 PM, Jim Baker <james.edward.baker@gmail.com> wrote:

In general this looks good and quite useful. I especially how it works around the current special casing of Options.proxyDebugDirectory, which I would otherwise like to see die ;), especially given how that is really superseded with Clamp. Some thoughts:

  • Jython-project specific - we don’t use @author tags, because that gets confusing over time, once multiple developers touch a piece of code. So we prefer hg blame.

  • No commenting out of code :)

  • Need some support for unregistration of a notifier

  • Eventually you will need to have some tests before someone like myself can merge this in. We tend to prefer to have these tests written in Python. See the various *_jy.py tests for some ideas on how to structure.

  • Given the approach you have taken, a CopyOnWriteArrayList does makes sense.

– Jim




On April 23, 2014 at 1:09:51 AM, Jiwon Seo (jiwon@stanford.edu) wrote:

Hi,

After a brief discussion with Jim Baker, I added a very simple notification mechanism so that if new bytecode is generated, it notifies registered callbacks. I think this could be useful in a distributed system (for example) where Jython functions need to be replicated across cluster machines. It's very simple, and isolated from the rest of the system, so it doesn't add any complexity. This can replace (for example) LegacyCompiler::saveCode(). 

I attached the patch in this email; I didn't completely clean up for Py.saveClassFile yet, but I can do it once you guys think this is fine. Please let me know what you guys think.

Thanks,

-Jiwon

------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform_______________________________________________
Jython-dev mailing list
Jython-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-dev