How to transfer large Object divide into many times?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

How to transfer large Object divide into many times?

yangjun2
see:
http://mina.apache.org/tutorial-on-protocolcodecfilter-for-mina-2x.html

this case ,how to implement filter using grizzly?
Best Regards,
Young
Reply | Threaded
Open this post in threaded view
|

Re: How to transfer large Object divide into many times?

oleksiys
Administrator
Here we have part (how to parse messages) in our docs [1].
And here is the complete Filter sample [2].

WBR,
Alexey.


[1]
http://grizzly.java.net/nonav/docs/docbkx2.0/html/coreframework-samples.html#parsing-incoming
[2]
http://java.net/projects/grizzly/sources/git/content/samples/framework-samples/src/main/java/org/glassfish/grizzly/samples/filterchain/GIOPFilter.java

On 06/08/2011 03:41 PM, yangjun2 wrote:
> see:
> http://mina.apache.org/tutorial-on-protocolcodecfilter-for-mina-2x.html
>
> this case ,how to implement filter using grizzly?
>
> --
> View this message in context: http://grizzly.1045725.n5.nabble.com/How-to-transfer-large-Object-divide-into-many-times-tp4469532p4469532.html
> Sent from the Grizzly - Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: How to transfer large Object divide into many times?

yangjun2
Thanks a lot!
Best Regards,
Young
Reply | Threaded
Open this post in threaded view
|

Re: How to transfer large Object divide into many times?

yangjun2
In reply to this post by oleksiys

// Instruct FilterChain to store the remainder (if any) and continue execution
 return ctx.getInvokeAction(remainder);

When use remainder pattern to  store the incompleted data , how to avoid thread loop all always to wait the remainder data?
Best Regards,
Young
Reply | Threaded
Open this post in threaded view
|

Re: How to transfer large Object divide into many times?

oleksiys
Administrator
Hi Young,

// Instruct FilterChain to store the remainder (if any) and continue
execution
 return ctx.getInvokeAction(remainder);

When use remainder pattern to  store the incompleted data , how to avoid
thread loop all always to wait the remainder data?
You can have 2 types of remainders:

1) Message (Buffer), which came doesn't have enough data to parse one single message - then you have to stop FilterChain processing and wait for more data.

return ctx.getStopAction(incompleteMessage);

2) Message (Buffer), which came contains more than one message. In this case you may want to split up the original message (Buffer) into two parts: one complete message and remainder and you'd probably want to continue FilterChain processing on the complete message, but remember that there is a remainder, which has to be parsed next. In this case you have to use:

return ctx.getInvokeAction(remainder);

Here is the sample [1].

Thanks.

WBR,
Alexey.

[1] http://java.net/projects/grizzly/sources/git/content/samples/framework-samples/src/main/java/org/glassfish/grizzly/samples/filterchain/GIOPFilter.java

-----
Best Regards, 
Young
--
View this message in context: http://grizzly.1045725.n5.nabble.com/How-to-transfer-large-Object-divide-into-many-times-tp4469532p4585783.html
Sent from the Grizzly - Users mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: How to transfer large Object divide into many times?

yangjun2
When client hasn't  send remainder data to server ,server cache message (recevie firstly) always?
When client close connetion, servere how to clear the cache message?
Best Regards,
Young
Reply | Threaded
Open this post in threaded view
|

Re: How to transfer large Object divide into many times?

oleksiys
Administrator
On 07/14/2011 11:56 AM, yangjun2 wrote:
> When client hasn't  send remainder data to server ,server cache message
> (recevie firstly) always?
> When client close connetion, servere how to clear the cache message?
Grizzly will take care of that.

WBR,
Alexey.

> -----
> Best Regards,
> Young
> --
> View this message in context: http://grizzly.1045725.n5.nabble.com/How-to-transfer-large-Object-divide-into-many-times-tp4469532p4586102.html
> Sent from the Grizzly - Users mailing list archive at Nabble.com.