[jboss-user] [Remoting] - Re: Stupid Bisocket question, how do I do invocations on the
ron.sigal@jboss.com
do-not-reply at jboss.com
Wed Nov 28 20:29:34 EST 2007
Ok, I understand the question. Remoting doesn't currently have a built-in server-to-client invocation facility directly analogous to the client-to-server invocation facility. Of course, you can always explicitly create a Connector on the client side and a Client on the server side.
On the other hand, Remoting has a server-to-client callback facility. Callbacks are like invocations but more general, in the sense that they can be stored on the server until the client retrieves them. One way to set up a callback connection is to create a Connector on the client side and pass an InvokerCallbackHandler and the Connector's InvokerLocator to Client.addListener(). Or, you could simply pass an InvokerCallbackHandler to Client.addListener() and Client will create the Connector for you. In the course of executing Client.addListener(), the server will call ServerInvocationHandler.addListener(). That's not something you should do yourself.
You should look at Section "5.6. Callbacks" of the Remoting Guide (http://labs.jboss.com/jbossremoting/docs/guide/index.html).
As for a bisocket example, well, it's somewhere on my list of things to do (JBREM-773), but, until then, you should look at the example in the org.jboss.remoting.samples.callback package, which uses the socket transport. Setting up a callback connection is largely the same for all transports. There are a few configuration differences between socket and bisocket, but the main one is the use of the org.jboss.remoting.transport.bisocket.Bisocket.IS_CALLBACK_SERVER parameter on the client side if you want the callback server to avoid the use of ServerSockets. (If you don't care about that, then you should be using the socket transport.) For example,
| InvokerCallbackHandler callbackHandler = new SampleCallbackHandler();
| HashMap metadata = new HashMap();
| metadata.put(Bisocket.IS_CALLBACK_SERVER, "true");
| client.addListener(callbackHandler, metadata);
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4108743#4108743
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4108743
More information about the jboss-user
mailing list