Re: JxtaBiDiServer and Output Pipe compatibility
Mohamed Abdelaziz <[email protected]> Tue, 20 Sep 2005 21:56:36 -0700
| Newsgroups | gmane.comp.java.jxta.user |
|---|---|
| Message-ID | <[email protected]> |
Glenn wrote: > Thanks, > > I have one other question regarding ModuleSpecAdvertisements and ModuleImplAdvertisements. > > The ModuleSpecAdvertisement may optionally contain a PipeAdvertisement, but the ModuleImplAdvertisement doesn't. This seems to imply that all implementations of a particular module specification must use the same PipeAdvertisement - if a pipe advertisement is specified. So if two services are described by the same Module Class advertisement, but one is implemented using JxtaServerPipe and the other using an Input Pipe (or each uses a different pipe advertisement) they should each have seperate Module Spec Advertisements. Is this accurate ? > right on. Mohamed -- http://blogs.sun.com/roller/page/hamada http://weblogs.java.net/blog/hamada > Thanks in advance, > > Glenn > > > Mohamed Abdelaziz wrote > > There's no way to distinguish or describe the protocol behind a pipe, <br>other than additional meta-data. As far as describing a service <br>protocol that's where the Module advertisements become handy by fully <br>describing a service class, specification, and implementations.<br><br><br>Mohamed<br>note: JxtaServerPipe should have thrown an io exception in that condition.<br><br>-- <br>http://blogs.sun.com/roller/page/hamada<br>http://weblogs.java.net/blog/hamada<br><br><br>Glenn wrote:<br><br>>Is there any way to distinguish when a pipe advertisement refers to a bidi pipe or a 'regular' pipe.<br>><br>>When using a JxtaBidiServer I remote publish a pipe advertisement i and a client peer that uses JxtaBiDiPipe can locate and send/receive information from the server peer. Unfortunately clients looking for a pipe advertisement (who will connect using an OutputPipe) can discover and attempt to use the pipe. This behavior results in the following NullPointerException in the > Server Peer:<br>><br>>java.lang.NullPointerException<br>> at net.jxta.util.JxtaBiDiPipe.lightweightOutputPipe(JxtaBiDiPipe.java:981)<br>> at net.jxta.util.JxtaServerPipe.processMessage(JxtaServerPipe.java:434)<br>> at net.jxta.util.JxtaServerPipe.accept(JxtaServerPipe.java:231)<br>> at com.sarnoff.test.bidi.server.MessengerServiceImpl$ServerThread.run(MessengerServiceImpl.java:168)<br>><br>>Using a JxtaBidiPipe to connect with a server with an InputPipe works as expected - the server can receive the message, but is obviously unable to successfully send a response.<br>><br>>I understand an InputPipe is not compatible with a JxtaBidiServer, I'm just hoping there is a way to distinguish between the two in a pipe advertisement, to avoid the issue. >