IKVM and Apache Curator listner
Lams Yi <[email protected]>
| Newsgroups | gmane.comp.java.ikvm.devel |
|---|---|
| Message-ID | <CAMhKGbOak_cR3QJLDuL98ZeEh_q-troPUc=rXr2p3+g6jki8ZA@mail.gmail.com> |
Hi,
I try to use Apache Curator with .Net under IKVM.
Here is the java code I try to covert to C#. And here is the java doc:
http://curator.apache.org/apidocs/org/apache/curator/framework/listen/ListenerContainer.html#addListener(T)
--------------------------------------------------------
CuratorFramework client =
CuratorFrameworkFactory.newClient(server.getConnectString(), new
RetryOneTime(1));
client.start();
try
{
client.create().creatingParentsIfNeeded().forPath("/test/foo",
"one".getBytes());
client.getUnhandledErrorListenable().addListener
(
new UnhandledErrorListener()
{
@Override
public void unhandledError(String message, Throwable e)
{
error.set(e);
}
}
);
--------------------------------------------------------
In IKVM, the Listenable interface become:
--------------------------------------------------------
using IKVM.Attributes;
using java.util.concurrent;
namespace org.apache.curator.framework.listen
{
[Signature("<T:Ljava/lang/Object;>Ljava/lang/Object;")]
public interface Listenable
{
[Signature("(TT;)V")]
void addListener(object obj);
[Signature("(TT;Ljava/util/concurrent/Executor;)V")]
void addListener(object obj, Executor e);
[Signature("(TT;)V")]
void removeListener(object obj);
}
}
--------------------------------------------------------
My question is: how can I create a listener in C# and map the
Java anonymous function as the above sample?
Thanks,
Tao
------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
Ikvm-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ikvm-developers