Return-Path: Delivered-To: apmail-mina-users-archive@www.apache.org Received: (qmail 77161 invoked from network); 23 Oct 2008 15:18:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Oct 2008 15:18:33 -0000 Received: (qmail 27401 invoked by uid 500); 23 Oct 2008 15:18:35 -0000 Delivered-To: apmail-mina-users-archive@mina.apache.org Received: (qmail 27380 invoked by uid 500); 23 Oct 2008 15:18:35 -0000 Mailing-List: contact users-help@mina.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@mina.apache.org Delivered-To: mailing list users@mina.apache.org Received: (qmail 27369 invoked by uid 99); 23 Oct 2008 15:18:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Oct 2008 08:18:35 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ayyagarikiran@gmail.com designates 209.85.217.17 as permitted sender) Received: from [209.85.217.17] (HELO mail-gx0-f17.google.com) (209.85.217.17) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Oct 2008 15:17:23 +0000 Received: by gxk10 with SMTP id 10so1635036gxk.8 for ; Thu, 23 Oct 2008 08:18:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=iZ29qj0pmZg75+Bv3NwK4kjSlcb4CFYqqpLOwNX058Q=; b=r6puoMpeZ0+cYZhW9Pdlfb+u894FVSO6Nw3etm0O0Eusn6uMiWdkTOm2WK03FiU7OT QUC4bK+u+rS/gS8K3Sg/C8VhziB3La90az2CWNkDhe1eeTC3SGqfXpECf3LwSXIp80nr ARAvFXRDVPYggssmWy7HYuYa4mzNVKefN8LZg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=WggxVhHr6JIknaU5GVZAtWqhbYaMjcaaJllmGAyRxTIOy2LoobuowYDdPA0FG8ZqlU B2laIAkctlanqsD+xYpRidQMBZHj6IvtxN4bh1NiZ6vmXwwlbVl6PxTb1wUSOvt4h2Ld DESiCTdRZe2MbWaFJi6J6a20hUMa/NyV1tGw0= Received: by 10.142.240.19 with SMTP id n19mr381783wfh.191.1224775080015; Thu, 23 Oct 2008 08:18:00 -0700 (PDT) Received: from ?192.168.1.2? ([122.169.210.161]) by mx.google.com with ESMTPS id 27sm23994220wff.3.2008.10.23.08.17.57 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 23 Oct 2008 08:17:59 -0700 (PDT) Message-ID: <4900958A.10905@gmail.com> Date: Thu, 23 Oct 2008 20:47:30 +0530 From: Kiran Ayyagari User-Agent: Thunderbird 2.0.0.17 (X11/20080925) MIME-Version: 1.0 To: users@mina.apache.org Subject: Re: MINA - design guidelines References: <706475.33500.qm@web53503.mail.re2.yahoo.com> <20098916.post@talk.nabble.com> <20110316.post@talk.nabble.com> <48FF5AE9.3080305@nextury.com> <490080D9.8030608@nextury.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org How about using a xml pull parser http://www.xmlpull.org/. ( I have used it for reading the xmpp stanzas from a socket in a toy xmpp server impl ) Kiran Ayyagari Ashish wrote: >> Sounds like a pragmatic approach. If you _know_ that your XML messages will >> be simple, and that you can detext the closing tag whatever data and >> comments you will have into your XML, and that you can afford some bad >> input, that's just a fine approach. >> >> >> > > > > >>> 3. My limited knowledge of IoBuffer class has made code more cryptic >>> than it should have been :-) >>> >>> >> The IoBuffer class is just a wrapper (a proxy) on top of ByteBuffer. Every >> BytBuffer method is available in IoBuffer, but you have a few more >> functionalities, one of them is that the IoBuffer is extensible (for the >> record, it would have been much easier to extend the ByteBuffer class to >> offer this functionality, but, sadly, this class can't be extended, as the >> constructor is not public ...). So if you know how to deal with ByteBuffer, >> you should be confortable with IoBuffer. >> >>> I am inclined towards using regular expression for parsing and will >>> post the code if I am able to do that. >>> >>> >> You can also use JAXB with a byte stream unmarshaller (but a one which will >> be statefull). You may have to write your own unmarshaller, i'm afraid (but >> i'm not a specialist, so anyone with better knoweldge, please catch the ball >> ;) >> > > Well the problem of getting multiple xml mesages back to back, was > what I was trying to resolve. > But couldn't, coz, again didn't knew how to remove the read part from > IoBuffer, once the trailing message was detected > and if it continued for a while my System would be out of memory, I guess. > > BTW, when does the IoBuffer gets free up? > > Using an XML parser would be like too much, coz it would parse and > throw parse exception each time the xml was incomplete > and if the IoBuffer had trailing xml message, it won't parse crying > about invalid message :-( > > Again performance becomes critical. If anybody intent to use a similar > implementation, VTD-XML parser (http://vtd-xml.sourceforge.net/) will > be worth evaluating. > > I need to do some homework on IoBuffer/ByteBuffer, like how to copy > chunk from middle (something like substring) > and how to remove the mark once it's set. :-) > Long way to go > > >