In WebLogic, there's the WLST (WebLogic Scripting Tool) which is similar to WebSphere wsadmin. The nice thing about WLST is that you can import it as a module into other jython code and use it without any dependencies.
Here's link that discusses this:
http://ghattus.com/2006/01/06/wlst-as-a-jython-module/
Is the same thing possible with WebSphere wsadmin?
No.
wsadmin is "scripting framework" not originally created with jython in mind. It was intented to be used with TCL. After that it was "abstracted" so that (m)any popular scripting languages can be used inplace of TCL, and only Jython was provided by actual WAS instalation.
Leaving an api desing which is certainly not very pythonic or efficient.
Anyway neither of 5 main objects of wsadmin are python objects, and some of them are even constructed (like source code is being literally created with merging strings) as wsadmin loads.
But you can do something else. wsadmin can be run outside WAS as standalone program. And it can be even upgraded with jython 2.5, so you can run newer python code within wsadmin.
Hope this helps..
Related
Unfortunately I found no examples for this topic.
I want to deploy my own application written by python and I using PySide (LGPL-licensed) for GUI surface. How can I link libraries dynamically? (in this case the application has not be opensource). Does the .exe binary code generated by pyinstaller or py2exe also dynamically binded?
Thanks a lot!
Best regards
I've used DCEVM hotswap technology in eclipse and IntelliJ IDE which was pretty cool feature. By using DCEVM in IDE what I can do is, I can change into the source code i.e add/remove/edit method, classes, properties at the runtime without doing restart the program.
Now my question is:
I want to apply the same features in my running application which is run without using any IDE. To be more specific the running applications source code(compiled code) can change on the fly. And for that bytecode how to deploy on DCEVM for runtime hotswapping?
What I've found is:
We can do hotSwapping without using IDE for that we can write own JNI code to directly hook into JVMTI and trigger a hotswap.
any idea/help would be much helpfull. thanks
Fortunately I found the solution.We can use the HotSwapper plugin to solve this kind of problem. The same question is asked in dcevm discussion forume:
https://groups.google.com/forum/#!topic/hotswapagent/Uk3cUdkHNYQ
Although the information from this link https://news.ycombinator.com/item?id=3198497 is very helpfull but it was asked four years ago, so that I was stuck in.
Now the DCEVM is being more smart It can support various plugin such as Hotswapper, AnonymousClassPatch, WatchResources, Hibernate, Spring, Jersey2, Jetty, Tomcat, ZK, Logback, JSF, Seam, ELResolver, OsgiEquinox and even we can write own plugin too which is more easy to develope.
I want to configure Python/Jython in IBM BPM, so that these files can directly executed from process app. How can I do that?
How to setup this entry in WebSphere Application Server?
Why do you need to install python or jython on IBM BPM , if you need it to make deploy using WAS command line , there're commands that not related to jython or python and can do the same.
I don't believe that IBM BPM Standard really handles this use case (although more details would help). It is possible it maybe part of the "Advanced" offering, but I'm not as familiar with the integration designer product.
IBM BPM Standard allows you to call java code directly either as LiveConnect (bad) or executing java code you place in JAR files in the server files of your Process App (good). I have seen this used to leverage the Java ability to call command line scripts in order to issue some of the WASAdmin scripts, but that has been the limit of the integration with jython that I have seen.
For details about creating Java connectors you can use this article - http://www.ibm.com/developerworks/bpm/bpmjournal/1206_olivieri/1206_olivieri.html. While it says 7.5.1 the approach works for TeamWorks 7 through IBM BPM 8.5.5
Can you give more details about the use case you are trying to meet with this technical approach?
You can call any system process api/command using java, java code can be called by using as jar libraries.
System process api/command can execute python or any other code.
IBM BPM > Jar libs > System (OS) Process API/Commands > Python
I haven't come across any such use case.
How is the versioning of Jython? If I install Jython 2.5 does it mean that I can program in Python 2.5 syntax in spite of Python3.3 or the Jython versioning system is dependent?
By now the last version of Jython available for production is 2.5.3. If the versioning of Jython is based on Python, it looks deluding to be able to program only In Python 2.5 or earlier.
Jython x.y.z means that it's spec compatible with Python x.y, e.g. Jython 2.5.3 is compatible with Python 2.5 versions. (Python 2.5 introduced the "with" statement aka context manage. This has been implemented in Jython 2.5.)
As implementing each new version is a lot of work and the Jython project has not enough resources to keep up with all versions it was decided to not implement all intermediate versions.
The PyPy project aims to avoid this by abstracting and automating the transformation to a concrete runtime system (native, jvm, .net, etc.)
I don't understand the part "in spite of Python 3.3" in your question.
1.3 Is Jython the same language as Python?
Yes. Jython is an implementation of the Python language in Java. We strive to ensure that Jython remains as compatible with CPython as possible. The latest Jython release (2.2) implements the same language as CPython 2.2 and many of the CPython standard library modules.
There are two incompatibilities with modern CPython that often catch newcomers. First, Jython 2.2 does not implement any features added to CPython in version 2.3 or later. This includes language features such as decorators, and library modules such as optparse. A more modern version of Jython is under active development.
Second, Jython programs cannot use CPython extension modules written in C. These modules usually have files with the extension .pyc, .pyd or .dll. If you want to use such a module, you should look for an equivalent written in pure Python or Java.
There are a number of other differences between the two implementations that are unlikely to go away. These range from the trivial - Jython's code objects don't have a co_code attribute because they don't have any Python bytecodes; to the significant - Jython uses Java's true garbage collection rather than Python's reference counting scheme.
http://jython.sourceforge.net/docs/differences.html
Python has never really had much of a language definition beyond it's C-based implementation. The existence of Jython changed that for the first time and will hopefully lead to a much clearer sense of what Python the language is; independent of any specific implementation.
From: http://www.jython.org/archive/22/userfaq.html#id4
To me it seems that you only have access to Python2.5 if you are using Jython 2.5.3.
I'm looking to write a cli replacement for elasticfox.
Would be nice to use python / ruby / bash or something alike.
This is a side project to make our Ubuntu environment a bit more fun, so as much abstraction as possible - I'm loving it :).
If you like Python, there's:
Several 3rd party EC2 modules: http://pypi.python.org/pypi?:action=search&term=ec2&submit=search
A built-in ncurses library: http://docs.python.org/library/curses.html#module-curses
A nice and powerful ncurses alternative called 'urwid': http://excess.org/urwid/
You could also use bash and a curses based dialog program like whiptail or dialog. The dialog program also has an X equivalent, Xdialog.
This can be useful for very simple, quick and dirty, or POC work.
Or use Perl.
EC2: https://metacpan.org/pod/Net::Amazon::EC2
Curses: http://search.cpan.org/search?query=curses&mode=module (plenty of modules with different grades of abstraction)