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-17 19:02:51
|
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
|
|
From: <php...@li...> - 2009-01-17 18:45:33
|
Hi,
> $ccb is and has been your Proxy$0, so how can the same
> object have two object numbers?
Not really. The return value of java_closure() is resolved lazily. A PhpProcedureProxy becomes an InvocationHandler + Proxy$xxx when a Java procedure or setter is called.
In other words Java always sees the Proxy$xx and the PhpProcedure associated with it.
> I think he wants you to use the reflection API.
Yes. You need to retrieve the InvocationHandler and call its method.
Regards,
Jost Boekemeier
|
|
From: <php...@li...> - 2009-01-17 18:25:19
|
Hello!
If I pass $ccb, however, I also get a new object to PHP (again v="4"
$ccb is and has been your Proxy$0, so how can the same object have two object numbers? (note that you wrap your proxy, but the wrapped object is still the same).
So, what did you mean with "use the same procedure as above"?
I think he wants you to use the reflection API.
Peter
|
|
From: <php...@li...> - 2009-01-17 10:11:21
|
Hi Jost,
in one of your previous responses you wrote:
> cca.invokeA(ccb);
> is equivalent to:
> ((PhpProcedure)Proxy.getInvocationHandler($cca))).invoke($cca, "invokeA", new Object[]{ccb});
> Note the ccb, it has been resolved using the interface IB.
> If you want to invoke it dynamically, too, use the same procedure as above.
So, because of your last statement I passed ccb instead of $ccb.
If I pass $ccb, however, I also get a new object to PHP (again v="4" instead of v="3") which is the $Proxy0 now,
and this one does also not understand method invokeB() (resulting in a java.lang.NoSuchMethodException).
So, what did you mean with "use the same procedure as above"?
(I believe that if I'd resolve ccb using the interface IB - as you did in your example - then it might work.
But this is exactly what I want to avoid:
Java should be agnostic of whatever method I want to invoke in PHP.
The method name should just be passed onto Java and the method be invoked dynamically.
Otherwise I would always have to provide all these methods as Java interfaces before I could call them.
And this would shoot down all the dynamics of PHP here.)
But I think I start to understand where the general contradiction is,
so let me try to draw a sequence diagram in pseudo code in order to explain
what I believe you expect it to behave and what I actually expected.
You probably see it like this:
PHP Java
--------------------------------------------
0 (before here closures have been created already)
1 $c->call($a, $b)
2 call($cca, $ccb)
3 => cca = getInvocationHandler($cca)
4 => cca.invoke( $cca, "invokeA", $ccb )
5 $a.invokeA($b)
6 => $b.invokeB()
7 $ccb.invokeB()
8 $b.invokeB()
9 => echo '::B'
(and that is the same whether I replace $ccb by ccb or not)
Whereas what I'd expect is:
....
5 $a.invokeA($b)
6 => $b.invokeB() // no Java call here!
9 => echo '::B'
To put that into prosa:
I want $a to call invokeB() on $b WITHOUT going back to Java (that's why I expect v="3" to get passed to PHP).
But it seems to me that you expect that invokeB() is always invoked through Java.
Is this correct?
Is this by intention?
Is there any way for me to achieve what I want?
(Because when I know that invokeB() is just to be invoked on $b on the PHP-side why should I take the overhead of going back through Java again?)
Regards Jürgen
-----Ursprüngliche Nachricht-----
Von: php...@li... [mailto:php...@li...]
Gesendet: Montag, 12. Januar 2009 14:38
An: php...@li...
Betreff: Re: [Php-java-bridge-users] How to wrap two PHP objects as javaclosures,and in Java call a method on the first closure with the secondclosure as parameter?
Hi Juergen,
> public void call(Object $cca, Object $ccb) {
> cca.invoke( $cca, "invokeA", new Object[]{ ccb
> So, the PhpProcedure passed to invokeA() is a new one.
yes, obviously. ccb != $ccb. However, why is this a problem?
> (which in turn causes invokeB() to fail...) Did I find a bug here?
What do you mean with causes invokeB() to fail? The test case I've attached in my previous mail runs correctly, invokeB() correctly returned the string ::B, so I don't see the problem.
Regards,
Jost Boekemeier
|