View Javadoc

1   package org.apache.maven.it.util.cli;
2   
3   /*
4    * The MIT License
5    *
6    * Copyright (c) 2004, The Codehaus
7    *
8    * Permission is hereby granted, free of charge, to any person obtaining a copy of
9    * this software and associated documentation files (the "Software"), to deal in
10   * the Software without restriction, including without limitation the rights to
11   * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
12   * of the Software, and to permit persons to whom the Software is furnished to do
13   * so, subject to the following conditions:
14   *
15   * The above copyright notice and this permission notice shall be included in all
16   * copies or substantial portions of the Software.
17   *
18   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24   * SOFTWARE.
25   */
26  
27  /********************************************************************************
28   * CruiseControl, a Continuous Integration Toolkit
29   * Copyright (c) 2003, ThoughtWorks, Inc.
30   * 651 W Washington Ave. Suite 500
31   * Chicago, IL 60661 USA
32   * All rights reserved.
33   *
34   * Redistribution and use in source and binary forms, with or without
35   * modification, are permitted provided that the following conditions
36   * are met:
37   *
38   *     + Redistributions of source code must retain the above copyright
39   *       notice, this list of conditions and the following disclaimer.
40   *
41   *     + Redistributions in binary form must reproduce the above
42   *       copyright notice, this list of conditions and the following
43   *       disclaimer in the documentation and/or other materials provided
44   *       with the distribution.
45   *
46   *     + Neither the name of ThoughtWorks, Inc., CruiseControl, nor the
47   *       names of its contributors may be used to endorse or promote
48   *       products derived from this software without specific prior
49   *       written permission.
50   *
51   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
52   * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
53   * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
54   * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
55   * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
56   * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
57   * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
58   * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
59   * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
60   * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
61   * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
62   ********************************************************************************/
63  
64  /**
65   * Works in concert with the StreamPumper class to
66   * allow implementations to gain access to the lines being
67   * "Pumped".
68   *
69   * @author <a href="mailto:fvancea@maxiq.com">Florin Vancea</a>
70   * @author <a href="mailto:pj@thoughtworks.com">Paul Julius</a>
71   */
72  public interface StreamConsumer
73  {
74      /**
75       * Called when the StreamPumper pumps a line from the Stream.
76       */
77      public void consumeLine( String line );
78  }