View Javadoc

1   /*
2    * $Id: XmlMessageEOFProtocol.java 7976 2007-08-21 14:26:13Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.providers.tcp.protocols;
12  
13  /**
14   * Extend {@link org.mule.providers.tcp.protocols.XmlMessageProtocol} to continue reading
15   * until either a new message or EOF is found.
16   */
17  public class XmlMessageEOFProtocol extends XmlMessageProtocol
18  {
19  
20      /**
21       * Continue reading til EOF or new document found
22       *
23       * @param patternIndex The index of the xml tag (or -1 if the next message not found)
24       * @param len The amount of data read this loop (or -1 if EOF)
25       * @param available The amount of data available to read
26       * @return true if the read should continue
27       */
28      // @Override
29      protected boolean isRepeat(int patternIndex, int len, int available)
30      {
31          return patternIndex < 0;
32      }
33  
34  }