1 /*
2 * JBoss, Home of Professional Open Source
3 *
4 * Copyright 2013 Red Hat, Inc. and/or its affiliates.
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19 package org.xnio.conduits;
20
21 import java.io.IOException;
22 import java.util.concurrent.TimeUnit;
23 import org.xnio.XnioIoThread;
24
25 /**
26 * An abstract base class for filtering source conduits.
27 *
28 * @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a>
29 */
30 public abstract class AbstractSourceConduit<D extends SourceConduit> extends AbstractConduit<D> implements SourceConduit {
31
32 /**
33 * Construct a new instance.
34 *
35 * @param next the delegate conduit to set
36 */
37 protected AbstractSourceConduit(final D next) {
38 super(next);
39 }
40
41 public void terminateReads() throws IOException {
42 next.terminateReads();
43 }
44
45 public boolean isReadShutdown() {
46 return next.isReadShutdown();
47 }
48
49 public void resumeReads() {
50 next.resumeReads();
51 }
52
53 public void suspendReads() {
54 next.suspendReads();
55 }
56
57 public void wakeupReads() {
58 next.wakeupReads();
59 }
60
61 public boolean isReadResumed() {
62 return next.isReadResumed();
63 }
64
65 public void awaitReadable() throws IOException {
66 next.awaitReadable();
67 }
68
69 public void awaitReadable(final long time, final TimeUnit timeUnit) throws IOException {
70 next.awaitReadable(time, timeUnit);
71 }
72
73 public XnioIoThread getReadThread() {
74 return next.getReadThread();
75 }
76
77 public void setReadReadyHandler(final ReadReadyHandler handler) {
78 next.setReadReadyHandler(handler);
79 }
80 }
81