Re: Adding a listener to an input pipe

"Ashutosh Adkar" <[email protected]> Fri, 29 Dec 2006 09:28:40 +0530
Newsgroups gmane.comp.java.jxta.user
Message-ID <[email protected]>
------=_Part_97721_26335898.1167364720220
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Funny.I thought there was method like myInputPipe.addListener(....).But I
just check the docs and there isn't one.I think one way to get around this
is is to pass a null reference to a listener and then assign that reference
to a live object when you want to assign a listener to that pipe.
Something like this,

   PipeMsgListener listener =3D null;

   myInputPipe =3D pipeService.createInputPipe(pipeAdv,listener);
   .....
   .....
   listener =3D new PipeMsgListener() {
   ....
   ....
   };

   Think this should work though ... :-P


On 12/27/06, Hugo Giusti <[email protected]> wrote:
>
> Hi everyone,
>
>
> I've been using myInputPipe =3D pipeService.createInputPipe(pipeAdv,liste=
ner)
> to create an input pipe and add a listener to it but I was wondering if
> there is a way to create the pipe and add the listener later, can anyone
> tell me how to do this?
>
> Thanks in advance.
> Hugo
>
>
>
>
> __________________________________________________
> Correo Yahoo!
> Espacio para todos tus mensajes, antivirus y antispam =A1gratis!
> =A1Abr=ED tu cuenta ya! - http://correo.yahoo.com.ar
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

------=_Part_97721_26335898.1167364720220
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Funny.I thought there was method like myInputPipe.addListener(....).But I j=
ust check the docs and there isn&#39;t one.I think one way to get around th=
is is is to pass a null reference to a listener and then assign that refere=
nce to a live object when you want to assign a listener to that pipe.
<br>Something like this,<br><br>&nbsp;&nbsp; PipeMsgListener listener =3D n=
ull;<br>&nbsp;<br>&nbsp;&nbsp; myInputPipe =3D pipeService.createInputPipe(=
pipeAdv,listener);<br>&nbsp;&nbsp; .....<br>&nbsp;&nbsp; ..... <br>&nbsp;&n=
bsp; listener =3D new PipeMsgListener() {<br>&nbsp;&nbsp; ....<br>&nbsp;&nb=
sp; ....
<br>&nbsp;&nbsp; };<br>&nbsp;&nbsp; <br>&nbsp;&nbsp; Think this should work=
 though ... :-P<br><br><br><div><span class=3D"gmail_quote">On 12/27/06, <b=
 class=3D"gmail_sendername">Hugo Giusti</b> &lt;<a href=3D"mailto:giustihug=
[email protected]">[email protected]
</a>&gt; wrote:</span><blockquote class=3D"gmail_quote" style=3D"border-lef=
t: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1=
ex;">Hi everyone,<br><br><br>I&#39;ve been using myInputPipe =3D pipeServic=
e.createInputPipe
(pipeAdv,listener) to create an input pipe and add a listener to it but I w=
as wondering if there is a way to create the pipe and add the listener late=
r, can anyone tell me how to do this?<br><br>Thanks in advance.<br>Hugo
<br><br><br><br><br>__________________________________________________<br>C=
orreo Yahoo!<br>Espacio para todos tus mensajes, antivirus y antispam =A1gr=
atis!<br>=A1Abr=ED tu cuenta ya! - <a href=3D"http://correo.yahoo.com.ar">h=
ttp://correo.yahoo.com.ar
</a><br><br>---------------------------------------------------------------=
------<br>To unsubscribe, e-mail: <a href=3D"mailto:[email protected]=
rg">[email protected]</a><br>For additional commands, e-mail: <a hr=
ef=3D"mailto:[email protected]">
[email protected]</a><br><br></blockquote></div><br>

------=_Part_97721_26335898.1167364720220--