You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by angel figueroa <an...@updatecom.com> on 2007/05/02 19:39:10 UTC

LinkedBlockingQueue Share Across all Session

How do you pass the reference to LinkedBlockingQueue to each new session
created ?
-- 
View this message in context: http://www.nabble.com/LinkedBlockingQueue-Share-Across-all-Session-tf3682079.html#a10290907
Sent from the mina dev mailing list archive at Nabble.com.


Re: LinkedBlockingQueue Share Across all Session

Posted by Trustin Lee <tr...@gmail.com>.
Hi Angel,

On 5/3/07, angel figueroa <an...@updatecom.com> wrote:
>
> Is correct to pass in the constructor of the IoHandlerAdapter ?
>
>         public TransServerHandler (LinkedBlockingQueue
> ISOTransRequest,LinkedBlockingQueue ISOTransResponse)

One IoHandler instance processes events for all sessions.  It's not
one-to-one relationship but one-to-many.

I suggest you use session attributes.

public void sessionCreated(IoSession session) {
    session.setAttribute("queue", new LinkedBlockingQueue());
}

HTH,
Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

Re: LinkedBlockingQueue Share Across all Session

Posted by peter royal <pr...@apache.org>.
On May 2, 2007, at 7:57 PM, angel figueroa wrote:
> Is correct to pass in the constructor of the IoHandlerAdapter ?
>
>         public TransServerHandler (LinkedBlockingQueue
> ISOTransRequest,LinkedBlockingQueue ISOTransResponse)

sure! you want to have a single LBQ instance across all sessions?  
that'd work great.

-pete

>
>
>
> angel figueroa wrote:
>>
>> How do you pass the reference to LinkedBlockingQueue to each new  
>> session
>> created ?
>>
>
> -- 
> View this message in context: http://www.nabble.com/ 
> LinkedBlockingQueue-Share-Across-all-Session-tf3682079.html#a10291424
> Sent from the mina dev mailing list archive at Nabble.com.
>
>


-- 
proyal@apache.org - http://fotap.org/~osi




Re: LinkedBlockingQueue Share Across all Session

Posted by angel figueroa <an...@updatecom.com>.
Is correct to pass in the constructor of the IoHandlerAdapter ?

        public TransServerHandler (LinkedBlockingQueue
ISOTransRequest,LinkedBlockingQueue ISOTransResponse)



angel figueroa wrote:
> 
> How do you pass the reference to LinkedBlockingQueue to each new session
> created ?
> 

-- 
View this message in context: http://www.nabble.com/LinkedBlockingQueue-Share-Across-all-Session-tf3682079.html#a10291424
Sent from the mina dev mailing list archive at Nabble.com.