[Samuele]
>I'm working on the cache fix, as I wrote I would like to write different
>caches that are chosen depending on java 1.1/2 env
>and options from the config files.
>I have noticed that in general Options.setFromRegistry is called before the
>first PyJavaClass.lookup, which is good, but for example in the embedding
>case (e.g. SimpleEmbedded.java) when PythonInterpreter ctr is called without
>first issueing a
>Py.initialize, PyJavaClass.lookup is called before Options.setFromRegistry.
Yeah, the initialization is a little screwy. It probably didn't improve
when I made PySystemState subclass PyObject.
>Should we state that Py.initialize should be issued before using any other
>part of runtime.
I think that is acceptable if we enforce it in the code. If the
PySystemState.initialize() call is moved to the top the
PythonInterpreter(d, s) method we satisfy the requirement for the usual
cases. The remaining situations are where the developer is creating a
PySystemState by hand before calling the PythonInterpreter ctor. That
must be rare.
The Py.initPython() call in PyJavaClass.lookup() should then be changed
to the functional equivalent of an assert:
if (!PySystemState.initialized)
throw new IllegalStateException("PySystemState.initialized() "+
"not called")
regards,
finn
|