users@grizzly.java.net

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

From: Oleksiy Stashok <oleksiy.stashok_at_oracle.com>
Date: Thu, 14 Jul 2011 10:33:00 +0200

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.get*StopAction*(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.get*InvokeAction*(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.