01: /*
02: * InputMonitor.java February 2001
03: *
04: * Copyright (C) 2001, Niall Gallagher <niallg@users.sf.net>
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13: * GNU Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General
16: * Public License along with this library; if not, write to the
17: * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18: * Boston, MA 02111-1307 USA
19: */
20:
21: package simple.http;
22:
23: import java.io.InputStream;
24:
25: /**
26: * It is important to note that once one of these methods is invoked
27: * by an <code>InputStream</code> or an object that is monitoring an
28: * <code>InputStream</code> then the <code>InputStream</code> must
29: * not be used from that point on, that is, no more reading.
30: *
31: * @author Niall Gallagher
32: */
33: interface InputMonitor {
34:
35: /**
36: * This method will not do any thing but mark the stream as
37: * finished. This indicates that some object is finished with
38: * this <code>InputStream</code> the inpur stream should not
39: * be used further.
40: *
41: * @param in the <code>InputStream</code> being monitored
42: */
43: public void notifyFinished(InputStream in);
44:
45: /**
46: * This will notify that the stream in should be closed. The
47: * stream will be closed by the <code>InputMonitor</code> and
48: * not the object that is notifying the monitor, this mabye
49: * closed asynchronously.
50: *
51: * @param in the <code>InputStream</code> being monitored
52: */
53: public void notifyClose(InputStream in);
54:
55: /**
56: * This will notify that the stream has encountered an error.
57: * There should be no further interaction with the stream
58: * after this has been invoked. The stream will subsequently
59: * be closed by this.
60: *
61: * @param in the <code>InputStream</code> being monitored
62: */
63: public void notifyError(InputStream in);
64: }
|