You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
(6) |
Nov
(8) |
Dec
(2) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(19) |
Feb
(15) |
Mar
(10) |
Apr
(8) |
May
(7) |
Jun
(9) |
Jul
(13) |
Aug
(31) |
Sep
(111) |
Oct
(52) |
Nov
(72) |
Dec
(42) |
| 2006 |
Jan
(21) |
Feb
(32) |
Mar
(33) |
Apr
(24) |
May
(15) |
Jun
(40) |
Jul
(32) |
Aug
(19) |
Sep
(38) |
Oct
(37) |
Nov
(63) |
Dec
(37) |
| 2007 |
Jan
(18) |
Feb
(39) |
Mar
(69) |
Apr
(49) |
May
(71) |
Jun
(59) |
Jul
(71) |
Aug
(85) |
Sep
(46) |
Oct
(14) |
Nov
(25) |
Dec
(56) |
| 2008 |
Jan
(24) |
Feb
(77) |
Mar
(104) |
Apr
(44) |
May
(41) |
Jun
(11) |
Jul
(31) |
Aug
(59) |
Sep
(44) |
Oct
(86) |
Nov
(66) |
Dec
(93) |
| 2009 |
Jan
(88) |
Feb
(41) |
Mar
(49) |
Apr
(135) |
May
(22) |
Jun
(31) |
Jul
(60) |
Aug
(71) |
Sep
(76) |
Oct
(18) |
Nov
(52) |
Dec
(20) |
| 2010 |
Jan
(8) |
Feb
(50) |
Mar
(35) |
Apr
(48) |
May
(46) |
Jun
(84) |
Jul
(38) |
Aug
(61) |
Sep
(51) |
Oct
(31) |
Nov
(17) |
Dec
(18) |
| 2011 |
Jan
(51) |
Feb
(14) |
Mar
(17) |
Apr
(23) |
May
(15) |
Jun
(11) |
Jul
(5) |
Aug
(5) |
Sep
(15) |
Oct
(8) |
Nov
(5) |
Dec
(25) |
| 2012 |
Jan
(2) |
Feb
(4) |
Mar
(6) |
Apr
(9) |
May
(27) |
Jun
(32) |
Jul
(36) |
Aug
(10) |
Sep
(16) |
Oct
(3) |
Nov
(13) |
Dec
(7) |
| 2013 |
Jan
(1) |
Feb
(4) |
Mar
|
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(4) |
Oct
(2) |
Nov
(1) |
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
(2) |
Apr
(1) |
May
(2) |
Jun
(9) |
Jul
(5) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
|
Dec
|
| 2015 |
Jan
(3) |
Feb
(2) |
Mar
(4) |
Apr
(3) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(2) |
Sep
(5) |
Oct
(1) |
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(5) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
(6) |
Feb
|
Mar
|
Apr
(10) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
| 2018 |
Jan
(2) |
Feb
(5) |
Mar
|
Apr
|
May
(1) |
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
| 2021 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2023 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
1
|
2
(1) |
3
(1) |
|
4
|
5
(3) |
6
(6) |
7
(6) |
8
(10) |
9
(6) |
10
|
|
11
(5) |
12
(5) |
13
(1) |
14
|
15
(2) |
16
(2) |
17
(4) |
|
18
(3) |
19
(3) |
20
(7) |
21
(5) |
22
(7) |
23
(1) |
24
(4) |
|
25
|
26
(3) |
27
(2) |
28
(1) |
29
|
30
|
31
|
|
From: <php...@li...> - 2009-01-18 18:38:54
|
Hi Jost, > Do you want to resolve the parameter or the argument? > I assume you want to unwrap the wrapped PHP object. > It might be a good idea to extend java_values() this way. I think in order to avoid confusion between "argument" and "parameter", I would say I want to "unwrap" the wrapped PHP object. But: invokeA() is called with a $Proxy0-object (ID v="4") How should java_values() be able to "unwrap" the proxy in order to get the actual PHP object which has been wrapped before using java_closure() resulting in an object with ID v="3"? It is not clear to me how this "ID-mapping" should work!? > However you can always access your PHP object through other mechanisms. Any hint how? What I already tried on the Java-side is to get a handle on the object that has been created with java_closure(). But I could not find out how to come from the $Proxy0-object to the PhpProcedure (which I assume is the one which has ID v="3" which I'm looking for). Other question regarding Java.inc: invokeBegin() is defined like this: function invokeBegin($object, $method) but called so: $client->protocol->invokeBegin(0, "makeClosure", "5", "6"); What's the meaning of "5" and "6" if invokeBegin() can only accept 2 parameters? Regards Jürgen -----Ursprüngliche Nachricht----- Von: php...@li... [mailto:php...@li...] Gesendet: Samstag, 18. Januar 2009 15:21 An: php...@li... Betreff: Re: [Php-java-bridge-users] How to wrap two PHP objects asjavaclosures,and in Java call a method on the first closure with the secondclosureas parameter? > Why shouldn't it be possible to resolve the actual > parameter $b to the actual PHP-object directly on the > PHP-side without going back to Java? Do you want to resolve the parameter or the argument? I assume you want to unwrap the wrapped PHP object. It might be a good idea to extend java_values() this way. However you can always access your PHP object through other mechanisms. Regards, Jost Bökemeier |
|
From: <php...@li...> - 2009-01-18 15:21:46
|
> Why shouldn't it be possible to resolve the actual
> parameter $b to the actual PHP-object directly on the
> PHP-side without going back to Java?
Do you want to resolve the parameter or the argument? I assume you want to unwrap the wrapped PHP object. It might be a good idea to extend java_values() this way.
However you can always access your PHP object through other mechanisms.
Regards,
Jost Bökemeier
|
|
From: <php...@li...> - 2009-01-18 10:34:47
|
Hi Jost,
> "But I don't understand why you insist using your own test case..."
Sorry, that I didn't explain yet:
The actual reason is that my whole setup is different (which maybe of interest for as well):
I don't use a web environment at all.
I have my PHP script in a file and call PHP from the command line.
Java-Bridge is running standalone.
So, the initiator for all communication is PHP (and not Java using the script engine like you do).
It didn't work at the beginning, but after modyfing Java.inc (e.g. changing ports 8080 to 9267, creating SimpleHandler instead of HttpHandler) it worked.
At the beginning I thought that my code should be understandable/reproducable for you.
But after I realized that in order to do so, you have to modify Java.inc, it seems clear to me, that no one may have done it like this before.
Anyway, I understood something from your latest reply:
With "use the same procedure as above" you meant use it in PHP instead of Java, like this:
> String classA = "class A{function toString(){return '::A';} function invokeA($b){java('java.lang.reflect.Proxy')->getInvocationHandler($b)->invoke($b, "invokeB", array());}}\n";
(this wasn't the case in your first example)
I also think these two lines are not necessary anymore:
> interface IA { public void invokeA(IB ccb); };
> interface IB { public void invokeB(); };
My test case now works (also without the two lines above) - thanks so far.
But still my general question is not answered:
Why shouldn't it be possible to resolve the actual parameter $b to the actual PHP-object directly on the PHP-side without going back to Java?
I thought that if you call java_closure($b) and later a method gets invoked on $b then the bridge first resolves $b and the method gets invoked directly on the PHP-object $b.
Is there any way to avoid this round-trip?
Regards Jürgen
-----Ursprüngliche Nachricht-----
Von: php...@li... [mailto:php...@li...]
Gesendet: Samstag, 17. Januar 2009 19:45
An: php...@li...
Betreff: Re: [Php-java-bridge-users] How to wrap two PHP objects asjavaclosures,and in Java call a method on the first closure with the secondclosureas parameter?
Hi Juergen,
I really don't understand the problem. I have posted a test case which does what you want.
I do understand that you don't have the information to resolve the type, so that you must call the methods through the reflection API.
But I don't understand why you insist using your own test case, which cannot work, because you confuse the proxy with the invocation handler.
-------------------------------------
package test;
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.OutputStreamWriter;
import javax.script.Invocable;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
public class TestGetInterface {
/**
* @param args
*/
public static void main(String[] args) throws Throwable {
//System.setProperty("php.java.bridge.default_log_file", "");
//System.setProperty("php.java.bridge.default_log_level", "3");
new TestGetInterface().doWork();
}
private ScriptEngine scriptEngine;
String classA = "class A{function toString(){return '::A';} function invokeA($b){java('java.lang.reflect.Proxy')->getInvocationHandler($b)->invoke($b, "invokeB", array());}}\n";
String classB = "class B{function toString(){return '::B';} function invokeB(){echo '::B';}}\n";
String test = "<?php "+classA+classB+" $thiz=java_context()->getAttribute('thiz');\n$thiz->call(java_closure(new A()), java_closure(new B())); ?>";
private void doWork() throws Throwable {
scriptEngine = new ScriptEngineManager().getEngineByName("php-invocable");
scriptEngine.put("thiz", this);
ByteArrayOutputStream out;
OutputStreamWriter writer;
scriptEngine.getContext().setWriter(writer = new OutputStreamWriter(out = new ByteArrayOutputStream()));
scriptEngine.eval(test);
((Closeable)scriptEngine).close();
writer.close();
if(!"::B".equals(out.toString())) {
System.err.println("test failed");
System.exit(1);
}
System.out.println("test okay");
System.exit(0);
}
interface IA { public void invokeA(IB ccb); };
interface IB { public void invokeB(); };
public void call(Object $cca, Object $ccb) throws Throwable {
((php.java.bridge.PhpProcedure)java.lang.reflect.Proxy.getInvocationHandler($cca)).invoke($cca, "invokeA", new Object[]{$ccb});
}
}
--------------
> So, what did you mean with "use the same procedure as above"?
Use the Java reflection API. The above example shows how to do this in PHP and in Java.
Regards,
Jost Boekemeier
|