Re: [jboss-user] [jBPM] - Problems with usage python language in jpdl.xml
by Huisheng Xu
Huisheng Xu [http://community.jboss.org/people/rebody] replied to the discussion
"Problems with usage python language in jpdl.xml"
To view the discussion, visit: http://community.jboss.org/message/534370#534370
--------------------------------------------------------------
Now jBPM 4 could support JUEL, beanshell and groovy, If you want to use python in jpdl.xml, you should create a new ScriptEngineFactory, may be PythonScriptEngineFactory and put it into <script-manager>.
The default <script-manager> configuration is as following:
<?xml version="1.0" encoding="UTF-8"?>
<jbpm-configuration>
<process-engine-context>
<script-manager default-expression-language="juel"
default-script-language="juel">
<script-language name="juel" factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
<script-language name="bsh" factory="org.jbpm.pvm.internal.script.BshScriptEngineFactory" />
<script-language name="groovy" factory="org.jbpm.pvm.internal.script.GroovyScriptEngineFactory" />
</script-manager>
</process-engine-context>
</jbpm-configuration>
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/534370#534370]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 11 months
[Javassist] - Saving proxy classes and using them in Android
by Eric H
Eric H [http://community.jboss.org/people/EricJava] created the discussion
"Saving proxy classes and using them in Android"
To view the discussion, visit: http://community.jboss.org/message/534357#534357
--------------------------------------------------------------
I am new to the wonderful world of Javassist, and I now have a question:
I have used the very easy and convenient ProxyFactory in the usual way:
{code} final ProxyFactory proxyFactory = new ProxyFactory();
proxyFactory.writeDirectory = "/tmp";
proxyFactory.setSuperclass(Invoice.class);
final MethodHandler methodHandler = new MethodHandler() {
public Object invoke(Object self, Method m, Method proceed,
Object[] args) throws Throwable {
System.out.println("Name: " + m.getName());
return proceed.invoke(self, args); // execute the original method.
}
};
proxyFactory.setFilter(new MethodFilter() {
public boolean isHandled(Method m) {
// ignore finalize()
return !m.getName().equals("finalize");
}
});
final Class klass = proxyFactory.createClass();
Invoice invoice = (Invoice) klass.newInstance();
((ProxyObject) invoice).setHandler(methodHandler);
{code}
That works great. When I call methods on the invoice object there, I immediately see that my MethodHandler is invoked. Super-cool!
Also, it does one more thing: it saves a new class file, with a name like Invoice_$$_javassist_0.class .
What I would like to do is be able to use that generated class, without needing to have the bytecode present. The reason for this is I want to use it within Android, and Android doesn't use regular class files. If I can use the ProxyFactory to write out the class files, then I can build my Android DEX files using those class files. But I don't know how to load or make use of the generated files like Invoice_$$_javassist_0.class.
Does my question make sense? I assume that ProxyFactory is able to save those class files for a good reason, but I can't find out how to make use of them.
Thanks
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/534357#534357]
Start a new discussion in Javassist at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 11 months