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 output conduits.
27  *
28  * @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a>
29  */

30 public abstract class AbstractSinkConduit<D extends SinkConduit> extends AbstractConduit<D> implements SinkConduit {
31
32     /**
33      * Construct a new instance.
34      *
35      * @param next the delegate conduit to set
36      */

37     protected AbstractSinkConduit(final D next) {
38         super(next);
39     }
40
41     public void terminateWrites() throws IOException {
42         next.terminateWrites();
43     }
44
45     public boolean isWriteShutdown() {
46         return next.isWriteShutdown();
47     }
48
49     public void resumeWrites() {
50         next.resumeWrites();
51     }
52
53     public void suspendWrites() {
54         next.suspendWrites();
55     }
56
57     public void wakeupWrites() {
58         next.wakeupWrites();
59     }
60
61     public boolean isWriteResumed() {
62         return next.isWriteResumed();
63     }
64
65     public void awaitWritable() throws IOException {
66         next.awaitWritable();
67     }
68
69     public void awaitWritable(final long time, final TimeUnit timeUnit) throws IOException {
70         next.awaitWritable(time, timeUnit);
71     }
72
73     public XnioIoThread getWriteThread() {
74         return next.getWriteThread();
75     }
76
77     public void setWriteReadyHandler(final WriteReadyHandler handler) {
78         next.setWriteReadyHandler(handler);
79     }
80
81     public void truncateWrites() throws IOException {
82         next.truncateWrites();
83     }
84
85     public boolean flush() throws IOException {
86         return next.flush();
87     }
88 }
89